Samba Sharing in XBMCbuntu

Samba is not included with XBMCbuntu (at least in 11.10), so first we have to install it:
sudo apt-get install samba
Open Samba’s configuration file in an editor
sudo nano /etc/samba/smb.conf
Scroll down to the bottom of the file and add the following sections, which will create a public share with read/write access without password validation:

[global]
workgroup = Workgroup
netbios name = XBMC
server string = XBMC Server
log file = /var/log/samba/log.%m
max log size = 50
map to guest = bad user
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
dns proxy = no


[public]
path = /media
public = yes
only guest = yes
writable = yes
force user = xbmc

The above configuration example shares everything under the /media directory in a folder called “public”. The “force user” property must be set to a user with write access to the directory being shared. All files and directories will appear to have been created by this user.
Run “testparm” to check if your Samba configuration is parseable. For configuration changes to take effect, the Samba daemon can be restarted with
sudo /etc/init.d/smbd restart
The following screenshot shows my XBMC box sharing the /media directory which contains mount points for two harddrives (ingeniously named according to their capacities…):