Install & configure Samba Server on Ubuntu VM

1. Install Samba

The first thing we need to do is to update the package repositories and then install Samba.

sudo apt-get update
sudo apt-get install samba

2. Configure Samba

Now we'll have to add a few lines to the Samba configuration file /etc/samba/smb.conf to make everything work.

# The following property ensures that the existing files do not have their
# permissions reset to the "create mask" (defined below) if they are changed
map archive = no

# Notify upon file changes so that Windows can detect such changes
change notify = yes

# Configure shared folder for your user where "developer" is your Linux username
comment = Developer Files
path = /home/shared
guest ok = no
browseable = yes
writable = yes
create mask = 0664
directory mask = 0775

Save and close the config file and then add a Samba user and password identical to your Linux user account.

sudo smbpasswd -a developer

Restart Samba so that the config can be re-read.

sudo service smbd restart

Your Windows host should now have access to the shared folder. To access the shared folder, open a folder browser and type in:

\\*ubuntu-local-ip-address*\developer (e.g. \\\developer)

To find out what your local IP address is, got to your Ubuntu server terminal and type: