9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] booting a terminal in qemu
@ 2007-02-27 19:30 John Floren
  2007-02-27 21:12 ` Steve Simon
  2007-02-27 22:40 ` [9fans] " John Floren
  0 siblings, 2 replies; 11+ messages in thread
From: John Floren @ 2007-02-27 19:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi everyone

I'm playing around with qemu a bit, and I'm hoping somebody can help
me with this. I'd like to set up a terminal that either boots entirely
from my server or at least mounts the root from it. Anyone with
experience in this kind of thing? I'm not quite sure where I need to
set things up, what kind of options to use with qemu, etc.


John Floren
-- 
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] booting a terminal in qemu
  2007-02-27 21:12 ` Steve Simon
@ 2007-02-27 21:09   ` William Josephson
  0 siblings, 0 replies; 11+ messages in thread
From: William Josephson @ 2007-02-27 21:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Feb 27, 2007 at 09:12:21PM +0000, Steve Simon wrote:
> I don't know how you would use qemu to netboot plan9 as the server
> uses the ethernet address of the client to decide who it is and which
> kernel it give it. As this MAC is also assigned to the host machine
> then things could get confused, perhaps there is some way of virtualising
> MACs?

You can just assign one to the virtual NIC and use bridging.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] booting a terminal in qemu
  2007-02-27 19:30 [9fans] booting a terminal in qemu John Floren
@ 2007-02-27 21:12 ` Steve Simon
  2007-02-27 21:09   ` William Josephson
  2007-02-27 22:40 ` [9fans] " John Floren
  1 sibling, 1 reply; 11+ messages in thread
From: Steve Simon @ 2007-02-27 21:12 UTC (permalink / raw)
  To: 9fans

I don't know how you would use qemu to netboot plan9 as the server
uses the ethernet address of the client to decide who it is and which
kernel it give it. As this MAC is also assigned to the host machine
then things could get confused, perhaps there is some way of virtualising
MACs?

The cleanst way to boot a terminal is PXE as this means it can be
diskless. Failing this you can boot 9load locally, which will use
DHCP to get an IP address and the name of the kernel to fetch.
Finally you can boot moth 9load and the kernel from the local disk but
fetch your filesystem root from the remote server.

The only difference between these options is the extra hassle required to
keep the terminal's kernel up to date.

To boot from the network you will probably need to put some more detail into
/lib/ndb/local. if you can go the PXE route then put its plan9.ini /cfg/pxe/xxxxxxx
where xxxxxx is the MAC address of the terminal in lower case hex.

here is an example, though is relates to native plan9 rather than
qemu, but hopefully the recipe will be similar.
My file/auth/cpu server is felix, the terminal is glass

contents of /cfg/pxe/0002b31af559

	bootfile=ether0!felix!/386/9pc
	bootargs=tcp
	nobootprompt=tcp
	vgasize=1024x768x8
	monitor=xga
	mouseport=ps2
	ether0=type=i82557 media=100BASE-FX

from /lib/ndb/local

	sys=brick ether=0002b31af559
	ip=192.168.0.7
	bootf=/386/9pxeload

	ipnet=myhome ip=192.168.0.0 ipmask=255.255.255.0
		ipgw=192.168.0.1
		dns=194.168.4.100 dns=194.168.8.100
		dnsdomain=quintile.net
		nntp=news.myisp.com
		smtp=smtp.myisp.com
		ntp=gb.public.ntp.get-time.net
		authdom=home.quintile.net
		auth=felix
		cpu=felix
		fs=felix
-Steve


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] Re: booting a terminal in qemu
  2007-02-27 19:30 [9fans] booting a terminal in qemu John Floren
  2007-02-27 21:12 ` Steve Simon
@ 2007-02-27 22:40 ` John Floren
  2007-02-27 23:24   ` Russ Cox
  1 sibling, 1 reply; 11+ messages in thread
From: John Floren @ 2007-02-27 22:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Well, I tried the simplest thing--running qemu with -net nic -net user
and just selecting "root from" as tcp on my standalone terminal.
I typed "tcp -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0" (I
gathered this by booting normally, running ip/ipconfig, and reading
/net/ndb), then I entered my server's address at the prompts for file
and auth servers. However, after I give it my username and hit enter,
I get the following:
boot: can't connect to file server: connection refused
panic: boot process died: unknown
panic: boot process died: unknown
dumpstack disabled
cpu0: exiting

I had previously opened /srv/fscons and entered "listen tcp!*!564"
Is there a way to check if my requests are even getting through to the
file server?
Thanks


John Floren
-- 
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-27 22:40 ` [9fans] " John Floren
@ 2007-02-27 23:24   ` Russ Cox
  2007-02-28 19:10     ` ron minnich
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Russ Cox @ 2007-02-27 23:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

This should work as far as Plan 9 is concerned.
It's qemu that is troublesome.  One possible approach
to debugging is to boot the live (install) CD and then
run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0
and see if that's enough to get a working network (i.e.,
can you ping or telnet to port 567 or 9fs the remote machine).

I have this script as my /etc/qemu-ifup, though I can't
remember exactly why it is needed:

#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1

Russ


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-27 23:24   ` Russ Cox
@ 2007-02-28 19:10     ` ron minnich
  2007-02-28 19:34     ` Armando Camarero
  2007-02-28 20:13     ` Bakul Shah
  2 siblings, 0 replies; 11+ messages in thread
From: ron minnich @ 2007-02-28 19:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

FWIW, the tiny horrible xen boots a terminal just fine. We've booted
from random places with 9grid.net as our fs etc. server.

ron


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-27 23:24   ` Russ Cox
  2007-02-28 19:10     ` ron minnich
@ 2007-02-28 19:34     ` Armando Camarero
  2007-02-28 19:51       ` Gabriel Diaz
  2007-03-01  3:11       ` erik quanstrom
  2007-02-28 20:13     ` Bakul Shah
  2 siblings, 2 replies; 11+ messages in thread
From: Armando Camarero @ 2007-02-28 19:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Russ Cox escribió:
> This should work as far as Plan 9 is concerned.
> It's qemu that is troublesome.  One possible approach
> to debugging is to boot the live (install) CD and then
> run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0
> and see if that's enough to get a working network (i.e.,
> can you ping or telnet to port 567 or 9fs the remote machine).
>
> I have this script as my /etc/qemu-ifup, though I can't
> remember exactly why it is needed:
>
> #!/bin/sh
> sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
>
> Russ
I'm trying to manually configure the NIC in a normal Plan 9 install on
QEMU. If I run ip/ipconfig (so it gets configured using DHCP) /net/ndb
looks:

ip=10.0.2.15 ipmask=255.255.255.0 ipgw=10.0.2.2
    dns=10.0.2.3

and network works fine.

But if I run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15
255.255.255.0 it looks:

ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2

and I can't use network. Is "ipmask=/120" correct?

Is this what makes Plan 9 not boot using network in QEMU?

Armando.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-28 19:34     ` Armando Camarero
@ 2007-02-28 19:51       ` Gabriel Diaz
  2007-03-01  3:11       ` erik quanstrom
  1 sibling, 0 replies; 11+ messages in thread
From: Gabriel Diaz @ 2007-02-28 19:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

hello

i think /120 is /24 in ipv6 address space, it seems correct to me.

gabi


On 2/28/07, Armando Camarero <arcepi@arcepi.net> wrote:
> Russ Cox escribió:
> > This should work as far as Plan 9 is concerned.
> > It's qemu that is troublesome.  One possible approach
> > to debugging is to boot the live (install) CD and then
> > run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0
> > and see if that's enough to get a working network (i.e.,
> > can you ping or telnet to port 567 or 9fs the remote machine).
> >
> > I have this script as my /etc/qemu-ifup, though I can't
> > remember exactly why it is needed:
> >
> > #!/bin/sh
> > sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
> >
> > Russ
> I'm trying to manually configure the NIC in a normal Plan 9 install on
> QEMU. If I run ip/ipconfig (so it gets configured using DHCP) /net/ndb
> looks:
>
> ip=10.0.2.15 ipmask=255.255.255.0 ipgw=10.0.2.2
>     dns=10.0.2.3
>
> and network works fine.
>
> But if I run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15
> 255.255.255.0 it looks:
>
> ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2
>
> and I can't use network. Is "ipmask=/120" correct?
>
> Is this what makes Plan 9 not boot using network in QEMU?
>
> Armando.
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-27 23:24   ` Russ Cox
  2007-02-28 19:10     ` ron minnich
  2007-02-28 19:34     ` Armando Camarero
@ 2007-02-28 20:13     ` Bakul Shah
  2 siblings, 0 replies; 11+ messages in thread
From: Bakul Shah @ 2007-02-28 20:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> This should work as far as Plan 9 is concerned.
> It's qemu that is troublesome.  One possible approach
> to debugging is to boot the live (install) CD and then
> run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0
> and see if that's enough to get a working network (i.e.,
> can you ping or telnet to port 567 or 9fs the remote machine).

In "qemu -net user" mode there are all sorts of restrictions
as qemu emulates the network layer + some userful services.
In particular all connections must be initiated from the VM
and ping won't work except to the port emulated by qemu.
Though, telnet from the VM should should work.  if a p9
terminal needs to `listen' on a port, -net user won't work.

> I have this script as my /etc/qemu-ifup, though I can't
> remember exactly why it is needed:
> 
> #!/bin/sh
> sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1

When you use -net tap, this script sets IP address for the
host side of the tap interface.  Packets pushed on this
interface pop up in corresponding /dev/tapN device (to be
read by qemu) and vice versa.

A more useful thing to do is to bridge the tap interface to
host's physical interface (or the host has to be a router and
provide other necessary things in your enviroments, such as
dhcp daemon or relay etc.).  Under FreeBSD-6 or later you can
have qemu-ifup do something like

#!/bin/sh
sudo sh -c "/sbin/ifconfig $1 up; /sbin/ifconfig bridge0 addm $1"

You don't need to give either bridge0 or the tap device any
IP address.  Prior to invoking qemu run the following and
also add these lines to /etc/rc.local.

/sbin/ifconfig bridge0 create
/sbin/ifconfig bridge0 addm em0 up

Replace em0 with your machine's real ethernet interface name.
If you want to run more than one qemu instance on the same
machine, you will need to specify mac addresses for
additional instances.

I imagine similar instructions exist for a linux/windows/mac hosts.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-02-28 19:34     ` Armando Camarero
  2007-02-28 19:51       ` Gabriel Diaz
@ 2007-03-01  3:11       ` erik quanstrom
  2007-03-01 13:15         ` Armando Camarero
  1 sibling, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2007-03-01  3:11 UTC (permalink / raw)
  To: 9fans, Armando Camarero

you learn something new every day.  i didn't know about the -p option to ip/ipconfig.

the function that does the work for dhcp and ip/ipconfig is parseipmask(2).
parseipmask does not differentiate between "255.255.255.0" and "/120",
so it is not likely to be the problem.

the other difference in your ndb entries is the missing dns entry in
the second.  how did you check that the network doesn't work?  have you tried to
ping the gateway?
	ip/ping 10.0.2.2
if that works, it's a dns problem.

- erik

Armando Camarero <arcepi@arcepi.net> writes

| I'm trying to manually configure the NIC in a normal Plan 9 install on
| QEMU. If I run ip/ipconfig (so it gets configured using DHCP) /net/ndb
| looks:
| 
| ip=10.0.2.15 ipmask=255.255.255.0 ipgw=10.0.2.2
|     dns=10.0.2.3
| 
| and network works fine.
| 
| But if I run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15
| 255.255.255.0 it looks:
| 
| ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2
| 
| and I can't use network. Is "ipmask=/120" correct?
| 
| Is this what makes Plan 9 not boot using network in QEMU?
| 
| Armando.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Re: booting a terminal in qemu
  2007-03-01  3:11       ` erik quanstrom
@ 2007-03-01 13:15         ` Armando Camarero
  0 siblings, 0 replies; 11+ messages in thread
From: Armando Camarero @ 2007-03-01 13:15 UTC (permalink / raw)
  To: erik quanstrom; +Cc: 9fans

erik quanstrom escribió:
> you learn something new every day.  i didn't know about the -p option to ip/ipconfig.
>
> the function that does the work for dhcp and ip/ipconfig is parseipmask(2).
> parseipmask does not differentiate between "255.255.255.0" and "/120",
> so it is not likely to be the problem.
>
> the other difference in your ndb entries is the missing dns entry in
> the second.  how did you check that the network doesn't work?  have you tried to
> ping the gateway?
> 	ip/ping 10.0.2.2
> if that works, it's a dns problem.
>
> - erik
I tried again and network works. I tried network using links the first
time, but it doesn't seem to understand that 172.26.0.4 shouldn't be
resolved via DNS. Ping to the QEMU gateway works and I can test that TCP
does too using ssh (well, I just see the error message that says it
doesn't support SSH2).

Armando.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-01 13:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-27 19:30 [9fans] booting a terminal in qemu John Floren
2007-02-27 21:12 ` Steve Simon
2007-02-27 21:09   ` William Josephson
2007-02-27 22:40 ` [9fans] " John Floren
2007-02-27 23:24   ` Russ Cox
2007-02-28 19:10     ` ron minnich
2007-02-28 19:34     ` Armando Camarero
2007-02-28 19:51       ` Gabriel Diaz
2007-03-01  3:11       ` erik quanstrom
2007-03-01 13:15         ` Armando Camarero
2007-02-28 20:13     ` Bakul Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).