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.

I'm running VirtualBox on a Windows 7 Host, with an Ubuntu Linux guest OS.

I'm trying to set up Samba on Linux to access a folder (/home/user) from the Windows host as a share - which I believe SHOULD be possible, but having trouble getting it to work. I am aware of the Share Folder option of VirtualBox but I specifically need to get this done using Samba.

I installed Samba (apt-get install samba sambafs) and set up /etc/smbd.conf with a share

[usershare]
path = /home/user
read only = no
browseable = yes

Not worried about securing it by user just yet - want to get it working first.

I set up two network adapters in VirtualBox - one NAT so I can get to the Internet for apt-get and stuff, one Host-Only hoping that will let me access the Ubuntu guest from the host only. (Hence the lack of immediate concern over user-level security.)

Now, I can see an IP for the Host-only network in Windows, and tried to access it in the Windows Explorer - a blank window comes up and I don't see anything. The IP looks like 169.254.127.xxx. If I put in \\169.254.127.xxx\usershare it hangs for a while and fails.

How do I troubleshoot this?

Is this likely a networking config problem or a Samba problem?

share|improve this question
    
I have kind of an odd use case. I have a specific reason why I want to access the guest OS as a share in Windows. If I just wanted to copy files back and forth, you're right, VirtualBox shared folder is WAY easier. –  wrschneider99 Mar 8 '13 at 19:00

1 Answer 1

up vote 0 down vote accepted

OK, I think I figured it out.

There were a few gaps in my understanding:

Samba setup

  • I realized that Samba users require their own authentication are not necessarily the same as UNIX usernames/passwords. So I created account with smbpasswd.
  • I then confirmed that Samba setup was correct by mounting locally within the VM using smbmount, e.g., smbmount //localhost/share /mnt/test -o user=testuser,pass=password

Virtualbox setup

  • I ended up wtih two NIC's on my VM - eth0 is default NAT adapter, then new eth1 is host-only
  • In the VM, I gave eth1 a static IP address on the same subnet as the host-only network in VirtualBox File>Preferences>Network menu. The key I was missing is that the VM needs a DIFFERENT IP address than the host-only adapter on the host side. So the host-only adapter in VirtualBox is on 192.168.100.1, the static IP for Ubuntu guest is 192.168.100.2 (for example).
  • Finally, once this was set up, I could see the Samba share under \\192.168.100.2\share\
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.