Trying to create any VM with a simple virtio-fs mount fails
Basic XML:
<filesystem type='mount' accessmode='passthrough'> <driver type='virtiofs'/> <binary path='/usr/libexec/virtiofsd' /> <source dir='/mnt/user/shared'/> <target dir='shared_mount'/> </filesystem>
QEMU logs:
Quoteqemu-system-x86_64: -device vhost-user-fs-pci,chardev=chr-vu-fs0,tag=shared_mount,bus=pci.5,addr=0x0: Failed to write msg. Wrote -1 instead of 12.
qemu-system-x86_64: -device vhost-user-fs-pci,chardev=chr-vu-fs0,tag=shared_mount,bus=pci.5,addr=0x0: vhost_dev_init failed: Operation not permitted
shutting down, reason=failed
virtio-fsd logs:
Quote[ID: 00029648] virtio_session_mount: Waiting for vhost-user socket connection...
[ID: 00029648] virtio_session_mount: Received vhost-user socket connection
[ID: 00000001] pivot_root(., .): Invalid argument
stefanha (QEMU person for this feature) said it was most likely because pivot_root doesn't work well under initramfs. QEMU 5.2 might mitigate this issue by adding a flags to use chroot instead (-o sandbox=chroot).
Defaulting this behavior would require creating a script like
exec /usr/libexec virtiofsd -o sandbox=chroot "$@"
stefanha also suggested unraid devs may want to contact virtio-fs developers in #virtio-fs on Freenode IRC or the [email protected] mailing list (e.g. to see if there is any changes that can be made to unraid to fix pivot_root).
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.