Updated to include Mint Debian Changes
Prerequisites
This HowTo assumes you can connect to a remote share from Nautilus. If you cannot, this HowTo will not help you. If you have problems connecting to a remote share manually I suggest you post a separate topic asking for help.
Linux Mint Debian Edition Prerequisites
You need to install one package:
Code: Select all
sudo apt-get install gvfs-fuse
Code: Select all
sudo gpasswd -a your_user_name fuse
GVFS
When you use Nautilus to access a samba share manually you may not know that Nautilus actually creates a mount point. The problem is it's in a hidden directory. You have to enable Nautilus to "see" that directory by going to:
Nautilus > Edit > Preferences > View > Show hidden and backup files.
The mount point is at :
/home/your_user_name/.gvfs ( note the "." in front of the gvfs - that indicates a hidden directory )
Procedure
Step 1: Connect to the Server from Nautilus
Nautilus > Network > Workgroup > Machine > Share
If the server requires authentication then enter it and click on the "remember forever" option before entering "Connect"
Once you have successfully connected go back and unmount the remote share.
Step 2: Connect from the terminal
Open Terminal
Type gvfs-mount smb://Server/share_name
Substitute the actual "Server" and "Share_name" for the ones above
The "Server" in that command can take many forms, for example:
gvfs-mount smb://WinXP/share_name
gvfs-mount smb://WinXP.local/share_name
gvfs-mount smb://192.168.0.100/share_name
The last one is by ip address of the server which is the most reliable method.
Make sure this remounts the remote share to /home/user_name/.gvfs without prompting for authentication.
Step 3: Create a script that will automate this process and place it in the Autostart folder:
Open Terminal
Type gedit
Enter the following:
Code: Select all
#!/bin/sh
gvfs-mount smb://Server/share_name
Save the file as, for example: /home/user_name/share_name_mount.sh
Exit gedit
Back in the terminal make the script executable by issuing the command:
chmod +x /home/user_name/share_name_mount.sh
Go to Menu > Preferences > Startup Applications > Add > point it to /home/user_name/share_name_mount.sh.
Logoff and logon again and you should have your share mounted to /home/user_name/.gvfs/ automatically ( assuming the server is running ) and you should have a mount icon on your desktop.
Issues
[]Your Specific Application Cannot Access The Hidden Mount Point
One way around this is to create a symlink to the .gvfs folder. For example:
Open Terminal
Type mkdir /home/your_user_name/LanShare
Type ln -s /home/your_user_name/.gvfs/"share_name on host_name" /home/your_user_name/LanShare
Another way to do this is to create a bookmark to the .gvfs folder so that is shows up in the Open and Save boxes:
Run the following command:
Code: Select all
nautilus $HOME/.gvfs
*** Right click the resulting ".gvfs" bookmark > Rename and rename to LanShares for example. It should then be visible in your application as LanShares.
[]Multiple Samba Shares.
If you have many shares you want to automount you may be tempted to create one script with many gvfs-mount lines in them.
I would advise against that. I have found that if one of them fails, all subsequent lines will not be executed. What I do is simply create a separate script for each share I want to mount.
[]Karmic Bug
There is a bug in Karmic ( basis for Mint8 ) dealing with accessing a remote share with a saved password https://bugs.launchpad.net/ubuntu/+sour ... bug/463267. You will get an error message that looks like this:
Doesn't happen to everyone but unfortunately the fix is to remove the saved password for the share. Guest shares will work it's just that auto mounting of authenticated shares may not. To remove the saved password:Unable to mount location
DBus error org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
Menu > Accessories > Passwords and Encryption Keys > Passwords Tab
Expand the "Passwords: login" entry and you should see the the entry for the remote share.
Notes
The traditional method of doing this requires adding entries into fstab. Although it requires more effort, the traditional method has the advantage of being universal in that it can be used the same way on all systems. This way requires Gnome ( or at least gvfs ). This is not a better way - it's just another way. I found this method on the Ubuntu forums (http://ubuntuforums.org/showthread.php?t=1186877). Credit belongs to the original author. I've tried to improve the flow a bit and point out a few quirks I've discovered through use.