14

How to restart the whole gvfs "subsystem", when I've e.g. killed a frozen gvfs-sftp process and want to use it again?

GVFS is the subsystem that takes care about mounting/unmounting drives when you click them in Nautilus, including network drives.

The problem is that sometimes the transfer freezes and I need to kill the frozen "provider" (e.g. the gvfs-sftp). But then I can no longer connect to any network drives in Nautilus using SFTP. Restarting the whole computer helps, but there probably is a better way.

I searched the whole /etc in my computer to find out how is this gvfs system started, but I didn't succeed.

  • This is a note to myself, because I keep forgetting (and needing) it occasionally. – Martin Pecka Jan 17 '18 at 11:40
  • AskUbuntu is not supposed to be a memo storage! This is a community for asking and helping on questions about Ubuntu. If you just want to save code snippets for yourself use another page like Gist's on GitHub.com. Or elaborate your question and answer well so other users can take advantage of it. – derHugo Jan 17 '18 at 15:44
  • @derHugo Then why is there the possibility to answer your own question? I thought it is exactly for this kind of things - you start solving an issue, find the answer, and think somebody else could also be interested. That's my case here. – Martin Pecka Jan 17 '18 at 16:30
  • This is true if your posts are elaborated well so another user can easily find your question and understand how your solution solves the issue. – derHugo Jan 17 '18 at 16:38
  • @derHugo Ok, I've made both the question and the answer more verbose. – Martin Pecka Jan 18 '18 at 14:19
  • It worked for me:
    user@machine:/run/user/1001/gvfs
    $ ls -l /run/user/1001/gvfs/
    ls: no se puede acceder a '/run/user/1001/gvfs/sftp:host=remotehost,user=root': Error de entrada/salida
    total 4
    ?????????? ? ?        ?           ?            ? 'sftp:host=remotehost,user=root'
    

    After restarting gvfs, all works fine.

    – framontb Nov 05 '21 at 11:36

2 Answers2

22

It shows that gvfs is automatically started with the first Nautilus instance (I still don't know how, but it does).

So to restart gvfs, just kill all the remaining process (killing the "master" gvfsd daemon is enough), make sure all instances of nautilus are closed, and then open a new one.

killall gvfsd
nautilus -q  # Close all Nautilus windows/instances
nautilus
  • 1
    Did not work for me just now. The mount point remains unattached:

    $ ls /run/user/1000/gvfs ls: cannot access /run/user/1000/gvfs: Transport endpoint is not connected

    – Tomislav Nakic-Alfirevic Jun 06 '19 at 22:33
  • 1
    Also works on XFCE: thunar -q – too Feb 28 '21 at 08:18
  • This just worked for me on Ubuntu 23.10. I was getting the "Transport endpoint is not connecting" whenever I tried to open a file on a smb mount via nautilus. Doing the above and re-opening the smb mount worked so I could open the files. – stuckj Dec 04 '23 at 03:57
  • Only commands that restarted SFTP without closing SSH sessions, thanks! – C-3PO Jun 12 '25 at 15:31
0

In Ubuntu 22.04 LTS it is enough to kill the gvfsd-sftp process in a Terminal with command:

killall gvfsd-sftp

It will be restarted as soon as nautilus has to open a new SFTP connection.
This also works in Linux Mint 21.3 MATE with caja.