Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 7 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:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 eth1 :192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255. Any thoughts? –  user815423426 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 \\10.0.2.15\testh and \\192.168.56.101\testh from the host OS (Windows), but I receive no response. –  user815423426 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.