37

From what I read, when mounting a network share via nautilus or gvfs-mount the mount point should be in ~/.gvfs. This seems not to be the case for me: I tried mounting both an FTP and SMB share via both nautilus and gvfs-mount under both Ubuntu Maverick and Natty and in none of the cases did I see any mount point under ~/.gvfs. I can access the shares just find in nautilus, but I want to have access via the command line, which is why I need a mount point in the file system.

Edit: Debugging following James Henstridge's answer and enzotib's comment revealed that on my laptop gvfs-fuse-daemon is running and consequently gvfs mounts show up in ~/.gvfs, whereas on the 2 workstations where ~/.gvfs remained empty gvfs-fuse-daemon was not running. On all 3 machines there are other gvfs processes running: gvfsd, gvfs-afc-volume-monitor, ...

On the laptop, mount | fgrep gvfs yields

gvfs-fuse-daemon on /home/xxx/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=xxx)

That raises the questions:

  • How are shares mounted without gvfs-fuse-daemon running? Is there no mount point created in that case and is every access to the share a gvfs library call? Which daemon is responsible? gvfsd?
  • What's the role of gvfs-fuse-daemon? Does it only create a fuse mount point in ~/.gvfs?

Update: On 12.10 and later, mounts are under /run/user/<login>/gvfs.

kynan
  • 2,235

9 Answers9

21

Solved the problem (kind of).

On Ubuntu 12.10 the mountpoint appears in /run/user/(your username)/gvfs/sftp\:host\=\192.168.xxx.xxx.

Hope that helps

Eric Carvalho
  • 55,453
12

The ~/.gvfs directory should be a FUSE mount handled by the gvfs-fuse-daemon process. If the directory appears to be empty, it would indicate that gvfs-fuse-daemon did not start correctly.

You could try starting it manually with the following command:

/usr/lib/gvfs/gvfs-fuse-daemon ~/.gvfs

If that fails, you could try checking whether anything else is mounted there, or even delete and recreate the ~/.gvfs directory first. If things still fail, could you update your question and provide any error messages printed by gvfs-fuse-daemon?

** On 14.04 the daemon is called gvfsd-fuse and can be found in /usr/lib/gvfs/gvfsd-fuse.

heemayl
  • 93,925
4

In Ubuntu 12.10 the paths were changed:

$ mount |grep gvfs
gvfsd-fuse on /run/user/pcm/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=pcm)
cmcginty
  • 6,016
4

In newer versions of Ubuntu, gvfs defaults to mounting in /run/user/$USER/gvfs/.

You can check yourself where it's default mount point is by looking for your user's gvfsd-fuse line in /etc/mtab.

David L
  • 175
3

I have a similar problem with my 12.04 Precise system.

Drives that appear mounted in Nautilus do not appear in ~/.gvfs, particularly after a suspend/resume cycle. gvfs-fuse-daemon is running, but killing it and restarting does not fix the problem.

I found that restarting Nautilus after nautilus -q causes gvfs-fuse-daemon and Nautilus to co-operate again - the mount points reappear.

Chris
  • 31
3

On Debian 6.0 wheezy, with lxde and nautilus. I found the ~/.gvfs directory empty too. I tried to run

/usr/lib/gvfs/gvfs-fuse-daemon ~/.gvfs

But it told me: /dev/fuse: Permission Denied.

$ ll /dev/fuse
crw-rw---T 1 root fuse 10, 229 Dec 21 11:59 /dev/fuse

I thought that maybe it's because I'm not in the fuse group, then I added my user account to that group. After a reboot, the gvfs mount shows in ~/.gvfs correctly.

z7z8th
  • 31
3

I asked a related question for my Debian system, and the answer was to:

apt-get install gvfs-fuse
adduser <username> fuse

Then reboot. After a GVFS mount (via Nautilus), the share directory will be in one of two places, depending on which version of Debian or Ubuntu you have:

/run/user/<username>/gvfs
~/.gvfs
Mike T
  • 138
0

When I want to access files shared from a Windows machine directly (not browsing through Nautilus) I mount the share on a folder in my home directory.

For example. There if there is a Windows machine with the IP address 192.168.16.2 on the domain mydomain that has a folder shared as shared and I have a directory in my home directory called mnt, I can mount the share onmnt and access it as if it was within my home directory with:

sudo mount -t cifs "//192.168.16.2/shared" /home/stacey/mnt -o credentials=credentials,uid=stacey,gid=stacey

where credentials contains:

username=stacey
password=mypassword
domain=mydomain

Now I can use ls /home/stacey/mnt to list the files and directories in shared directory shared on 192.168.16.2 and access any file within this mount point as I would a file on my local hard drive.

You can get more information on mounting SMB shares with:

man mount.cifs
0

For now...

#!/bin/bash
# Add to Cron
# */1 * * * * /root/fixGvfs
w | grep -v root | tail -n +3 | awk '{print $1}' > /tmp/fixGvfsUsers
while read usuario
do
  id=$(id -u $usuario)
  if [ ! -f "/tmp/fixGvfs${id}" ]; then
    umount /run/user/${id}/gvfs
    if [ $? -eq 0 ]; then
      su - $usuario -c "/usr/bin/pkill gvfs*"
      touch "/tmp/fixGvfs${id}"
    fi
  fi
done < /tmp/fixGvfsUsers