Linux – how to access samba on a guest Linux behind the VirtualBox NAT

linuxnat;networkingvirtualboxwindows

On my laptop, I'm running Ubuntu 9.10 under WinXP using VirtualBox 3.1.2.
I want a setup where:

  1. The guest can freely access the internet.
  2. The host can access the guest files via Samba.
  3. The setup must work whether or not my ethernet/wifi ports are connected.

Is it possible?

#1 works with NAT and bridged networking.

#2 works with bridged and host-only networking.

Bridge-based setup doesn't work if relevant physical port is not connected. At the office, the laptop is connected to wifi or ethernet. At home, wifi only.

Is there a workaround? Am I missing anything?
I hope I'm making my question clear.

Best Answer

I would try setting up two separate network adapters.

  • Adapter #1 would be your current #1 setup: NAT to allow access to the internet available.
  • Adapter #2 would be a host-only setup to provide the connection between the host and the guest for the Samba shares.