GVfs

Last updated
GVfs
Repository
Operating system Linux
Platform GNOME
Type abstraction layer for the files system
License LGPL-2.0-or-later
Website wiki.gnome.org/Projects/gvfs   OOjs UI icon edit-ltr-progressive.svg

GVfs (abbreviation for GNOME virtual file system) is GNOME's userspace virtual filesystem designed to work with the I/O abstraction of GIO, a library available in GLib since version 2.15.1. It installs several modules that are automatically used by applications using the APIs of libgio. There is also FUSE support that allows applications not using GIO to access the GVfs filesystems.

Contents

A cause of confusion is the fact that the file system abstraction used by the Linux kernel is also called the virtual file system (VFS) layer. This is however at a lower level.

The GVfs model differs from e.g. GnomeVFS, which it replaces, in that file systems must be mounted before they are used. There is a master daemon (gvfsd) that handles coordinating mounts, and then each mount is (typically) in its own daemon process (although mounts can share daemon process).

GVfs comes with a set of back-ends, including trash support, SFTP, FTP, WebDAV, SMB, and local data via Udev integration, OBEX, MTP and others. [1] GVfs does not seem to support the Files transferred over shell protocol (FISH).

GVfs also contains modules for GIO that implement volume monitors and the GNOME URI scheme handler configuration.

There is a set of arguments to the command line program "gio" that lets you run commands (like cat, ls, stat, mount, etc.) on files in the GVfs mounts.

Attached resources are exposed via a URI syntax, for example smb://server01/gamedata or ftp://username:password@ftp.example.net/public_html, but are also mounted in the traditional manner under ~/.gvfs/ or /run/user/$UID/gvfs or $XDG_RUNTIME_DIR/gvfs directory [2] [3] to make them available to applications using standard POSIX commands and I/O.

Technical details

The option x-gvfs-show for the gvfs-udisks2-volume-monitor process determines whether a mounted device is shown or not in GNOME Files. Screenshot of GNOME Disks. X-gvfs-show.png
The option x-gvfs-show for the gvfs-udisks2-volume-monitor process determines whether a mounted device is shown or not in GNOME Files. Screenshot of GNOME Disks.

Along with generally useful APIs such as networking and D-Bus support, GIO also provides a VFS API to applications. GVfs provides implementations that go beyond that and allow to access files and storage using many protocols. GVfs provides implementations for various network file systems as loadable modules. Additionally GVfs also provides support for trash, network or recent folders, for CD burning and for monitoring interesting devices and volumes on the computer.

The goal of GVfs has been to overcome the shortcomings of GnomeVFS [5] and provide an API that is so good that developers prefer it over raw POSIX calls. Among other things that means using GObject. It also means not cloning the POSIX API, but providing higher-level, document-centric interfaces. GTK can directly use it, e.g. in the filechooser.

Applications use GVfs indirectly, by means of GIO loading the GVfs module that implements the GIO extension points. The GVfs main daemon gvfsd spawns further mount daemons for each individual connection. The GVfs support for volume monitoring is included in a separate loadable module.

The actual GVfs implementation is distributed over a number of processes.

GVfs can use FUSE to mount its VFS directly onto the filesystem. [6] It consists of two parts: [7]

  1. a shared library which is loaded by applications supporting GIO
  2. GVfs itself, which contains a collection of daemons which communicate with each other and the GIO module over D-Bus.

A collection of command-line utilities (such as gvfs-mount, gvfs-less) works with VFS resources. [8]

Daemontask
Main
gvfsdgvfsd is the main daemon of GVfs. It provides the "org.gtk.vfs.Daemon" name on the session bus. gvfsd is autostarted by GIO clients if it is not running. The primary task of gvfsd is to act as a mount tracker/manager. It spawns new back-ends when requested and keeps track of their lifecycle, maintaining a list of active mounts and creates direct connections to them. gvfsd also starts the gvfsd-fuse(1), and provides it the mount point where the fuse file system should be mounted.
gvfsd-fusegvfsd-fuse maintains a FUSE (Filesystem in Userspace) mount to make GVfs back-ends available to POSIX applications. The mount point for the fuse filesystem is provided by the [PATH] argument. gvfsd-fuse is normally started by gvfsd.
gvfsd-metadatagvfsd-metadata is a daemon acting as a write serialiser to the internal gvfs metadata storage. It is autostarted by GIO clients when they make metadata changes. Read operations are done by client-side GIO code directly, and don't require the daemon to be running. The gvfs metadata capabilities are used by the GNOME Files file manager, for example.
Volume monitors
gvfs-goa-volume-monitorsupport for GNOME Online Accounts (cf. GNOME Online Accounts in the GNOME wiki)
gvfs-gphoto2-volume-monitorsupport for the Picture Transfer Protocol as implemented in gPhoto
gvfs-mtp-volume-monitorsupport for the Media Transfer Protocol
gvfs-udisks2-volume-monitorThe gvfs-udisks2-volume-monitor process is responsible for the disks, media, mounts and fstab entries shown in the desktop user interface. In particular, GNOME Shell, GNOME Files as well as any other application using the GLib APIs, is using information from this process. [4] In Debian it is distributed as part of the gvfs-daemons package. [9] It is not to be confused with udisksd and udisksctl, which are part of the udisks2 package. [10]
udisks: The udisks daemon serves as an interface to system block devices, implemented via D-Bus. It handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives.
gvfs-afc-volume-monitorsupport for Apple File Conduit
Mount back-ends
gvfsd-afcmounts iPhone/iPod touch volumes
gvfsd-afpmounts Apple Filing Protocol volumes
gvfsd-afp-browsebrowses Apple Filing Protocol volumes
gvfsd-archivemounts archive files in various formats
gvfsd-burnprovides a location for burning CDs/optical discs
gvfsd-cddamounts audio CDs
gvfsd-computerprovides computer://
gvfsd-davmounts DAV filesystems
gvfsd-dnssdbrowses DNS-SD
gvfsd-ftpmounts over FTP
gvfsd-gphoto2mounts over PTP, meaning GVfs uses libgphoto2 to expose on-camera photos to GNOME applications via the VFS
gvfsd-httpmounts over HTTP
gvfsd-localtesta test backend
gvfsd-mtpmounts over MTP
gvfsd-networkprovides network://
gvfsd-nfsmounts over NFS protocol
gvfsd-recentprovides recent://
gvfsd-sftpmounts over sftp
gvfsd-smbmounts SMB (i.e. Windows Shares Filesystem) volumes
gvfsd-smb-browsebrowses Windows Shares Filesystem volumes
gvfsd-trashprovides trash://

Please refer to https://wiki.gnome.org/Projects/gvfs/backends for the official documentation.

Hot plugging

Devices connected over eSATA or USB are (supposed to be) physically hot-pluggable. When a device is physically connected to or physically removed from the computer system, the Linux kernel notices and sends out an event to user-space. systemd-udevd receives such events and responds to them according to its quite comprehensive configuration:

The udisks2 daemon udisksd serves as an interface to system block devices, implemented via D-Bus. It handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives. This package also provides the udisksctl utility, which can be used to trigger these operations from the command line (if permitted by PolicyKit).

Packaging

In Debian the GVfs is packaged into four packages: gvfs, gvfs-daemons, gvfs-bin and gvfs-backends.

See also

Related Research Articles

<span class="mw-page-title-main">Cygwin</span> Unix subsystem for Windows machines

Cygwin is a Unix-like environment and command-line interface for Microsoft Windows. Cygwin's purpose is expressed in its motto: "Get that Linux feeling – on Windows".

<span class="mw-page-title-main">GNOME Files</span> File manager

GNOME Files, formerly and internally known as Nautilus, is the official file manager for the GNOME desktop. Nautilus was originally developed by Eazel with many luminaries from the tech world including Andy Hertzfeld (Apple), chief architect for Nautilus. The nautilus name was a play on words, evoking the shell of a nautilus to represent an operating system shell. Nautilus replaced Midnight Commander in GNOME 1.4 (2001) and has been the default file manager from version 2.0 onwards.

<span class="mw-page-title-main">Virtual file system</span> Abstract layer on top of a more concrete file system

A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows, classic Mac OS/macOS and Unix filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

GnomeVFS was an abstraction layer of the GNOME platform for the reading, writing and execution of files. Before GNOME 2.22 GnomeVFS was primarily used by the appropriate versions of Nautilus file manager and other GNOME applications.

The Media Transfer Protocol (MTP) is an extension to the Picture Transfer Protocol (PTP) communications protocol that allows media files to be transferred automatically to and from portable devices. Whereas PTP was designed for downloading photographs from digital cameras, Media Transfer Protocol allows the transfer of music files on digital audio players and media files on portable media players, as well as personal information on personal digital assistants. MTP is a key part of WMDRM10-PD, a digital rights management (DRM) service for the Windows Media platform. In 2011, it became the standard method to transfer files to and from Android.

Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a bridge to the actual kernel interfaces.

udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

Unix-like operating systems identify a user by a value called a user identifier, often abbreviated to user ID or UID. The UID, along with the group identifier (GID) and other access control criteria, is used to determine which system resources a user can access. The password file maps textual user names to UIDs. UIDs are stored in the inodes of the Unix file system, running processes, tar archives, and the now-obsolete Network Information Service. In POSIX-compliant environments, the command-line command id gives the current user's UID, as well as more information such as the user name, primary user group and group identifier (GID).

A file system API is an application programming interface through which a utility or user program requests services of a file system. An operating system may provide abstractions for accessing different file systems transparently.

D-Bus is a message-oriented middleware mechanism that allows communication between multiple processes running concurrently on the same machine. D-Bus was developed as part of the freedesktop.org project, initiated by GNOME developer Havoc Pennington to standardize services provided by Linux desktop environments such as GNOME and KDE.

<span class="mw-page-title-main">Linux kernel interfaces</span> An overview and comparison of the Linux kernal APIs and ABIs.

The Linux kernel provides several interfaces to user-space applications that are used for different purposes and that have different properties by design. There are two types of application programming interface (API) in the Linux kernel that are not to be confused: the "kernel–user space" API and the "kernel internal" API.

FTPFS refers to file systems that support access to a File Transfer Protocol (FTP) server through standard file system application programming interfaces (APIs).

In Unix-like operating systems, a loop device, vnd, or lofi is a pseudo-device that makes a computer file accessible as a block device.

<span class="mw-page-title-main">GNOME Commander</span> Twin-panel file manager for the GNOME desktop

GNOME Commander is a 'two panel' graphical file manager for GNOME. It is built using the GTK+ toolkit and GVfs.

<span class="mw-page-title-main">Fiwix</span> Operating system

Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobbyist operating system, but it also serves for educational purposes. It runs on the i386 hardware platform and is compatible with a good base of existing GNU applications. It follows the System V Application Binary Interface and is also Linux 2.0 System Call ABI mostly compatible

The multi-stage booting process of Linux is in many ways similar to the BSD and other Unix-style boot processes, from which it derives.

<span class="mw-page-title-main">GIO (software)</span>

GIO is a library, designed to present programmers with a modern and usable interface to a virtual file system. It allows applications to access local and remote files with a single consistent API, which was designed "to overcome the shortcomings of GnomeVFS" and be "so good that developers prefer it over raw POSIX calls."

libguestfs is a C library and a set of tools for accessing and modifying virtual disk images used in platform virtualization. The tools can be used for viewing and editing virtual machines (VMs) managed by libvirt and files inside VMs, scripting changes to VMs, creating VMs, and much else besides. It was created because of security issues, when virtual disk images are mounted directly on the host system.

systemd Suite of system components for Linux

Systemd is a software suite that provides an array of system components for Linux operating systems. The main aim is to unify service configuration and behavior across Linux distributions. Its primary component is a "system and service manager" – an init system used to bootstrap user space and manage user processes. It also provides replacements for various daemons and utilities, including device management, login management, network connection management, and event logging. The name systemd adheres to the Unix convention of naming daemons by appending the letter d. It also plays on the term "System D", which refers to a person's ability to adapt quickly and improvise to solve problems.

<span class="mw-page-title-main">SpaceFM</span> Graphical file manager for Linux

SpaceFM was a desktop-independent, multi-panel, tabbed file manager for Linux. SpaceFM is built using the GTK+ toolkit. Available under the terms of the GNU General Public License, SpaceFM is free software.

References

  1. GNOME 2.22 Release Notes, 6.1: GVfs and GIO
  2. "gvfsd-fuse.1 - manned.org". manned.org. Retrieved 18 April 2018.
  3. "Nautilus' remote folder default mount point". askubuntu.com. Retrieved 18 April 2018.
  4. 1 2 "udisks2/what-is-shown.txt"..
  5. "Plans for gnome-vfs replacement". mail.gnome.org. Retrieved 18 April 2018.
  6. "gvfs status report". mail.gnome.org. Retrieved 18 April 2018.
  7. "Using GNOMEvfs to manipulate files", Linux.com
  8. "OpenSolaris 2009.06 - man page for gvfs-mount (opensolaris section 1) - Unix & Linux Commands". www.unix.com. Retrieved 18 April 2018.
  9. "filelist of gvfs-daemons package".
  10. "filelist of udisks2 package".
  11. David Zeuthen (2014-05-28). "Modern Mounting with Udisks2".