I wanted to set up a Windows XP Guest, and have it share its files TO the host, using Windows networking (a.k.a. SMB, a.k.a. CIFS), via the VirtualBox NAT interface. (I'm using Portable-Virtualbox, and it supports ONLY the NAT adapter.) This IS possible. I've done it. Here's how.
- In the guest, assign its adapter the permanent address of 10.0.2.15.
- Give it a net mask of 255.255.255.0. (Otherwise, if you use 10.0.0.1 for your host loopback, you've got a problem.)
- You can use another address, but you'll have to consistently substitute your other address EVERYWHERE I use this one.
- Create a Loopback adapter in the host. (See http://www.kleinfelter.com/loopback-adapter-xp for de..tails.)
- Configure the Loopback adapter
- Enable Client for Microsoft Networks.
- Disable File and Printer Sharing for Microsoft Networks.
- Enable Interent Protocol (TCP/IP)
- Click on properties for TCP/IP
- Assign the address 10.0.0.1.
- You can use another address, such as 192.168.2.2, but you'll have to consistently substitute your other address EVERYWHERE I use this one.
- From Advanced->WINS:
- Enable LMHosts Lookup
- Disable NetBIOS over TCP/IP
- Enter 9999 for the interface metric.
- Start VirtualBox and define the following port-forwarding rules for the NAT adapter
- 10.0.0.1, TCP port 135 to 10.0.2.15, same port
- 10.0.0.1, UDP port 135 to 10.0.2.15, same port
- 10.0.0.1, TCP port 136 to 10.0.2.15, same port
- 10.0.0.1, UDP port 136 to 10.0.2.15, same port
- 10.0.0.1, TCP port 137 to 10.0.2.15, same port
- 10.0.0.1, UDP port 137 to 10.0.2.15, same port
- 10.0.0.1, TCP port 138 to 10.0.2.15, same port
- 10.0.0.1, UDP port 138 to 10.0.2.15, same port
- 10.0.0.1, TCP port 139 to 10.0.2.15, same port
- 10.0.0.1, UDP port 139 to 10.0.2.15, same port
- 10.0.0.1, TCP port 445 to 10.0.2.15, same port
- 10.0.0.1, UDP port 445 to 10.0.2.15, same port
- Exit VirtualBox
- Reboot the host
- Start VirtualBox, and start your guest.
- Inside the guest, share your C-drive as "C".
- In the host, Start->Run, and enter \\10.0.0.1\C
Note: You can dispense with setting up the Loopback adapter, but it is awkward. Here’s how:
- Don't create a loopback adapter. (Or you can ignore the one you set up.)
- Set up the VirtualBox port forwarding as above, using "127.0.0.9" instead of "10.0.0.1"
- Instead of Start->Run with \\10.0.0.1, you'll use \\127.0.0.9, but BEFORE YOU DO SO
- From a Command prompt, enter "net stop server"
You have to do this in order to disconnect the host’s SMB/CIFS (file server) protocol from 127.0.0.. When you used a virtual Loopback adapter (which you assigned to 10.0.0.1), you disconnected the file server protocol from the adapter when you followed the “Disable File and Printer Sharing for Microsoft Networks” instruction above. Since the 127... address range doesn’t show up in Network Connections as an adapter, you have to stop (or uninstall) the file sharing service.
Conveniently, once you’ve connected to the guest via 127.0.0.9, you can enter “net start server” and re-start file sharing on the host, without losing your connection to the guest.
Note: If you are using McAfee Host Intrusion Preventionon your host machine, here’s some extra steps to do before you Start->Run and \whatever:
- Right-click on the "M" in a shield in the Windows "notification" area.
- Select "Manage Features"
- Select "McAfee Host Intrusion Prevention"
- Select "Disable Firewall"
After you’ve connected to the guest, follow the instructions for disabling the firewall, but in the last step select “Restore Settings” instead of “Disable Firewall”