Thread: qemu networking
View Single Post
  #1   (View Single Post)  
Old 18th December 2011
gpatrick gpatrick is offline
Spam Deminer
 
Join Date: Nov 2009
Posts: 245
Default qemu networking

OpenBSD 5.0 is installed and ran a pkg_add for qemu-0.14.1p4. I have created a disk image for OpenBSD 5.0 and can successfully start qemu with that image, however, I am unable to get networking for the OpenBSD guest inside Qemu.

I followed an article on undeadly.org:
Code:
# cat /etc/hostname.bridge0
add re0
add tun0
up

#cat /etc/hostname.tun0
link0 up

# cat /etc/rc.local
if [ -x /usr/local/bin/qemu ]; then
    echo -n 'Qemu: vmi386'
    sh -c "sudo -C 4 -u qemuuser \
        /usr/local/bin/qemu \
        -daemonize \
        -nographic \
        -net nic,vlan=0,model=rtl8139,macaddr=aa:aa:aa:aa:aa:aa \
        -net tap,vlan=0,fd=3,script=no \
        -m 512 \
        -hda /path/to/raw/disk.img \
        -serial null \
        -monitor null \
        -no-fd-bootchk 3<>/dev/tun0"
    echo "."
fi
Note: I changed the MAC.

But I am unable to get it to work. I get:
Code:
Qemu: vmi386qemu: -net, tap,vlan=0,fd=3,script=no: ifname=, script=, downscript= 
and vnet_hdr= is invalid with fd=
qemu: -net tap,vlan=0,fd=3,script=no: Device 'tap' could not be initialized
I have searched for Qemu networking on an OpenBSD host but there isn't much out there. Does anyone have steps to get networking with tap/tun in an OpenBSD guest using Qemu on an OpenBSD host?
Reply With Quote