1VIRTIOFSD(1)                         QEMU                         VIRTIOFSD(1)
2
3
4

NAME

6       virtiofsd - QEMU virtio-fs shared file system daemon
7

SYNOPSIS

9       virtiofsd [OPTIONS]
10

DESCRIPTION

12       Share  a  host  directory tree with a guest through a virtio-fs device.
13       This program is a vhost-user  backend  that  implements  the  virtio-fs
14       device.   Each  virtio-fs  device  instance  requires its own virtiofsd
15       process.
16
17       This program is designed to work with QEMU's --device vhost-user-fs-pci
18       but  should  work  with any virtual machine monitor (VMM) that supports
19       vhost-user.  See the Examples section below.
20
21       This program must be run as the root user.  Upon  startup  the  program
22       will  switch into a new file system namespace with the shared directory
23       tree as its root.  This prevents "file system escapes" due to  symlinks
24       and  other  file  system  objects  that might lead to files outside the
25       shared directory.  The program also sandboxes itself  using  seccomp(2)
26       to  prevent ptrace(2) and other vectors that could allow an attacker to
27       compromise the system after gaining control of the virtiofsd process.
28

OPTIONS

30       -h, --help
31              Print help.
32
33       -V, --version
34              Print version.
35
36       -d     Enable debug output.
37
38       --syslog
39              Print log messages to syslog instead of stderr.
40
41       -o OPTION
42
43              · debug - Enable debug output.
44
45              · flock|no_flock  -  Enable/disable  flock.   The   default   is
46                no_flock.
47
48              · modcaps=CAPLIST  Modify  the  list  of  capabilities  allowed;
49                CAPLIST is a colon separated list of capabilities,  each  pre‐
50                ceded by either + or -, e.g.  ''+sys_admin:-chown''.
51
52              · log_level=LEVEL  -  Print  only log messages matching LEVEL or
53                more severe.  LEVEL is one of err, warn, info, or debug.   The
54                default is info.
55
56              · norace - Disable racy fallback.  The default is false.
57
58              · posix_lock|no_posix_lock  - Enable/disable remote POSIX locks.
59                The default is posix_lock.
60
61              · readdirplus|no_readdirplus - Enable/disable readdirplus.   The
62                default is readdirplus.
63
64              · source=PATH - Share host directory tree located at PATH.  This
65                option is required.
66
67              · timeout=TIMEOUT - I/O timeout in seconds.  The default depends
68                on cache= option.
69
70              · writeback|no_writeback  -  Enable/disable writeback cache. The
71                cache  alows  the  FUSE  client  to  buffer  and  merge  write
72                requests.  The default is no_writeback.
73
74              · xattr|no_xattr - Enable/disable extended attributes (xattr) on
75                files and directories.  The default is no_xattr.
76
77       --socket-path=PATH
78              Listen on vhost-user UNIX domain socket at PATH.
79
80       --fd=FDNUM
81              Accept connections  from  vhost-user  UNIX  domain  socket  file
82              descriptor FDNUM.  The file descriptor must already be listening
83              for connections.
84
85       --thread-pool-size=NUM
86              Restrict the number of worker threads per request queue to  NUM.
87              The default is 64.
88
89       --cache=none|auto|always
90              Select  the desired trade-off between coherency and performance.
91              none forbids the  FUSE  client  from  caching  to  achieve  best
92              coherency  at the cost of performance.  auto acts similar to NFS
93              with a 1 second metadata cache  timeout.   always  sets  a  long
94              cache lifetime at the expense of coherency.
95

EXAMPLES

97       Export    /var/lib/fs/vm001/   on   vhost-user   UNIX   domain   socket
98       /var/run/vm001-vhost-fs.sock:
99
100          host# virtiofsd --socket-path=/var/run/vm001-vhost-fs.sock -o source=/var/lib/fs/vm001
101          host# qemu-system-x86_64 \
102              -chardev socket,id=char0,path=/var/run/vm001-vhost-fs.sock \
103              -device vhost-user-fs-pci,chardev=char0,tag=myfs \
104              -object memory-backend-memfd,id=mem,size=4G,share=on \
105              -numa node,memdev=mem \
106              ...
107          guest# mount -t virtiofs myfs /mnt
108

AUTHOR

110       Stefan     Hajnoczi     <stefanha@redhat.com>,     Masayoshi     Mizuma
111       <m.mizuma@jp.fujitsu.com>
112
114       2021, The QEMU Project Developers
115
116
117
118
1195.1.0                            Jan 11, 2021                     VIRTIOFSD(1)
Impressum