[vbox-dev] Using VirtualBox network drivers

Gary Palter palter at clozure.com
Thu Aug 8 09:30:04 PDT 2013

On Jul 18, 2013, at 12:04 PM, Klaus Espenlaub <klaus.espenlaub at oracle.com> wrote:

> Hi Gary,
> On 18.07.2013 17:11, Gary Palter wrote:
>> Well, I'm back.
>> My client has informed me that the alternatives suggested below aren't
>> acceptable.  They want to use the VirtualBox network drivers.  How can I
>> use those drivers without creating a VirtualBox VM?  Any pointers to
>> documentation or sample code that will show me what I need would be most
>> helpful.
> See src/VBox/Drivers/Network/Drv{UDPTunnel,VDE}.cpp - these are the 
> already existing samples.
> There's no standalone SDK for this, so right now there's no pre-canned 
> way of building such drivers outside a VirtualBox build.
> Klaus

I don't think you understood my question.  Let me explain exactly what I need to do.

The software that runs in the emulator I'm writing needs access to the network.  The operating system that runs on the emulator is very old and requires static IP addresses.  (It has no DHCP client.)  If I were creating a VirtualBox VM, I would add a bridged network with a static IP to that VM.  But, this is an emulator for an entirely different architecture; I can't use a VirtualBox VM.

What I want to do is use the existing VirtualBox network drivers (vboxnetflt, I think) in my emulator.  I want to open that driver, configure it (i.e., tell it what host interface to use, MAC address, IP address, etc), and the transmit and receive packets using the driver.

Can anyone offer suggestions?

Thanks again,

  - Gary

>> Thank you,
>>   - Gary Palter
>>     Principal Software Engineer
>>     Clozure Associates
>> On Dec 5, 2012, at 6:59 PM, Ivo Smits <Ivo at UFO-Net.nl
>> <mailto:Ivo at UFO-Net.nl>> wrote:
>>> Just a few ideas which are probably somewhat easier:
>>> - Use libpcap to capture and inject network packets (useable directly
>>> from userspace, you will need to handle packet filtering yourself but
>>> it's easy)
>>> - Use a tap device and a linux kernel network bridge (the tap device
>>> will work like a real switch port, with some filtering provided by the
>>> network bridge)
>>> - Use VDE (should be easy to use, can connect to host network
>>> interfaces, tap devices or act as a NAT gateway)
>>> Ivo Smits
>>> Op 5-12-2012 23:17, Gary Palter schreef:
>>>> I am working on a project for a client which involves migrating a 20+
>>>> year old application to Linux.  (All I can say about the application
>>>> is that it's an emulator for an almost 30 year old computer
>>>> architecture.)
>>>> The guest's operating system is aware that it's running in a virtual
>>>> machine.  For network access, it communicates with the emulator
>>>> through a set of queues to send and receive Ethernet packets.  In the
>>>> original emulator, we attach a packet filter to the Ethernet
>>>> interface in order to inject packets onto the wire and grab packets
>>>> intended for the guest.
>>>> For the new emulator, we want to use the VirtualBox network drivers
>>>> to setup a bridged interface.  I've spent several hours reading
>>>> through the source code and, frankly, I'm lost.
>>>> How, exactly, does VirtualBox setup a bridged interface?  (I know
>>>> that VboxNetFlt driver is involved but I don't know how it's hooked
>>>> up.)  How is ARP handled?  How would I use the VirtualBox drivers in
>>>> our emulator, keeping in mind that there's no VBox guest involved?
>>>> Thank you for your assistance,
>>>> - Gary Palter
>>>>   Principal Software Engineer
>>>>   Clozure Associates
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

More information about the vbox-dev mailing list