virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
1.91k stars 377 forks source link

virtiofs ignoring CLI arguments when created as a service #1083

Open kantlivelong opened 2 months ago

kantlivelong commented 2 months ago

Describe the bug When creating an additional service VirtioFsSvc-TAG the CLI arguments appear to be ignored.

To Reproduce

  1. Create multiple virtiofs filesystems
  2. Disable the built in VirtioFsSvc service
  3. Create a tag specific service;
    sc create VirtioFsSvc-data binPath="\"C:\Program Files\Virtio-Win\VioFS\virtiofs.exe\" -t data -m D:" start=auto depend=VirtioFsDrv
  4. Start

Expected behavior Tag data should be mounted to D: but instead the reg values are being used.

Screenshots If applicable, add screenshots to help explain your problem.

Host:

VM:

Additional context Add any other context about the problem here.

xiagao commented 2 months ago

@kantlivelong Hi, You might parse the arguments from the registry, refer to the wiki https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Virtiofs:-Shared-file-system#options .

kantlivelong commented 2 months ago

@kantlivelong Hi, You might parse the arguments from the registry, refer to the wiki https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Virtiofs:-Shared-file-system#options .

This works for a single virtiofs tag but not multiple. The documentation also mentions using WinFSP for multiple but that is not persistent from what I can tell.

xiagao commented 2 months ago

Hi @kantlivelong, here is my steps with multiple virtiofs, it works from my side.

1. Config WinFsp.Launcher for multifs.
"C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\virtiofs.exe" "-t %1 -m %2"
2. Start virtiofs instance with tag myfs1 to V:.
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsmyfs1 myfs1 V:
3. check the mapping volume inside guest
wmic logicaldisk where (VolumeName='myfs1') get DeviceID
C:\>
DeviceID
V:

Btw, I refer to Multiple virtiofs instances setup in the wiki https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Virtiofs:-Shared-file-system#multiple-virtiofs-instances

Hope this is helpful.

kantlivelong commented 2 months ago

I did see that part of the documentation and gave it a try before opening this ticket. While it did work I found that it did not persist on reboot.

Is the expectation that a bat be created and run via task scheduler on boot?

xiagao commented 2 months ago

I did see that part of the documentation and gave it a try before opening this ticket. While it did work I found that it did not persist on reboot.

Is the expectation that a bat be created and run via task scheduler on boot?

Hi @YanVugenfirer , do we have any plan regarding @kantlivelong 's situation?

And for multiple shared dir, I don't think it works with "sc create VirtioFsSvc-data binPath="\"C:\Program Files\Virtio-Win\VioFS\virtiofs.exe\" -t data -m D:" start=auto depend=VirtioFsDrv", what's your opinion?

YanVugenfirer commented 2 months ago

Currently for the multiple mounts, a WinFSP launcher should be used. So, yes - the solution is batch files on boot to configure the mounts.

We still need to fix an issue of mismatch of the configuration in the registry and in CLI. @xiagao I suggest opening Jira for this.