I'm trying to use virtio-fs to mount a folder on the host in the guest, but running into an issue.

On the host I have qemu 1:5.0-5ubuntu6.

virtiofsd command and output:

/usr/lib/qemu/virtiofsd -f -d -o allow_root \
    --socket-path="/run/image_builder-base.sock" \
    -o source="/tmp/tmpxwx3urnz/merged" 

[74585059694946] [ID: 00000791] virtio_session_mount: Received vhost-user socket connection
[74585059757200] [ID: 00000791] capng_get_caps_process

qemu command and output:

qemu-system-x86_64 -m 2G -enable-kvm -cpu host -serial stdio \
    -kernel "boot/vmlinuz-5.4.0-47-generic" -initrd "boot/initramfs-5.4.0-47-generic.img" \
    -append "root=root_image_fs rootfstype=virtiofs rw" \
    -chardev socket,id=char0,path=/run/image_builder-base.sock \
    -device vhost-user-fs-pci,chardev=char0,tag=root_image_fs \
    -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm,share=on -numa node,memdev=mem

qemu-system-x86_64: -device vhost-user-fs-pci,chardev=char0,tag=root_image_fs: Failed to read msg header. Read 0 instead of 12. Original request 1.
qemu-system-x86_64: -device vhost-user-fs-pci,chardev=char0,tag=root_image_fs: vhost_dev_init failed: Operation not permitted

How do I get this working, or how can I debug the issue?

  • Which user(s) are running these commands? Commented Sep 12, 2020 at 16:18
  • I'm running both from root user. Commented Sep 12, 2020 at 16:54

1 Answer 1


Upgrading to qemu-system-x86 1:5.0-5ubuntu9 fixed this issue for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .