kvm-guest-drivers-windows icon indicating copy to clipboard operation
kvm-guest-drivers-windows copied to clipboard

Virtiofs support for case-insensitivity

Open davispuh opened this issue 4 years ago • 9 comments
trafficstars

Currently if a linux case-sensitive filesystem is mapped to Windows guest using virtiofs then a lot of programs doesn't work trying to access files on this mapped disk because of genius developers unable to stick to single file casing at different parts of program. eg. one function loads one.DLL while different function uses One.dll and so on. It causes this mapping hardly usable... Are there any plans of adding support for case insensitivity?

davispuh avatar Oct 25 '21 16:10 davispuh

davispuh hi, To be honest, I'm not understand your issue,could you say more about it?such as, which programs are you using?Are those programs using the same file on the mapping disk,but can't work?

Thanks, Xiaoling

xiagao avatar Nov 03 '21 09:11 xiagao

There are many programs with such issues. But one example is Steam (https://store.steampowered.com/about/).

Some parts of code are trying to access SteamUI.dll (that's how it's saved on disk) while other places in code are accessing steamui.dll which fails to read. You can easily see it with Process Monitor

image

image

image

If I run it from Samba share then it works fine since Samba handles case insensitivity but that's not using Virtiofs so performance is worse.

Also this isn't only file with such casing issue. You can either symlink it or copy to have both names but that just leads to next issue. So case insensitivity really needs to be implemented in Virtiofs.

davispuh avatar Nov 04 '21 00:11 davispuh

@davispuh Thanks to propose this issue. Compared the virtiofs file system and the native NTFS file system, it's indeed a problem.We will track this issue in downstream as well.

Z:>echo testing > TEST.txt

Z:>type test.txt The system cannot find the file specified.

Z:>echo testing > c:\TEST.txt

Z:>type c:\TEST.txt testing

BR, Xiaoling

xiagao avatar Nov 24 '21 08:11 xiagao

Can confirm, several games in my steam library won't run due to this.

Madouura avatar Dec 15 '21 15:12 Madouura

Hello All,

Please help us understanding you use cases for using virtio-fs, and thus make us virtio-fs support better. Please participate in the discussion and add your use cases: https://github.com/virtio-win/kvm-guest-drivers-windows/discussions/726

Thanks a lot, Yan.

YanVugenfirer avatar Jan 31 '22 12:01 YanVugenfirer

Ironically, I ran into this while trying to compile virtio-fs. Not exactly self hosting ;)

Reading through the code, am I correct in believing that the case folding would have to be done either

  • At the linux filesystem level (I.e. ext4 described here)
  • Within libvirt/qemu's implementation of the host's filename lookup.

I, for one, don't like that first option because I either have to limit my shared folder to a specific directory or lose case insensitivity on my home folder (not happening).

The second option would be dependent on libvirt/qemu's openness to such behavior (which would certainly need to flaggable), implementing case folding (which will be annoying to get right), and then exposing the new flag in the XML of libvirt.

Specifically, I'm saying does it look to be something this project can not work around. I say this because it looks like the file name lookup request is done via a call to DeviceIoControl, which I suspect passes through a shim driver to qemu's virtio pci device.

Daniel-Trevitz avatar Jul 12 '22 17:07 Daniel-Trevitz

Enhancing QEMU\libvirt is possible. When having concrete proposal, we can discuss it on appropriate mailing lists. Looking at what Samba did - there is no generic solution, the behaviour is controlled by the configuration, but at least user is aware of expected behaviour.

YanVugenfirer avatar Jul 13 '22 12:07 YanVugenfirer

Enhancing QEMU\libvirt is possible. When having concrete proposal, we can discuss it on appropriate mailing lists.

@YanVugenfirer, What mail list do you recommend?

Daniel-Trevitz avatar Jul 13 '22 14:07 Daniel-Trevitz

virtio-fs: https://listman.redhat.com/mailman/listinfo/virtio-fs qemu-devel: https://lists.nongnu.org/mailman/listinfo/qemu-devel libvirt: https://listman.redhat.com/mailman/listinfo/libvir-list

YanVugenfirer avatar Jul 13 '22 15:07 YanVugenfirer

Encountered the same issue :( Cannot compile my Visual Studio projects because of this

vananasun avatar Oct 25 '22 13:10 vananasun

This has been addressed already in https://bugzilla.redhat.com/show_bug.cgi?id=2026299 .

Using a newer release from https://github.com/billziss-gh/winfsp/releases, in the Windows guest, open regedit, add HKEY_LOCAL_MACHINE\SOFTWARE\VirtIO-FS\CaseInsensitive as a DWORD with value 1 and restart the virtio-fs service or reboot.

Alternatively, the virtiofs binary can be started with -i.

Thanks, Daniel

dblueman avatar Feb 13 '23 12:02 dblueman

Solved by PR#832.

https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/VirtIO-FS:-Shared-file-system#options

YanVugenfirer avatar Feb 13 '23 13:02 YanVugenfirer

This has been addressed already in https://bugzilla.redhat.com/show_bug.cgi?id=2026299 .

Using a newer release from https://github.com/billziss-gh/winfsp/releases, in the Windows guest, open regedit, add HKEY_LOCAL_MACHINE\SOFTWARE\VirtIO-FS\CaseInsensitive as a DWORD with value 1 and restart the virtio-fs service or reboot.

Alternatively, the virtiofs binary can be started with -i.

Thanks, Daniel

Hello @dblueman. If I want to use multiple mount points mentioned in multiple-virtio-fs-instances, should I change the command to:

"C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" "-i -t %1 -m %2"

Not sure if I understand it correctly.

ZaberKo avatar Apr 11 '23 13:04 ZaberKo

If I want to use multiple mount points mentioned in multiple-virtio-fs-instances, should I change the command to:

"C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" "-i -t %1 -m %2"

Yes

viktor-prutyanov avatar Apr 12 '23 07:04 viktor-prutyanov