Ubuntu testdrive networked to your LAN

testdrive uses the -net user feature of kvm by default, which is really cool because it becomes a lan client and magically gets internet via proxy. If you want to test server software, you probably want your testdrive VM directly on the same LAN as your host OS.

In my case I already had a bridge setup so it was as simple as changing the -net option on my kvm command line.

kvm -m 1024 -smp 2 -cdrom /home/jrwren/.cache/testdrive/iso/ubuntu_precise-desktop-amd64.iso -drive file=/home/jrwren/.cache/testdrive/img/testdrive-disk-43F4RO.img,if=virtio,cache=writeback,index=0,boot=on -usb -usbdevice tablet -net nic,model=virtio -net tap -soundhw es1370 -vga cirrus -vnc 127.0.0.1:1 -k en-us

 

brctl will now show you the new tap device added to your bridge.

bridge name     bridge id               STP enabled     interfaces
br0             8000.001fd085d98b       no              eth0
eth2
tap0
tap1

The only drawback is that kvm has to be run as root. There is a way around that by specifying a network interface start script which would be suidroot, but for a personal system or testing development system, I find that overkill. I let her run as root.