From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Re: booting a terminal in qemu In-reply-to: Your message of "Tue, 27 Feb 2007 18:24:01 EST." From: Bakul Shah Date: Wed, 28 Feb 2007 12:13:19 -0800 Message-Id: <20070228201319.A141B5B51@mail.bitblocks.com> Topicbox-Message-UUID: 16fc86a4-ead2-11e9-9d60-3106f5b1d025 > 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.