Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 9 down vote accepted

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.
share|improve this answer
Thanks, this works great. I have no idea why I missed it when playing with the different setups... – noamtm Feb 4 '10 at 15:37
and @noamtm, I'm trying to make this solution work with no luck. My smb.conf is: [global] interfaces = eth1 security = user [testsh] path = /home/my_user_name guest ok = yes browseable = yes read only = no And my interfaces are: eth0: inet addr: Bcast: Mask: eth1 : Bcast: Mask:255.255.255. Any thoughts? – Amelio Vazquez-Reina Mar 17 '11 at 15:41
I forgot to mention that I configured eth1 as host-only, and eth0 as NAT. I tried accessing and mounting \\\testh and \\\testh from the host OS (Windows), but I receive no response. – Amelio Vazquez-Reina Mar 17 '11 at 15:47

Another possibility is to create two bridged virtual NICs, one to the physical wireless interface and one to the physical wired interface. As long as one (or both) of the physical interfaces is connected you should have access. I generally try to avoid NATing as much as possible, since it tends to create a lot of headaches in the long run (as you have seen with file sharing).

share|improve this answer
Does bridged mode work with wireless devices? I remember there's some trouble with it because Wireless devices ignore packets that aren't intended for it (something like that). – Avindra Goolcharan Oct 16 '14 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .