Steam for Linux Guide

[SteamOS] Adding Samba Shares for Music Libraries for Steam for Linux

[SteamOS] Adding Samba Shares for Music Libraries

Overview

Frustrated that you can only add local directories to Steam’s Music Library component? Fear no more.

Overview

This guide details how to add your Windows/Samba network share to SteamOS so that you can add your own music library on another computer, or at the very least gain access to your files on a permanent basic without mounting the share every time you start your computer.

Preparing your system

Please note:

This guide assumes you already have a Windows or Samba share setup already on another machine. This guide details adding this to SteamOS, not creating the samba share itself. I have provided a snipped of one of my larger Samba shares below for reference. This does not mean I am an expert on proper setups, so feel free to suggest alterations to how I normally setup my shares.

An example samba share from /etc/samba/smb.conf:

[server_media_x]
comment = server media x drive
path = /mnt/server_media_x
read only = no
writeable = yes
browseable = yes
valid users = mikeyd, desktop
create mask = 0644
directory mask = 0755
inherit acls = yes
; if you set this, all files get written as this user
#force user = one

Desktop Mode and sudo access

You will want to have enabled access to the desktop mode of SteamOS in the settings area of the Steam client, if you not have already done so. Once this is done, you will need to set the password for the desktop user as well. Once in desktop mode, click the activities word in the top left of the screen. Type the word “terminal” to get to a terminal window.

passwd

You can enter the default password of “dekstop” or create your own. This will allow you to make use of sudo / superuser access.

Adding the Debian repository to SteamOS

In this section, we’ll be adding the necessary changes to SteamOS to allow installation of Debian Packages.

Open up a terminal window session by click activities in desktop mode, and typing “terminal”. You will need to first make sure (if you haven’t already) add the password for the desktop user so you can use sudo access.

passwd

Adding the proper sources

Enter ‘desktop’ as the password, or whatever your choice. Now, on to the good stuff.

sudo nano /etc/apt/sources.list.d/wheezy.list

Paste the following into that file (change this to a mirror that suits you)

deb [link] wheezy main contrib non-free
deb-src [link] wheezy main contrib non-free
Save with ctrl+o and quit with ctrl+x

Adjusting aptitude preferences

sudo nano /etc/apt/preferences

Paste the following into that file (if you hand type this, yes that is a lower case “L”)

Package: *
Pin: release l=SteamOS
Pin-Priority: 900

Package: *
Pin: release l=Debian
Pin-Priority:-10

Save with ctrl+o and quit with ctrl+x

Update the system

Now, we need to update the system’s listing of available software:

sudo apt-get update

Pre-requisite Software

In order to add the samba shares to your SteamOS installation, you will need a package called “cifs-utils”. This package will pull in all necessary packages we need to add the shares.

In a terminal window, enter:

sudo apt-get install cifs-utils

Using the “-t wheezy” option is very important. We need to specify that the package should come from the official Debian repository, [not[/b] the SteamOS Alchemist repository. We do not want to mix and match Debian and SteamOS repositories.

Adding your Windows / Samba Share

The next part can be tricky, but bear with me. This guide assumes you want to connect securely to the samba share, not with a public, read only share.

Samba credentials

First, you will want add the user credentials to a secure file:

nano ~/.smbcredentials

Now, add the follow contents, replacing the default text with your own details:

username=my_username
password=my_password
domain=workgroup

Create a location for your share’s files

Sure, you could use an existing folder, but it’s a little cleaner to create a specific folder for your share’s contents to be displayed. Open up a terminal window and enter a similar statement to this:

sudo mkdir -p /mnt/sever_media_x

Adding your remote user to SteamOS

Optionally, you may need to add your remote user to SteamOS, so the correct information can be passed to the remote system. This is very simple:

sudo /usr/sbin/adduser mikeyd
sudo smbpasswd -a mikeyd

Enter the password of the remote system user.

Adding the required information to /etc/fstab

The file “/etc/fstab” holds information that your system utilizes for permanent mounting of local hard drivers, USB drivers, and all sorts of devices when your system starts up. We will be adding my network share in this example, but I will explain after what each piece means. I have removed the system devices and shares to minimize the output here.

# /etc/fstab: static file system information.
#
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
#
#server media x
//archboxmtd/server_media_x /mnt/server_media_x cifs credentials=/home/desktop/.smbcredentials,uid=mikeyd,gid=users 0 0

What it all means

  • file system: This is the path to the server and share on your remote system
  • mount point: This is where you want the share to be located when it connects.
  • type: This is the type of share, where we tell the system to use cifs to connect to the samba share
  • options: In the options, we specify the uid and gid (user and group ID) of the remote system. This is optional, but useful for systems that don’t follow conventional user and group conventions.
  • dump: (1= backup, 0=don’t backup). The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
  • pass: “The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.”

Connecting the share

To connect the share to SteamOS without rebooting (which is good as a test), issue the following command:

sudo mount -a

This command will mount all available shares and devices in /etc/fstab. Any device or share already connected will not be connected a second time.

Conclusion

There may be missing details or sections in this guide. Please comment or contact me with any issues or corrections. Once you have your share added to SteamOS, you should be able to add the share or folders within it to your music library.

SteamSolo.com