QEMU networking quirkiness on 7.0

Jim Stapleton stapleton.41 at gmail.com
Thu Apr 10 01:25:20 UTC 2008

On Wed, Apr 9, 2008 at 9:18 AM, Andrew Cid <andrew at accid.net> wrote:
> Hi Jim,
>  > The QEmu VM can access the web (I'm typing this out now in WindowsXP
>  > running safely in it's cage, for example). But it cannot VPN into work
>  > (timeout) or ping anything. I suspect it has to do with the way that
>  > QEmu is given network access. Is there any way to set up QEmu to
>  > access the network through an aliased IP address, and hence look like
>  > any other machine on my network, rather than to hide behind my BSD
>  > box? Is there another route I should take?+
>  I connect my qemu boxes via the tap interface and then bridge it to the
>  external interface so it works like just another box on the LAN.  It's
>  quite easy to setup and works pretty well, checkout:
>  http://people.freebsd.org/~maho/qemu/qemu.html

I just C&Ped a huge section and tacked it on to the end of this mail.
It says to do this within the emulator, but the emulator is supposedly
running win2k. I take it this is done on the host system?

-Jim Stapleton

Default, network is configured inside of the emulator; not visible
from outside. This is not absolutely confotable! There are pros and
cons: you must be the root and your qemu virtual machine is visible
from outside. Assume you know your network interface name. In my case
this is fxp0. you can check this by:

% dmesg | grep Ethernet

First, as root,

# kldload bridge.ko
# sysctl net.link.ether.bridge_cfg=fxp0,tap0
net.link.ether.bridge_cfg:  -> fxp0,tap0
# sysctl net.link.ether.bridge.enable=1
net.link.ether.bridge.enable: 0 -> 1

create /etc/qemu-ifup script as

ifconfig ${1}

and make this script runnable.

# chmod 755 /etc/qemu-ifup

To do this at every boot time, write /etc/sysctl.conf


More information about the freebsd-questions mailing list