我正在尝试使用virtio-fs在来宾中安装主机上的文件夹,但遇到问题。
在主机上我有 qemu 1:5.0-5ubuntu6。
virtiofsd 命令和输出:
/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命令和输出:
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
我该如何使其正常工作,或者如何调试该问题?
答案1
升级到 qemu-system-x86 1:5.0-5ubuntu9 为我解决了这个问题。