On Fri, Feb 08, 2013 at 02:45:54PM -0500, Laine Stump wrote:
> Unfortunately, something as hit and miss as this can't be put into
> libvirt. If someone comes up with a relatively non-intrusive 100%
> reliable on all platforms way to give guests "L2 bridged" access to the
> physical network, I would seriously love to make a new libvirt network
> type that supports it.
Any idea how VirtualBox achieves that? Is it doing some magic in one of
its kernel modules? According to
https://mail.gnome.org/archives/gnome-boxes-list/2013-February/msg00006.html
it's working pretty well.
Bridging to a wireless interface is done differently from bridging to a wired interface, because most wireless adapters do not support promiscuous mode. All traffic has to use the MAC address of the host's wireless adapter, and therefore VirtualBox needs to replace the source MAC address in the Ethernet header of an outgoing packet to make sure the reply will be sent to the host interface. When VirtualBox sees an incoming packet with a destination IP address that belongs to one of the virtual machine adapters it replaces the destination MAC address in the Ethernet header with the VM adapter's MAC address and passes it on. VirtualBox examines ARP and DHCP packets in order to learn the IP addresses of virtual machines.