Hello
On Tue, 02 Feb 2010 05:35:28 -0600
Vijay Sankar <vsan...@foretell.ca> wrote:
> Matthias Pfeifer wrote:
> > Hello list
> >
> > I am trying to get multiple qemu guests on
> > host machine running. Host and guests are running
> > openbsd 4.6 in sync with the patch brunch.
> >
> > The Host IP is: 192.168.102.110
> > The guest should have: 192.168.102.111, 192.168.102.112 ..
> > and so on. All in the same network, using the same DNS server
> > and gateway.
> >
> > I have read /usr/local/share/doc/qemu/README.OpenBSD
> > and tried the samples in the tap section. This works
> > fine for one host.
> >
> > For example, this is working well for one host:
> >
> > ifconfig tun0 link0
> > ifconfig bridge0 create
> > brconfig bridge0 add tun0 add rl0 up
> >
> > qemu -net nic,macaddr=52:54:00:12:35:10 \
> > -net tap,fd=3 \
> > -name Host1 \
> > -no-fd-bootchk \
> > -hda Host1/system.img 3<>/dev/tun0
> >
> >
> > Then, I'd like to doing this:
> >
> > ifconfig tun1 link0
> > ifconfig bridge1 create
> > brconfig bridge1 add tun1 add rl0 up
> >
> > qemu -net nic,macaddr=52:54:00:12:35:11 \ ## MAC changed
> > -net tap,fd=4 \ ## fd changed
> > -name Host1 \
> > -no-fd-bootchk \
> > -hda Host2/system.img 4<>/dev/tun1 ## tun interface changed
> >
> >
> > But this fails. Is there a way to do something like this
> > without adding a real NIC?
> >
> >
> > Thanks in advance!
> >
> > Matthias
> >
>
> NOTE: sudo calls closefrom(2). In order to have more than one fd passed
> tap interface, a line to sudoers akin to:
>
> Defaults closefrom_override
>
> then calling sudo via 'sudo -C 5 -u $USER qemu ..' is required.
> See sudoers(5) and sudo(8) for details.
>
> --
> Vijay Sankar, M.Eng., P.Eng.
> ForeTell Technologies Limited
> 59 Flamingo Avenue, Winnipeg, MB, Canada R3J 0X6
> Phone: (204) 885-9535, E-Mail: vsan...@foretell.ca
>
I have added "Defaults closefrom_override" to /etc/sudoers.
So i am using the tun0 for the second qemu host:
sudo sh -c " sudo -C 5 -u qemu qemu -net nic,macaddr=52:54:00:12:35:10 \
-net tap,fd=3 -name DSB -no-fd-bootchk -hda host1/system.img 3<>/dev/tun0"
Working fine. Then the second:
sudo sh -c " sudo -C 5 -u qemu qemu -net nic,macaddr=52:54:00:12:35:10 \
-net tap,fd=4 -name DSB -no-fd-bootchk -hda host1/system.img 4<>/dev/tun0"
this gives me a " cannot create /dev/tun0: Device busy "