From owner-freebsd-emulation@FreeBSD.ORG Fri Jun 1 19:50:53 2007 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4E9316A400 for ; Fri, 1 Jun 2007 19:50:53 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (ns1.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id C79D213C4BE for ; Fri, 1 Jun 2007 19:50:53 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id F060B5B49; Fri, 1 Jun 2007 12:50:49 -0700 (PDT) To: Per Hedeland In-reply-to: Your message of "Fri, 01 Jun 2007 21:07:45 +0200." <200706011907.l51J7jH2002189@pluto.hedeland.org> Date: Fri, 01 Jun 2007 12:50:49 -0700 From: Bakul Shah Message-Id: <20070601195049.F060B5B49@mail.bitblocks.com> Cc: freebsd-emulation@freebsd.org Subject: Re: Running "Windows Emulation" headless ... possible? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 19:50:54 -0000 > >> >> 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).