Issues with virtiofsd and Windows 10 VM Local Drive Mounts

colin1234

New Member
Jan 3, 2024
4
0
1
I'm trying to use virtiofsd to mount a couple zfs drives in Windows as Local Drives (for a couple specific reasons that I won't get into). I've managed to make one of the drives show up once in Windows but never again. I've blown away the VM and rebuilt and am still having issues. I'm guessing I'm missing something. Steps I've taken are as follows,

I used this guide for the host side. I couldn't find a guide for the Windows VM config (only Linux) but I understand all I had to do for that was Step 1 below.

1. On the Windows VM I installed WinFSP and virtio-win-gt-x64.msi and ensured both services are set to run on startup with the VirtIO-FS Service being dependent on the WinFSP service. I then shut down the VM.

2. On the host, I installed virtiofsd

3. Grabbed the two hookscript files and put them where the guide says to. I modified virtiofs_hook.conf to look like this
Code:
109: /Media1-1, /Media1-2, /Media2-1, /Media2-2, /Temp
which are the five host mounts I want to share with the VM.
4. Ran
Code:
qm set 109 --hookscript local:snippets/virtiofs_hook.pl
and verified that the hookscript line is in
Code:
/etc/pve/qemu-server/109.conf
5. Started the VM and verified these services are running,
Code:
virtiofsd-109-Media1-1@109.service                                                                                             loaded active     running   virtiofsd filesystem share at  /Media1-1 for VM 109
  virtiofsd-109-Media1-2@109.service                                                                                           loaded active     running   virtiofsd filesystem share at  /Media1-2 for VM 109
  virtiofsd-109-Media2-1@109.service                                                                                           loaded active     running   virtiofsd filesystem share at  /Media2-1 for VM 109
  virtiofsd-109-Media2-2@109.service                                                                                           loaded active     running   virtiofsd filesystem share at  /Media2-2 for VM 109
  virtiofsd-109-Temp@109.service                                                                                               loaded active     running   virtiofsd filesystem share at  /Temp for VM 109
6. Confirmed that
Code:
/etc/pve/qemu-server/109.conf
now has the following argument.
Code:
args:  -object memory-backend-memfd,id=mem,size=4096M,share=on -numa node,memdev=mem -chardev socket,id=char0,path=/run/virtiofsd/109-Media1-1.sock -device vhost-user-fs-pci,chardev=char0,tag=109-Media1-1 -chardev socket,id=char1,path=/run/virtiofsd/109-Media1-2.sock -device vhost-user-fs-pci,chardev=char1,tag=109-Media1-2 -chardev socket,id=char2,path=/run/virtiofsd/109-Media2-1.sock -device vhost-user-fs-pci,chardev=char2,tag=109-Media2-1 -chardev socket,id=char3,path=/run/virtiofsd/109-Media2-2.sock -device vhost-user-fs-pci,chardev=char3,tag=109-Media2-2 -chardev socket,id=char4,path=/run/virtiofsd/109-Temp.sock -device vhost-user-fs-pci,chardev=char4,tag=109-Temp

As I said, there was one time when I did this and I saw 1 of the 5 mounts as a local drive in the Windows VM after completing the above steps. I have started over several times (following the "Cleanup" section of the linked guide and rebuilding the VM) and I can't get even one to show up again.

Anyone know what I'm missing?

EDIT: I also do not see any "Unknown Devices" in device manager. The only VirtIO device is see is the "VirtIO Balloon Driver" which I expect is unrelated. I understand I should see additional VirtIO devices.
 
Last edited:
Were you able to get more than one drive mounted in Windows? I was able to get a single drive to show up after a host reboot, but not more than one. I ended up doing a bind mount on the server for all 5 drives into a single folder, so that covers me as I can now access all 5 drives through a single local Windows mount. Would be nice to be able to mount more than one directly in Windows though.
 
Were you able to get more than one drive mounted in Windows?
Yes, it worked fine. I did it exactly like in the guide. You have to manually mount the virtiofs drives with:
Code:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsY mount_tag0 Y:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsZ mount_tag1 Z:
You could move these lines inside a startup script in Windows.

What did not work? What I remember is that you have to use CMD as Admin and not Powershell for these commands.

https://github.com/virtio-win/kvm-g...hared-file-system#multiple-virtiofs-instances
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!