Post navigation

In the past, having used the “Connect to server” feature in GNOME, you could easily access the remote server’s filesystem from within Nautilus, but it was impossible to access it from the command line (please correct me if I miss something here). Now GNOME uses gvfs. As soon as GNOME connects to the remote server, for instance an anonymous FTP server, you can effortlessly access the files on the server using command line tools by changing to the /home/<USER>/.gvfs/<server_connection_name> directory. This also gives us the chance to do some other cool things, like initiating file transfers from a remote server A to a remote server B using our desktop. Beautiful!

About George Notaras

George Notaras is the editor of the G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.

Actually, it is possible to use gvfs on a desktop environment other than GNOME, but you have to use the gvfs-mount utility directly as there is no graphical facility like the “Connect to server” feature of the GNOME desktop. For example, connecting to a remote SSH server requires the following:

gvfs-mount sftp://johndoe@secure.example.org

This will not work though if gvfsd and gvfs-fuse-daemon are not running in the background. I logged into fluxbox and both of those servers had been already running in the background. I didn’t have the time to investigate what had started them. I checked the system services but did not see any gvfs-related daemon being started on boot, so I guess they are started in the fluxbox loader script.

Anyway, if those daemons are not up, you can start gvfs-fuse-daemon manually, which in turn starts gvfsd. Ensure that the mount point /home/johndoe/.mygvfsmounts exists prior to bringing the daemon up.

/usr/libexec/gvfs-fuse-daemon /home/johndoe/.mygvfsmounts

This is probably not the optimal way to start this service, because if I kill it and then restart it using the same mount point (.mygvfsmounts), I get an error.

Anyway, if gvfsd and gvfs-fuse-daemon have successfully been started, then you can use gvfs-mount to connect to remote services and access their virtual filesystems inside .mygvfsmounts.

About

G-Loaded Journal is a technical blog that publishes news, guides and tutorials about GNU/Linux and other Free Open-Source Software. Our mission is to share our experience and knowledge about system administration, automation and programming.