Although this guide tells you how to mount SMB file systems over the network in Xubuntu, it will also work for Ubuntu and similar Debian based Linux distributions.
Fellow users of Xubuntu may have noticed that the file manager doesn’t support viewing samba shares in the same way that Ubuntu’s file manager does. This functionality used to exist, however they changed the filemanager used around 8.10. In order to view samba shares, you must therefore mount them on your system.
Mounting Samba Shares
1. Create a folder to mount your Samba share
sudo mkdir /media/music
sudo runs the command as root, mkdir tells the system to make a directory and the rest is the path you specify, I usually mount things in the /media/ directory but you can just as easily mount them in your /home/username directory.
2. Editing the fstab so it loads on boot
This file contains information on your disk partitions and you shouldn’t change anything that already exists!
sudo nano /etc/fstab
In the fstab file you will need to enter a line similar to the following:
\SAMBASERVERShareName /media/music smbfs user=username,passwd=password 0 0
The left part indicates the server the share is hosted on, followed by where it should be mounted to in your file system, you then need to tell it that it’s a samba filesystem. If you have a username or password to view the share, enter it – if not use the line below. One word of warning – usernames and passwords stored in the file are in cleartext, it’s highly advisable that on your samba server you create a new user with limited privellages to restrict access.
\SAMBASERVERShareName /media/muisic smbfs 0 0
save the file.
3. Run the mount command
sudo mount /media/music
this will lookup what should be mounted in the fstab file, it should then allow you to view the contents of the folder in /media/music in the Xubuntu filesystem as if it were on your local machine.
4. It didn’t work! (wrong mount type, bad option, bad superblock on…)
this means you need to run the additional command:
sudo apt-get install smbfs
This will install the samba filesystem package on your system, simply re-run the mount command when you’ve got this package and all should work!
5. It still didn’t work!
If you’re getting the error:
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
This means that your share cannot be located or cannot be logged into with the current credentials.
Try using the samba client list command:
smbclient -L ServerName
This will give you an output indicating what shares are available to connect to on the defined server. if your share isn’t found, then you’ll need to reconfigure the /etc/samba/smb.conf file on the server to enable the share you’re looking for, or use a different share name in your clients /etc/fstab file.
If your share is in that list then you need to make sure that samba references the correct directory (ie login to the server and do an ls of the directory that you’re trying to connect to to see if it exists).