Hi,
So I tried virtfiofsd, not straightforward to setup, arch wiki was helpful.
On my qemu command line, I added the following :
Code: Select all
-object memory-backend-memfd,id=mem,size=16G,share=on \
-numa node,memdev=mem \
-chardev socket,id=char0,path=/mnt/vm/win10/win10-virtfs.sock \
-device vhost-user-fs-pci,chardev=char0,tag=winshare \
Before starting the vm, you need to start virtiofsd with the vm socket and dir to share :
Code: Select all
/usr/libexec/virtiofsd --socket-path=/mnt/vm/win10/win10-virtfs.sock --shared-dir /mnt/data/winshare --cache always
Some warning, error, I don't know yet how to solve this. (I start virtiofsd as user)
Code: Select all
2023-12-18T23:46:53Z WARN virtiofsd::limits Failure when trying to set the limit to 1000000, the hard limit (4096) of open file descriptors is used instead.
2023-12-18T23:46:53Z WARN virtiofsd::sandbox Couldn't set the process uid as root: -1
2023-12-18T23:46:53Z WARN virtiofsd::sandbox Couldn't set the process gid as root: -1
2023-12-18T23:46:53Z INFO virtiofsd Waiting for vhost-user socket connection...
2023-12-18T23:46:54Z INFO virtiofsd Client connected, servicing requests
Warning: Cannot announce submounts, client does not support it
2023-12-18T23:57:51Z ERROR virtiofsd::passthrough::credentials failed to change uid back to root: Invalid argument (os error 22)
2023-12-18T23:57:51Z ERROR virtiofsd::passthrough::credentials failed to change gid back to root: Invalid argument (os error 22)
2023-12-19T00:03:12Z INFO virtiofsd Client disconnected, shutting down
Nonetheless, the share works fine. I copied, deleted files without issue.
On the windows side, you need to install latest WinFsp & virtio-win (See:
https://virtio-fs.gitlab.io/howto-windows.html )
After reboot, go in "Services" and make sure that virtiofs service is set to start automatically.
Also, I tried with a win7 vm but unfortunately it doesn't work.
Thanks for the suggestion blu3bird!
@szatox, isn't 9p only Linux though ? I'll give a try to file as block device later, this could be even better than virtiofsd for my use case...