DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th December 2011
gpatrick gpatrick is offline
Shell Scout
 
Join Date: Nov 2009
Posts: 120
Thanked 0 Times in 0 Posts
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
  #2   (View Single Post)  
Old 18th December 2011
gpatrick gpatrick is offline
Shell Scout
 
Join Date: Nov 2009
Posts: 120
Thanked 0 Times in 0 Posts
Default

After more searching and trial and error I am able to get an em0 interface with the macaddr in the OpenBSD guest but am unable to ping my gateway.

Used:
Code:
# sudo sh -c "sudo -C 5 -u user qemu -net nic,macaddr=fe:e1:ab:c0:af:3c -net tap,fd=3 -name openbsd -m 64 -hda /tmp/openbsd50.img 3<>/dev/tun0"
Reply With Quote
  #3   (View Single Post)  
Old 18th December 2011
gpatrick gpatrick is offline
Shell Scout
 
Join Date: Nov 2009
Posts: 120
Thanked 0 Times in 0 Posts
Default

I was able to get it working.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD QEMU-1.0-RC2 J65nko News 2 17th November 2011 03:07 PM
qemu & kqemu adamk FreeBSD General 10 9th October 2008 03:27 PM
Jailed QEMU + other OS revzalot FreeBSD Installation and Upgrading 3 29th May 2008 06:00 PM
ssh to FreeBSD run in Qemu mfaridi FreeBSD Security 11 19th May 2008 01:00 PM


All times are GMT. The time now is 03:41 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick