siliconflow/virtiofsd
Rust
Captured source
source ↗siliconflow/virtiofsd
Language: Rust
License: Apache-2.0
Stars: 0
Forks: 0
Open issues: 0
Created: 2026-08-18T11:06:02Z
Pushed: 2026-08-25T11:43:32Z
Default branch: release-v1.14
Fork: no
Archived: no
README:
virtiofsd
A virtio-fs vhost-user device daemon written in Rust.
Building from sources
Requirements
This project depends on libcap-ng and libseccomp. You can obtain those dependencies by building them for their respective sources, or by installing the correspondent development packages from your distribution, if available:
- Fedora/CentOS/RHEL
dnf install libcap-ng-devel libseccomp-devel
- Debian/Ubuntu
apt install libcap-ng-dev libseccomp-dev
Compiling
virtiofsd is written in Rust, so you will have to install Rust in order to compile it, and it uses cargo to manage the project and its dependencies. After installing Rust, you can compile it to a binary by running:
cargo build --release
CI-built binaries
Every time new code is merged, the CI pipeline will upload a debug binary of virtiofsd. It is intended to be an accessible way for anyone to download and test virtiofsd without needing a Rust toolchain installed.
The debug binary is built only for x86\_64 Linux-based systems.
[Click here to download the latest build]( https://gitlab.com/virtio-fs/virtiofsd/-/jobs/artifacts/main/download?job=publish)
Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
Usage
This program must be run as the root user or as a "fake" root inside a user namespace (see [Running as non-privileged user](#running-as-non-privileged-user)).
The program drops privileges where possible during startup, although it must be able to create and access files with any uid/gid:
- The ability to invoke syscalls is limited using
seccomp(2). - Linux
capabilities(7)are dropped. virtiofsd only retains the following capabilities:
CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FOWNER, CAP_FSETID, CAP_SETGID, CAP_SETUID, CAP_MKNOD, CAP_SETFCAP (and CAP_DAC_READ_SEARCH if --inode-file-handles is used).
virtiofsd [FLAGS] [OPTIONS] --fd |--socket-path --shared-dir
Flags
-h, --help
Prints help information.
-V, --version
Prints version information.
--syslog
Log to syslog. Default: stderr.
--print-capabilities
Print vhost-user.json backend program capabilities and exit.
--allow-direct-io
Honor the O_DIRECT flag passed down by guest applications.
--announce-submounts
Tell the guest which directories are mount points [enabled by default]. If multiple filesystems are mounted in the shared directory, virtiofsd passes inode IDs directly to the guest, and because such IDs are unique only on a single filesystem, it is possible that the guest will encounter duplicates if multiple filesystems are mounted in the shared directory. --announce-submounts solves that problem because it reports a different device number for every submount it encounters.
In addition, when running with --announce-submounts, the client sends one SYNCFS request per submount that is to be synced, so virtiofsd will call syncfs() on each submount. On the other hand, when running without --announce-submounts, the client only sends a SYNCFS request for the root mount, this may lead to data loss/corruption.
--no-announce-submounts
Disable announce-submounts mode. This flag overrides the default behavior of announcing submounts to the guest.
--no-killpriv-v2
Disable KILLPRIV V2 support. This is required if the shared directory is an NFS file system. KILLPRIV V2 support is disabled by default.
--killpriv-v2
Enable KILLPRIV V2 support. It is disabled by default.
--no-readdirplus
Disable support for READDIRPLUS operations.
--writeback
Enable writeback cache.
--xattr
Enable support for extended attributes.
--posix-acl[=]
Enable support for posix ACLs (implies --xattr). The mode controls POSIX ACL capability negotiation:
always: require POSIX ACL support, error if the guest does not support it.auto: enable if the guest supports it.never: disable POSIX ACL support.
The default is never. When --posix-acl is passed without a value, it defaults to always.
--security-label[=]
Enable support for security label (SELinux), implies --xattr. The mode controls security label capability negotiation:
always: require security label support, error if the guest does not support it.auto: enable if the guest supports it.never: disable security label support.
The default is never. When --security-label is passed without a value, it defaults to always.
--preserve-noatime
Always preserve O_NOATIME.
By default virtiofsd will implicitly clean up O_NOATIME to prevent potential permission errors. The option --preserve-noatime can be used to override this behavior and preserve the O_NOATIME flag specified by the client.
--readonly
Prevent write accesses from the guest. Note that this does not make the underlying shared directory an actual read-only mount, so e.g. the access time is still updated on accesses.
Options
--shared-dir
Shared directory path.
--tag
The tag that the virtio device advertises.
Setting this option will enable advertising of VHOST_USER_PROTOCOL_F_CONFIG. However, the vhost-user frontend of your hypervisor may not negotiate this feature and (or) ignore this value. Notably, QEMU currently (as of 8.1) ignores the CONFIG feature. QEMU versions from 7.1 to 8.0 will crash while attempting to log a warning about not supporting the feature.
--socket-group
Name of group for the vhost-user socket.
--socket-path
vhost-user socket path.
--fd
File descriptor for the listening (not yet connected) socket.
--log-level
Log level (error, warn, info, debug, trace, off).
Default: info.
--thread-pool-size
Maximum thread pool size. A value of "0" disables the pool.
Default: 0.
--rlimit-nofile
Set maximum number of file descriptors. If the soft limit is greater than 1M or...
Excerpt shown — open the source for the full document.