From owner-freebsd-emulation@FreeBSD.ORG Tue Aug 25 16:39:00 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078D2106568E for ; Tue, 25 Aug 2009 16:39:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D5A5B8FC21 for ; Tue, 25 Aug 2009 16:38:59 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 75BFC46B29; Tue, 25 Aug 2009 12:38:59 -0400 (EDT) Date: Tue, 25 Aug 2009 17:38:59 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Fredrik Lindberg In-Reply-To: <4A8EB3D2.7010109@shapeshifter.se> Message-ID: References: <4A8EB3D2.7010109@shapeshifter.se> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@freebsd.org Subject: Re: VirtualBox bridged adapter (vboxnetflt) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 16:39:00 -0000 On Fri, 21 Aug 2009, Fredrik Lindberg wrote: > 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). Hi Fredrik: The technical approach you've taken here is a bit unusual and potentially quite fragile -- replacing the method pointers on struct ifnet's maintained by other drivers and "borrowing" spare fields is likely going to prove problematic in the future (and, in fact, already). It looks like a lot of what the driver is trying to accomplish can already be done entirely from userspace using bpf(4): taking a tee of incoming frames arriving at the NIC, perhaps selecting down to ones to specific ethernet addresses, taking the card into and out of promiscuous mode, and injecting frames into the output path, are exactly what BPF is designed to support. I was wondering if you'd looked at this approach as an alternative to a custom kernel driver? Robert > > 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 > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" >