Environment: VirtualBox 1.6.4 (latest as of 2008-08-14) running on Windows XP SP3. Guest is a Debian GNU/Linux.
The goal is to have the host Windows able to mount a Samba share provided by the guest as long as the Samba instance is running. To accomplish that, we are going to create a loopback adapter interface on the host, use VirtualBox's HIF on the guest, and bridge the two interfaces together.
Steps:
- Add a Microsoft Loopback Adapter device (through ControlPanel->Add Hardware).
- Create a VirtualBox's HIF and attach it to the VM.
- Go to Control Panel->Network Connections.
- Highlight the loopback device and the HIF, and right-click 'Create Bridge'.
- Go to the newly created bridge's property and set its IP address to, say, 192.168.2.1. The guest OS will be able to contact the host OS with this address.
- Start the guest OS.
- From within the guest OS, give a static address to the HIF, say, 192.168.2.2.
- From host OS, make sure you can ping 192.168.2.2
- From the guest OS, make sure you can ping 192.168.2.1
At this point, from the host Windows, you should be able to do this:
net use e: \\192.168.2.2\the_share_name "password_for_share" /user:username_for_share /persistent:no
Update 2008-08-14: You don't have to create a bridge. There's
a simpler method.