Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have recently set up a virtual machine and I want to share files between the host and the guest. Samba seems to be a perfect solution, and indeed it does all that I expect it to. However, if the host machine is not connected to the internet, the Samba server appears offline too. Can somebody show me how to make it work?

Note: ps -ef | grep smb shows that smbd -F is running, so I think the process is started properly.

EDIT: I'm using VirtualBox for the virtualization. Below is my config in /etc/samba/smb.conf (I have never changed it, comments removed for simplicity). Sharing is enabled through the GUI in nautilus.

[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
share|improve this question
    
What virtualization software are you using? –  Michael Mrozek Sep 22 '10 at 18:52
    
What network setting are you using in VirtualBox? NAT, Bridged, ... –  Gert Sep 23 '10 at 11:10
    
Why do you want to use samba instead of using the default file sharing utility in virtualbox? –  Falmarri Sep 23 '10 at 19:58
    
the sharing utility in virtualbox is rather slow, compared to samba (when it works) –  phunehehe Sep 24 '10 at 1:35
add comment

1 Answer

up vote 2 down vote accepted

Have you checked if changing the type of the VirtualBox network adapter makes a difference? Shut down the virtual machine, got to Settings->Network and try to change the value of "Attached to". The default is NAT, which should be fine, however if you have NAT and it doesn't work for you, you might try bridged. If you already have bridged there, try NAT.

Before doing this, you should read the information found in VirtualBox Help, Chapter 6.2. Introduction to networking modes.

share|improve this answer
1  
I don't really understand why, but setting network to "Bridged adapter, virbr0" makes the samba server available again. Thanks! –  phunehehe Sep 24 '10 at 1:42
add comment

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.