Configuring OpenELEC Samba share allows you to remotely access your Raspberry Pi's SD card and any attached USB drives over the network on other computers. This can come in handy if you want to transfer files between the devices over the network and without having to physically connect the drives. This can also be of help if you want to edit configuration files or XBMC files using a GUI text editor instead of over SSH and commandline. Almost all current media center distros, such as OpenELEC, Xbian, and Raspbmc, for Raspberry Pi come with SAMBA pre-installed. In this post, I will show you how to enable and configure OpenELEC Samba share on Raspberry Pi. While the enabling part can vary based on the distro, the SAMBA configuration part very similar in the 3 distros.
Enable OpenELEC SAMBA Share
There are two ways to enable OpenELEC SAMBA share. First way is to enable it during the OpenELEC first boot when you go through the initial setup wizard. Check the enable box in the wizard screen, as shown in the picture below, to enable SAMBA.
If you did not enable SAMBA on OpenELEC for Raspberry Pi during the initial setup, don't worry. Just visit the OpenELEC settings and you will find the option to enable OpenELEC SAMBA server under services, as shown in the picture below.
If you would like to securely access your SAMBA shares on Raspberry Pi, you may enable password authentication for SAMBA in the above screen. The default username and password are both "openelec" (case-sensitive), which you may change to anything of your choice. In this example, I am just going to leave password protection off as I do not have anything sensitive on my Raspberry Pi. I generally do a quick reboot after enabling any service just to be sure. Hey! OpenELEC boots in less than 30 seconds anyways.
|Build a Low-Cost Raspberry Pi Media Center||Price|
|Raspberry Pi 4B Starter Kit with case, power adapter, and heat sinks||~$82.00|
|Sandisk Ultra 32GB Micro SDHC UHS-I Card 98 MB/s||~$8.00|
|SANOXY Wireless USB PC Remote Control Mouse for PC||~$8.00|
Configure SAMBA Server on Raspberry Pi
While you can pop in your OpenELEC SD card into another Linux machine and create a Samba configuration file, I recommend accessing OpenELEC Raspberry Pi using SSH. After you have logged into your Raspberry Pi through SSH, issue the commands numbered 1 through 5 in the picture below.
- "ls -al" command lists all the files and folders, including hidden ones.
- Next cd into ".config" folder.
- There should be a "samba.conf.sample" file present in this folder that you could use as a template. But we are going to create one from scratch without all the extra lines of comments and explanations.
- Use the "touch samba.conf" command to create a new file called "samba.conf".
- Now if you issue the "ls" command you should see "samba.conf" listed.
- Next open the "samba.conf" for editing using "nano samba.conf" command. You could use vi editor instead if you prefer.
Copy and paste the following contents to the "samba.conf" file in the SSH window.
[global] server string = OpenELEC workgroup = WORKGROUP netbios name = %h security = share guest account = root socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 smb ports = 445 max protocol = SMB2 min receivefile size = 16384 deadtime = 30 os level = 20 mangled names = no syslog only = yes syslog = 2 name resolve order = lmhosts wins bcast host preferred master = yes domain master = yes local master = yes printcap name = /dev/null load printers = no browseable = yes writeable = yes printable = no encrypt passwords = true enable core files = no passdb backend = smbpasswd smb encrypt = disabled use sendfile = yes [storage] path = /storage available = yes browsable = yes public = yes writable = yes
The global settings apply to all new shares. Any settings defined for each share (for example: [storage]), override the global settings. The only parameters you may want to change are:
- workgroup: If you want a workgroup name other than the default (WORKGROUP).
- [storage]: I am calling this share "storage" since I am sharing the "/storage" folder. You can call it whatever you want. Just remember that it is case-sensitive.
- path: The "samba.conf.sample" file provided by OpenELEC has several shares. For a Raspberry Pi admin, this may be too many shares to manage. I have simplified it sharing the "/storage" folder which contains all the necessary subfolders you may want to access for administration.
If you are editing using nano editor, press Ctrl X and then W to save and exit. Reboot your Raspberry Pi by issuing "reboot" command in the SSH window. Your OpenELEC Samba Share should be up and running after the reboot.
Best Android TV Boxes:
Access Raspberry Pi SAMBA Shares
- Raspberry Pi's IP Address
- SAMBA Share name
- Username (if set)
- Password (if set)
On Ubuntu and other Linux systems you may follow what is described in this post. On Windows you can mount OpenELEC Samba share as network drive as shown in the picture below.
Provide the folder in the format "\\ipaddress\sharename". If you enabled password authentication for Samba, then check "Connect using different credentials" and type in the username and password. That is it. Enjoy remotely accessing folder and drives on your Raspberry Pi by enabling OpenELEC Samba share.