<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Klaus,<div><br></div><div>Thanks for the explanation.</div><div><br></div><div>I had already implemented networking for our emulator using Linux bridging.  But, in my testing, it seemed to stop working after a few minutes.  And my client was never able to configure his system successfully.</div><div><br></div><div>Nevertheless, I'm now recommending to my client that we try the bridging route again.</div><div><br></div><div>Thanks again for your advice,</div><div><br></div><div><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>  - Gary Palter</div><div>    Principal Software Engineer</div><div>    Clozure Associates</div><div>    Cell:  617-947-0536</div><div><br></div></div></div></span></div></span></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>


<br><div><div>On Aug 8, 2013, at 1:50 PM, Klaus Espenlaub <<a href="mailto:klaus.espenlaub@oracle.com">klaus.espenlaub@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Gary,<br><br>On 08.08.2013 18:30, Gary Palter wrote:<br><blockquote type="cite">On Jul 18, 2013, at 12:04 PM, Klaus Espenlaub <<a href="mailto:klaus.espenlaub@oracle.com">klaus.espenlaub@oracle.com</a>> wrote:<br><br><blockquote type="cite">Hi Gary,<br><br>On 18.07.2013 17:11, Gary Palter wrote:<br><blockquote type="cite">Well, I'm back.<br><br>My client has informed me that the alternatives suggested below aren't<br>acceptable.  They want to use the VirtualBox network drivers.  How can I<br>use those drivers without creating a VirtualBox VM?  Any pointers to<br>documentation or sample code that will show me what I need would be most<br>helpful.<br></blockquote><br>See src/VBox/Drivers/Network/Drv{UDPTunnel,VDE}.cpp - these are the<br>already existing samples.<br><br>There's no standalone SDK for this, so right now there's no pre-canned<br>way of building such drivers outside a VirtualBox build.<br><br>Klaus<br></blockquote><br>I don't think you understood my question.  Let me explain exactly what I need to do.<br><br>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.<br></blockquote><br>OK, I really misunderstood then. You want to reuse the host driver bits in a totally separate project.<br><br>This is actually very difficult, as both vboxnetflt and vboxnetadp are built on top of the vbox kernel "machinery", which means that they interface to the vbox virtual switch implementation in the kernel (in SrvIntNetR0.cpp) through generic communication mechanisms implemented in vboxdrv. Effectively you'd drag in a big portion of VirtualBox, pretty much all the complicated kernel bits.<br><br>Not sure if this is worth the effort for your project...<br><br>This ignores the fact that a hardened VirtualBox build (the default for releases) does not accept any unexpected clients to vboxdrv for security reasons.<br><br><blockquote type="cite">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.<br></blockquote><br>I wonder if using Linux bridging and tap interfaces wouldn't be the better solution for your project, as it'd cleanly separate it from VirtualBox. Both can easily coexist (of course internal networking will be out of reach for your project, but this is very special anyway).<br><br>Note that this suggestion causes quite some pain for me, remembering the hell we faced when VirtualBox used this approach, too. It never worked truly reliably, there was always a system/config out there which couldn't get proper network connectivity this way, sometimes intermittent or after a long time of perfect operation. Maybe we were just not capable enough, other people supposedly used this successfully in many places (it originates in the UML project, user mode linux), e.g. OpenVPN in ethernet bridging mode.<br><br>The beauty of this solution is that it doesn't require any non-standard kernel components.<br><br>Klaus<br><blockquote type="cite"><br>Can anyone offer suggestions?<br><br>Thanks again,<br><br>   - Gary<br><br><blockquote type="cite"><br><blockquote type="cite"><br>Thank you,<br><br>   - Gary Palter<br>     Principal Software Engineer<br>     Clozure Associates<br><br><br>On Dec 5, 2012, at 6:59 PM, Ivo Smits <<a href="mailto:Ivo@UFO-Net.nl">Ivo@UFO-Net.nl</a><br><<a href="mailto:Ivo@UFO-Net.nl">mailto:Ivo@UFO-Net.nl</a>>> wrote:<br><br><blockquote type="cite">Just a few ideas which are probably somewhat easier:<br>- Use libpcap to capture and inject network packets (useable directly<br>from userspace, you will need to handle packet filtering yourself but<br>it's easy)<br>- Use a tap device and a linux kernel network bridge (the tap device<br>will work like a real switch port, with some filtering provided by the<br>network bridge)<br>- Use VDE (should be easy to use, can connect to host network<br>interfaces, tap devices or act as a NAT gateway)<br><br>Ivo Smits<br><br>Op 5-12-2012 23:17, Gary Palter schreef:<br><blockquote type="cite">I am working on a project for a client which involves migrating a 20+<br>year old application to Linux.  (All I can say about the application<br>is that it's an emulator for an almost 30 year old computer<br>architecture.)<br><br>The guest's operating system is aware that it's running in a virtual<br>machine.  For network access, it communicates with the emulator<br>through a set of queues to send and receive Ethernet packets.  In the<br>original emulator, we attach a packet filter to the Ethernet<br>interface in order to inject packets onto the wire and grab packets<br>intended for the guest.<br><br>For the new emulator, we want to use the VirtualBox network drivers<br>to setup a bridged interface.  I've spent several hours reading<br>through the source code and, frankly, I'm lost.<br><br>How, exactly, does VirtualBox setup a bridged interface?  (I know<br>that VboxNetFlt driver is involved but I don't know how it's hooked<br>up.)  How is ARP handled?  How would I use the VirtualBox drivers in<br>our emulator, keeping in mind that there's no VBox guest involved?<br><br>Thank you for your assistance,<br><br>- Gary Palter<br>   Principal Software Engineer<br>   Clozure Associates<br></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></div><br></div></body></html>