[Virtio-fs] question: QEMU guest with Virtiofs but without virtiofsd

Stefan Hajnoczi stefanha at gmail.com
Fri Feb 24 17:23:43 UTC 2023


On Fri, 24 Feb 2023 at 11:47, Ferenc Fejes <fejes at inf.elte.hu> wrote:
> I'm using a QEMU VM with a debootstrap rootfs, shared over virtiofs for
> the guest. My best understanding is that virtiofsd must required even
> if just using one guest.

Yes, virtiofsd is required even if just one guest is accessing a
shared directory using a virtiofs device. The virtiofsd daemon is
responsible for emulating the virtiofs device (QEMU does not do the
emulation), so that's why it's essential even with just a single
guest.

> Looking around in the QEMU manpages I got a little bit confused by
> virtfs parameter. Is it something entirely connected with 9P or it is
> possible to pass folders to the guest through virtiofs without
> virtiofsd? Unfortunately none of my trial with the parameters
> succeeded.

There are two separate VIRTIO devices for sharing files/directories:
virtiofs and virtio-9p (sometimes called virtfs). It's easy to confuse
them because "virtiofs" and "virtfs" look similar. They have different
features and are completely independent of each other. In terms of the
file system protocol, virtiofs is based on Linux FUSE while virtio-9p
is based on the 9P protocol.

virtiofs uses the --device vhost-user-fs-pci syntax together with a
virtiofsd process.

virtio-9p uses either the full --device virtio-9p-pci and --fsdev
syntax or the shortcut --virtfs syntax that combines both these
options.

> Could someone can give me a confirmation if virtiofsd is must or its
> optional. Thanks in advance!

If you want to use virtiofs then virtiofsd is required.

If you use virtio-9p then virtiofsd is not needed.

In terms of which one you should use, both are widely used today.
Unless you have specific requirements, I think you can choose
whichever one seems most convenient to you.

Stefan



More information about the Virtio-fs mailing list