[Virtio-fs] How to setup virtiofs for file sharing between host and VM

Stefan Hajnoczi stefanha at redhat.com
Tue Jun 9 12:50:40 UTC 2020


On Fri, Jun 05, 2020 at 11:50:06AM +0100, Boris Ebwanga wrote:
> Hello everyone.
> 
> It's been a while now, I am trying to use virtio-fs. Everything I do end up
> with an error.
> 
> First I was on fedora 31 and I tried to run manually qemu with virtio-fs
> https://virtio-fs.gitlab.io/howto-qemu.html. But I was not able to "make
> virtiofsd".
> 
> Then, I upgraded to fedora 32 which has virtiofsd at /usr/libexec. I
> followed the steps describe at
> https://libvirt.org/kbase/virtiofs.html
> I could not modify the XML domain of my VM. The error message is "*unsupported
> configuration: unknown fs virtiofs » driver type".*
> 
> I wrote to Stefan Hajnoczi <stefanha at redhat.com> describing this problem.
> He answers with the following:
> 
> Hi Boris,
> > You can pass command-line options to the guest like this:
> >
> >   <domain type='kvm' xmlns:qemu='
> > http://libvirt.org/schemas/domain/qemu/1.0'>
> >     ...
> >     <qemu:commandline>
> >       <qemu:arg value='-chardev'/>
> >       <qemu:arg value='socket,id=char0,path=/tmp/vhost-fs.sock'/>
> >       <qemu:arg value='-device'/>
> >       <qemu:arg
> > value='vhost-user-fs-pci,chardev=virtio-fs-chardev,tag=myfs'/>
> >     </qemu:commandline>
> >   </domain>
> >
> > Note that the xmlns in the <domain> tag is required.
> >
> > If you pass these options manually then you need to launch virtiofsd
> > yourself before launching the guest:
> >
> >   # /usr/libexec/virtiofsd --socket-path=/tmp/vhost-fs.sock -o
> > source=/path/to/share/dir -o no_posix_lock -o xattr
> >
> > Hope this helps! Please email virtio-fs at redhat.com if you have any more
> > questions, it's the virtio-fs mailing list and others will be able to
> > participate in the discussion.
> >
> 
> I am still getting the same error after applying the change above.
> 
> Can anyone help me with this ? Thank you in advance for your help.

Hi Boris,
The "unknown fs virtiofs" error shouldn't happen if you the
<qemu:commandline> syntax. Could it be that there is still a <filesystem
type='mount' accessmode='passthrough'> XML tag from a previous attempt?

Please post the full domain XML (virsh dumpxml <domain>) so we can
suggest how to fix it.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virtio-fs/attachments/20200609/3f8fad71/attachment.sig>


More information about the Virtio-fs mailing list