QEMU + FreeBSD

Matthias Apitz guru at unixarea.de
Sun Jun 28 06:09:33 UTC 2009


El día Friday, June 26, 2009 a las 10:37:14AM -0400, Jim escribió:

> I have installed FreeBSD 7.2 on my notebook in the last week, and
> installed QEmu as well.
> 
> I cannot seem to get the network interface working. It works on my
> desktop machine, but that is running 7.0
> 
> looking around, I tried to find some other options, and went here:
> http://wiki.freebsd.org/qemu
> 
> and got stuck at this step:
>  # sysctl net.link.ether.bridge_cfg=fxp0,tap0
>  # sysctl net.link.ether.bridge.enable=1
> 
> because nothing matching "net.link.ether.bridge*" exists.
> 
> Does anyone know of a current good setup document?
> 
> thanks,
> -Jim Stapleton

Jim,

You should have the following kernel modules loaded:

# kldload kqemu
# kldload if_tap
# kldload aio

Then you may either used a devd hook to ifconfig the interface or (as I
do) start 'qemu' as root. It will execute a shell script when it brings
up the interface as:

$ cat /usr/local/etc/qemu-ifup        
#!/bin/sh
/sbin/ifconfig $1 172.20.0.1

(for the 'ifconfig' you must be root, or use devd hook, or 'sudo' in the
script). That's all. Set the other end of the NIC in the guest system to
IP 172.20.0.2 end the communication with the host OS (your FreeBSD 7.2)
should be fine. 

To reach the outerworld from the guest, I'm using NAT in the host OS.
Check the FreeBSD handbook how to enable this.

HIH

	matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru at unixarea.de> - w http://www.unixarea.de/
People who hate Microsoft Windows use Linux but people who love UNIX use FreeBSD.


More information about the freebsd-questions mailing list