Setup SAMBA on Ubuntu for XBMC shares

Like a lot of people I have a central computer which stores my pictures , videos etc, and have a home theater server with XBMC in the living room. To enable XBMC to display pictures and stream videos from your central computer you can use SAMBA. These instructions are for Ubuntu but apart from the actual SAMBA package install they should work for any Linux flavor.

Install SAMBA

On your server you want to share out the media from install SAMBA

sudo apt-get install samba

Create a nice easy directory structure

To make things easy for XBMC create a directory structure with symlinks to your media directories that can be shared out. e.g. within XMBC I want to have my media split into movies , videos, music_videos , music and pictures. The real directories for these on my central server are /videos/movies , /misc/vids, /misc/music_vids , /music , /camera . So I created a top level /xbmc directory with /xbmc/movies /xbmc/videos /xbmc/music_videos /xbmc/pictures

sudo mkdir /xbmc

sudo ln -s /videos/movies /xbmc/movies
sudo ln -s /misc/vids  /xbmc/videos
sudo ln -s /misc/music_vids /xbmc/music_videos
sudo ln -s /music  /xbmc/music
sudo ln -s /camera  /xbmc/pictures

Now when I share out /xbmc everything is nicely organized.

Configure SAMBA

sudo vi /etc/samba/smb.conf

Ensure your network interfaces are in the interfaces =   line and remove the ; at the beginning of the line.

Add these lines after the interfaces line , where the IP address after is the IP address of your XBMC box assuming it has a static IP, if you are using DHCP for the XBMC server then put in the DCHP subnet e.g.

hosts allow =,
hosts deny =

Remove the ; from the line bind interfaces only = yes

If using symlinks then add this line :-

unix extensions = no

Remove the hash at the beginning of the line security = user

Search for socket and add the line


At the end of the file add :-

comment = XBMC share
path = /xbmc
read only = yes
guest ok = no
user = xbmc
follow symlinks = yes
wide links = yes

Save the file

Create a linux user with enough permissions to be able to read your media files and a shell of  /bin/false – do not create a linux password for the user – we only want the user to login via SAMBA

sudo groupadd xbmc

sudo useradd -d /xbmc -c “XBMC SAMBA user” -g xbmc -s /bin/false xbmc

sudo smbpasswd -a xbmc

Restart SAMBA

sudo /etc/init.d/smbd restart

Add the share in XBMC

Video – Add Source

Path is  smb://        ( use the IP address of your SAMBA server )

OK – it will then ask for a username and password and if you select

2 thoughts on “Setup SAMBA on Ubuntu for XBMC shares”

  1. Thanks for the most useful article I’ve ever seen for xbmc and Samba. You solved a major headache in a short period of time! I am in your debt.

  2. Brilliant tutorial.

    As Steve Robinett above said, this is the most useful article on the internet for getting xbmc + Samba to work together!

    By the way, I particularly appreciated you explaining how to get the soft links setup in the config file.

Leave a Reply

Your email address will not be published.