Docunext


QEMU vde Notes Revisited

July 10th, 2007

It is happening again... so here are lots of lots of notes on setting up QEMU, VDE, FreeBSD, Debian, tun/tap.

QEMU direct to a host bridge via tap0 only allows for one guest per tunnel. That's no good! We want vde_switch to connect to tap0, and for QEMU guests to connect to vde_switch.

Don't forget:

mknod /dev/kqemu c 250 0

chmod 666 /dev/kqemu

Here's some updated QEMU notes:

  1. vde_switch -tap tap0 -daemon
  2. ifconfig tap0 up
  3. brctl addif br0 tap0
  4. sudo vdeqemu -m 512 -vnc :2 -net nic,macaddr=00:11:22:ee:ff:44 -net vde deb4vde.raw &

NOTE: You will have to come up with unique mac addresses for each virtual machine you attach to the vde switch!

Here is a new entry on the network when I do an nmap scan:

Host 192.168.0.188 appears to be up.
MAC Address: 52:54:00:12:34:56 (QEMU virtual NIC)

Also, I still need to put the follow in /etc/qemu-ifup:

#!/bin/sh
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2

On FreeBSD: kldload if_bridge ifconfig bridge create ifconfig bridge0 addm sis0 addm tap0 up

vdeqemu -vnc :1 -net nic,macaddr=12:43:12:12:23:32 -net nic,vlan=3 \ -net vde /usr/jail/root/m0n0jab/work/image.bin

Make sure to use the VLAN tag otherwise you'll get some serious broadcast storms.

Related:

http://lists.debian.org/debian-user/2006/01/msg01598.html

http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022