I have some music files I'd like to listen to sitting on a Samba share. I added this share via the Ubuntu GUI (Places -> Connect to server...), and everything worked just fine.
However, despite the fact that my music file is playing from this location, after I've not touched the location using the Nautilus GUI, Ubuntu/GNOME decides that I'm not using the share anymore and terminates the connection. Thus, my music stops playing and Rhythmbox is unhappy with me. Simply clicking on the new shortcut the "Connect to server..." bit created for me immediately makes the files come back again and allows me to restart the music playing.
How can I have Ubuntu not automatically dismount samba shares?
This is the method I have used successfully from 9.10 through 10.10 by mounting the shares with fstab following these steps.
Make sure you have smbfs installed first.
Create new directory(s) to mount the share to in terminal eg
sudo mkdir /media/my_share
Open fstab in gedit
gksudo gedit /etc/fstab
also in terminalAdd one line per share example music, films, tv etc
obviously changing the IP address,
share_name
andmy_share
to the relevant foldersLastly create a hidden
.smbcredentials
file in root and open it in geditand add these lines to the new file
if you have no password for the shares then leave them blank and if you have many different share passwords then create multiple credentials files.
you will then need to change the owner of the credentials file
once all of this is in place you can test your setup by typing
sudo mount -a
in the terminal and your shares will be mounted.from now on they will automatically mount when you log in.
This is a problem with GVFS. See this post for a workaround. Hopefully someone adds a better way to do this. As an alternative you could use the standard mount-command, which does not have these limitations.
If you have a server, it may be worth moving it over to a fixed IP... If it's Ubuntu Server look here: How To Geek (Ignore the line
sudo apt-get remove dhcp-client
as there's no need for it)Im pretty sure samba times itself out after a time and unmounts. Its a security feature I think (even if you are connecting to a share without a password).