[vbox-dev] Patch for vboxnetflt with Wireless Adapter - Linux kernel 3.18.0

Valerio Daelli valerio.daelli at gmail.com
Sat Apr 4 10:24:22 UTC 2015


  I am using Gentoo Linux with a 3.18.0 kernel and VirtualBox 4.3.18.
If I use this configuration, I am unable to reach the outside world
from any VM via the wireless network adapter - Bridged Adapter (Intel
Wireless WiFi Link 3945ABG - iwl3945).
-if I use an Ethernet adapter, everything works fine
-if I use a wireless adapter with a VM, I can reach the internal IP of
  the adapter, but I cannot reach the external world: I cannot reach
the Access Point, the Internet,
  or anything else in the outside world - including VMs on different
physical hosts with wireless cards (same subnet of course).

So I created this small patch. With this patch:
-I can use the Ethernet Adapter
-I can reach via the Wireless adapter the internal IPs of the adapter,
as well as the
  outside world.

Basically I translate the MAC addresses of the VMs to the MAC address
of the Wireless card,
I keep a table of such translations to revert them when a packet comes in.
(This is similar to NAT, except I work with both MAC addresses and IP

You can try my patch with a 3.18.0 kernel and VirtualBox 4.3.18:

mkdir vmcomp/
cd vmcomp/
tar -xJvpf ../vbox-kernel-module-src-4.3.18.tar.xz
patch -p0 < ../PATCH-vboxnetflt
cd vboxnetflt
insmod ./vboxnetflt.ko

I did not have time to let DHCP (broadcast address) work (anyway it
works with dhcrelay
executed on the same machine of the VMs) - I mean that I am able to
get an IP address on the VMs
via DHCP with dhcrelay, but I did not have time to test it
extensively, and I know that depending on dhcrelay
is not the cleanest setup.
I did not have time to test Multicast addresses, I guess they actually
do not work, but I am not sure.

As soon as I have spare time, I will work on Multicast and Broadcast
(in particular DHCP), I guess this will take a month or two.
Tested on Gentoo - 3.18.0 kernel (original kernel from ftp.kernel.org,
I do not use Gentoo kernels).
Tested with OpenBSD 5.6 VMs.

Let me know if you use this patch, as I will probably work to extend
it in the future.
Let me know as well if VirtualBox in the future will be able to
natively work with Wireless Cards
on Linux, since in this case I will stop working on this patch.

Thanks for your attention.

  Valerio Daelli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20150404/425f17bb/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PATCH-vboxnetflt
Type: application/octet-stream
Size: 9286 bytes
Desc: not available
Url : http://www.virtualbox.org/pipermail/vbox-dev/attachments/20150404/425f17bb/attachment.obj 

More information about the vbox-dev mailing list