VirtualBox bridged adapter (vboxnetflt)

Fredrik Lindberg fli at shapeshifter.se
Fri Aug 21 14:48:55 UTC 2009


Hi

I've started working on the missing bits of the FreeBSD network
implementation in VirtualBox.

I now have a working vboxnetflt.ko driver that allows automatic
bridged networking in VirtualBox (probably what most people want).
This allows guests to automatically bridge with your existing
network adapter providing seamless network access.

Work on host-only adapter mode is in progress (this should not
be confused with host-interface in previous vbox 2.x releases).

The patch can be found at
http://www.shapeshifter.se/pub/patches/vbox-freebsd-network.patch

Additional patch for emulators/virtualbox/Makefile
http://www.shapeshifter.se/pub/patches/virtualbox-Makefile.patch


You'll have to rebuild VirtualBox to make it work, the following lines
should do the trick.

cd /usr/ports/emulators/virtualbox
make clean patch
mkdir work/virtualbox-3.0.51r22226/src/VBox/HostDrivers/VBoxNetFlt/freebsd

patch -d work/virtualbox-3.0.51r22226 < vbox-freebsd-network.patch
patch < virtualbox-Makefile.patch
make install

In addition to vboxdrv.ko you'll need to load vboxnetflt.ko too.

kldload /boot/modules/vboxnetflt.ko

In VirtualBox network settings, under "Bridged Adapter" you should now
see your available network interfaces. Select the one connected to your
network and boot your virtual machine.  It should now be connected to
your local network as any other machine.


Please note that this is just the first iteration of the patch and it
should by no means be considered complete. It has only been tested
on FreeBSD 8/i386.  Slippery when wet :)


The kld is also a bit hackish at the moment regarding to how it
interfaces with the network stack to avoid kernel code modifications.

Fredrik


More information about the freebsd-emulation mailing list