13

There are many ways to mount an SMB share in Ubuntu. For example:

  • as root, you can use mount.cifs:

    mount -t cifs -o user=username //servername/sharename/ /mnt
    
  • you can use smbnetfs as described here

However, I would like to use gvfs. When logging in using ssh. I tried the following without a success:

dbus-launch bash
gvfs-mount smb://servername/sharename/

This works... kind of. When I run

gvfs-mount -l 

I get the following:

Mount(0): sharename on servername -> smb://servername/sharename/
  Type: GDaemonMount

So, the mount seems to work. However, there is no file system mount point, whereas when I mount it using Nautilus, I get a mountpoint in /run/user/1000/gvfs/, which I can then access using command line.

What should I do to get a mount point with gvfs which I can access with the command line?

January
  • 35,952

2 Answers2

8

At least with Ubuntu 18.04, the following works:

$ gio mount smb://<server>/<share>
Password required for share <share> on <server>
User [<user>]:
Domain [<workgroup>]:
Password:

The mount points are located in /run/user/<uid>/gvfs/ (idem $XDG_RUNTIME_DIR/gvfs).

Pablo Bianchi
  • 15,657
  • For unattended mount with username/password/workgroup try this. Then you can create a symlink to whatever with eg ln -si $XDG_RUNTIME_DIR/gvfs/mysmbmount $HOME/smb – Pablo Bianchi Jan 13 '20 at 16:10
  • For me, this only works when issued from a terminal window in a gnome session. If I ssh in (like in the question) and run the same command I get: gio: smb://<server>/<share>: volume doesn't implement mount. – pavon May 14 '21 at 00:35
3

The mount point should be in ~/.gvfs. At least by me it was there with this name: smb-share\:domain\=WORKGROUP\,server\=192.168.0.186\,share\=asmedia-hdd\,user\=root/. If you still cannot find it, you can try sudo find / -name sharename -type d. Maybe it finds the directory somewhere else. Another possible location is /run/user/1000/gvfs.

inf3rno
  • 252