2

I want to write my own virtual network card driver/plugin that can be configured for virtual machines within VirtualBox to intercept the incomming and outgoing packets.
I found the documentation of VirtualBox's SDK at http://download.virtualbox.org/virtualbox/SDKRef.pdf but unfortunately it only describes how to use the remote API to control a VM but not how to write custom drivers or plugins for the VM itself.

Do you know of any documentation or tutorials to this topic?
Any pointers are highly apreciated.

Update:
I've browsed in VirtualBox's sources and found the following: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
Is there no documented interface for writing such functionality in a pluggable way?

Marc-Christian Schulze
  • 3,154
  • 3
  • 35
  • 45

1 Answers1

0

The network handling in a VMM ("Virtual Machine Monitor" or "Hypervisor") is typically done by a simple interface that "pretends" to be a network card towards the VM and that is a bridge or switch type interface towards the host's network connection.

I suspect you will not be able to easily attach to that, and almost certain that there is no "SDK" interface to it - I haven't worked with VirtualBox, but I have worked on Xen Hypervisor (which is open source, but even then, there's no easy interface to intercept packets in a meaningful way).

Your best bet is probably to implement this on the host's side of the bridge or switch interface that the VMM provides. Most OS's have ways to hook into a network flow on the native side for firewall purposes.

(I'm still waiting for the SDK document to download - I think the server must be connected to the internet with a piece of wet string, as I've received 40KB since I started writing this post)

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227