This tutorial describes how to share files stored on your OpenELEC computer with other machines on the network. Even if you're trying to share files from a USB drive, we can manage that since local drive mounting occurs before network services start.

First of all, you'll need access to your configuration files. There are two ways to do this and I'm going to cover the easier one. If you have experience with Linux, you can use ssh/putty to open a terminal to your OpenELEC machine (there are guides on how to do this elsewhere on the site); the configuration files are held in /storage/.config and you can use vi or nano to edit them.

However, for most users the easiest way is to browse to the Configfiles share that already exists on the OpenELEC machine.

From a Windows PC, open an explorer window and browse to the IP address or the network name of the OpenELEC machine.

Browser_address_bar_IPaddress.png or Browser_address_bar_networkname.png


Once the window appears, open the Configfiles share. This will show you all the configuration files for your OpenELEC machine.

To share files with other computers, OpenELEC uses a process called Samba. It's a process that runs on the computer and uses the CIFS protocol to share files across the network.

The file in the Configfiles share called samba.conf.sample is the one we're interested in. It controlls the shares presented by the Samba server daemon on the OpenELEC machine. Open the file with Wordpad (but not Notepad). The first section of the file is a disclaimer, followed by the Global section which is to do with the configuration of the Samba daemon running on the OpenELEC machine, we'll leave this alone as there's no need to change it.

# samba.conf
# This configuration file allows you to customize the samba shares
# available from your machine
server string = Media Centre(%i)
workgroup = WORKGROUP
netbios name = openelec
security = share
guest account = root
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
wins support = yes
syslog only = yes
name resolve order = lmhosts wins bcast host
# Using the following configurations as a template allows you to add
# writable shares of disks and paths under /storage

The next sections each define a share from the OpenELEC machine. There are a number of default shares, and they all follow the same format:

path = /storage/videos
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/videos

To quickly break this down:

To create a new share, we can use the same format. For example, if we wanted to share /media (where USB drives get mounted to), we could use:

[USB Drives]
path = /media
available = yes
browsable = yes
public = yes
writable = yes

I've removed the last line that creates the folder as we don't need it in most cases (where the folder already exists).

Now, save the file with your new share and close your editor. Rename the file from samba.conf.sample to samba.conf (remove the .sample extension) and close the explorer window. Restart your OpenELEC box and use explorer to browse to the IP address again - you should see your new share! You can open and edit the file at any time - you can remove shares too, but remember that if you remove the Configfiles share it will be much harder to reconfigure the shares.