Running "Windows Emulation" headless ... possible?

Bakul Shah bakul at
Fri Jun 1 19:50:54 UTC 2007

> >> >> Can I run two or more QEMU instances on the same server with different 
> IPs
> >> ?
> >> >
> >> > Yes.  But you have to make sure each machine gets its own mac
> >> > address.
> >> 
> >> Is that addressed using the tap interface, as Scott mentioned?
> >
> >Yes.
> Hm, maybe I misunderstand the question or the answer, but I disagree.:-)

I interepreted "Is that addressed using the tap interface" to
mean "Is that done (by) using the tap interface".  So I was not
talking about mac address of the tap interface!

> The tap devices get their own MAC addresses, but they're basically
> irrelevant - what you *do* need to do is give the *qemu* instances their
> own MAC addresses, e.g. as '-net nic,macaddr=52:54:00:12:34:67' (the
> default is 52:54:00:12:34:56 - I have no idea if qemu has reserved the
> 52:54:00 prefix, but I'm sticking to it:-). This is the MAC address that
> shows up on the interface in the guest, and that everyone else on the
> same network uses to reach it.

Right. I use a shell function to create a macaddress based on
directory of the image file.  Something like:

macaddr() {
	echo 52:54:0:$(echo $1|md5 |cut -c1-6|sed 's/\(..\)\(..\)/\1:\2:/')
qemu -net nic,macaddr=$(macaddr $(dirname $(realpath $1))) -hda $*

And invoke it as, for example,

my-qemu /usr/oszoo/plan9 ...

> - I never give an IP address to the bridge interface - this is wrong(tm)
>   IMHO, and in any case there should not be any need for it.

I do, to simulate this:

bridge0 --[       ]
	   | | | |
	   0 1 2 3 <- tap interfaces

In effect tap0 .. tapN are to individual VMs and the host
uses just bridge0 to talk to them all.  Also see below.

> - I don't have anything about tap in devfs.conf - but I have the
>   corresponding thing set up via devfs.rules, which I believe is the
>   right place for it to work "dynamically":

Good idea.

> cloned_interfaces="bridge0"
> ifconfig_bridge0="addm bge0 up"

Bridging with the phys device won't work if your VMs are on a
wifi connected laptop.  For this reason I use NAT (and it is
good enough for what I want).

More information about the freebsd-emulation mailing list