69

Please note: I am two weeks old in Linux. I have found a lot of answers to this question on the internet, tried many, but all failed one way or another. Therefore I dare to ask once again in the hope that someone here could explain it simply :)

Pre-conditions:

In my institute, we have a Samba server. In Windows, it is accessed by going to \\xyz.220.131.233\ and entering the login abc and the password def.

In Ubuntu, I was able to do exactly the same using Nautilus, pressing Ctrl+L and entering smb://xyz.220.131.233/. It then asks for the login and the password and connects. I can even drag a folder from here to the 'Places' and have a shortcut to the remote location.

So far so good. I've just installed Matlab and want to open this remote location. Trying to cd to smb://xyz.220.131.233/ returns

Cannot CD to smb://xyz.220.131.233 (Name is nonexistent or not a directory).

A Mac user in my group told me I first mount the location, but he didn't know how to do it.

Is it true and how do I do it?

Braiam
  • 69,112
texnic
  • 1,263

9 Answers9

92

In most cases:

$XDG_RUNTIME_DIR/gvfs

14.04:

/run/user/$(id -u)/gvfs

12.10:

/run/user/<username>/gvfs

12.04:

Since 12.04 the folder of mounted samba share is:

~/.cache/gvfs

11.10 and older

You can learn how to mount - it will sure works. But I think this is an easier solution for you: Nautilus mount smb partitions at ~/.gvfs (where ~/ means /home/user_name/ - example: /home/desgua/.gvfs).
You just have to navigate to there:

cd ~/.gvfs
Pablo Bianchi
  • 17,371
desgua
  • 33,215
7

Another option here, while not directly related to having mounted the directory in nautilus is to mount the location from the command line.

However, to mount samba volumes, you have to have CIFS support.

sudo apt-get install cifs-utils

From here, you have the option of where you want to mount the location. There are TWO "standards" of sorts for this. If you want the location to show up in the Places menu, you would mount it in /media. If not, you would mount it in /mnt (only to follow the common namespace for mounted volumes. There’s nothing wrong with mounting the directory in /home/$user/mount/someshare)

Illustration of the mounted location in the Places menu

assuming that /media/myshare exist, you would achieve this by issuing the following command:

sudo mount -t cifs -o user=abc,password=def //xyz.220.131.233 /media/myshare

Side note

You can accomplish this automagically by appending the following string to your /etc/fstab configuration:

//xyz.220.131.233 /media/SambaMount cifs username=abc,password=def,rw,user,noauto 0 0

Notice the noauto flag, this will keep the volume from being mounted at boot, so when you're no longer at your workplace, it won't hang during boot trying to poll and mount that share.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
lazyPower
  • 5,451
4

in ubuntu 16.04 and vlc 2.2.2 ;

Select media > Open Directory and navigate to /run/user/1000/gvfs/ << ID number (1000) can be vary on your system.

Here you can see the shared folder name and select the folder whichever you want to add in playlist (see picture below)

vlc add dierctory

Videonauth
  • 33,815
xkeshav
  • 809
  • 1
  • 9
  • 23
2

On 12.10 you can find the location at

/run/user/USERNAME/gvfs/
2

On Ubuntu 12.04 I'm running:

~/.gvfs/[SHARENAME]

~/.cache/ only contains a folder gvfs-burn

BuZZ-dEE
  • 14,533
88weighed
  • 700
2

So, not sure if this is the real answer (please comment if in doubt or checked it yourself), but after some struggling together with another Linux colleague I've realised that I actually was not in the users group in my system (nano /etc/group). Upon adding myself to this group (sudo nano /etc/group, adding my name to the users line), I am now able to access the remote directories. My /etc/fstab file has these lines:

//xxx.220.131.233/user  /mnt/rua_user  cifs  username=abc,password=def 0 1
//xxx.220.131.233/all   /mnt/rua_all   cifs  username=abc,password=def 0 1

The rights on the folders look like this (ls -lh /mnt):

drwxrwx---  8 1016 users 0 2011-03-08 11:14 rua_all
drwxrwx--- 25 1016 users 0 2011-05-25 18:21 rua_user
texnic
  • 1,263
1

Follow this page. I followed it to get the same result as what you are looking for.

https://help.ubuntu.com/community/MountWindowsSharesPermanently

NateW
  • 510
1

in some of latest (e.g., 13.XX, 14.XX) ubuntu , you need to go to

/run/user/(USERID)/gvfs/

to find the mounted location. here (UID) is the UID of the account, which can be found by the command

id 
1
ln -s "/run/user/1000/gvfs/smb-share:server=192.168.1.1,share=Name_server/Path_Directory_source_in/Path_file.pdf" /Path_directory_source_out/Path_file.pdf

This is my example of how to make a file link from terminal in Ubuntu.

Use double quotes "" to escape special characters such as spaces

Zanna
  • 72,312
ugreg
  • 11