VirtioFS 1 million files limit on Windows Guests

PatQ123

New Member
May 21, 2023
3
0
1
Hi,
I am using virtiofs on Proxmox since 8.4 and configured it through the GUI. This works great and I have a few folders shared this way in a Windows11 Guest.
One of the folders started giving problems and got disconnected. After checking I am seeing that I am running into the 1 million files limit that is described here: https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1136 and extra info here: https://issues.redhat.com/browse/RHEL-56957

The solution would be to start the virtiofsd command with the --inode-file-handles=mandatory option.
Proxmox connects the virtiofsd service as soon as the WIN11 client start, but it does not use this option. When I check with ps -ef|grep virtiofsd I can see that the only arguments are:

Code:
/usr/libexec/virtiofsd --fd=18 --shared-dir=/mnt/photo --announce-submounts --syslog

Does anyone have any idea how I can get Proxmox to start the virtiofsd with the -inode-file-handles=mandatory option?

Thanks in advance!
 
Last edited:
Move the bin to different name:
mv /usr/libexec/virtiofsd /usr/libexec/virtiofsd.org

Create a script and do
chmod 755 /usr/libexec/virtiofsd
cat /usr/libexec/virtiofsd
#!/bin/bash
/usr/libexec/virtiofsd.org --inode-file-handles=mandatory "${@}"

PS: Save your script for next update and recover like
cp /usr/libexec/virtiofsd /usr/libexec/virtiofsd.script.save
 
Last edited:
  • Like
Reactions: PatQ123 and UdoB
Note that this is a really bad idea, next time virtiofsd is updated, your script will be overwritten or your update will notice and may fail, and you may continue running the old binary.

Better to just modify the startup script
systemctl edit <service>

Where <service> is the service you want to override (eg. virtiofsd).

That will create an override file where you can modify or amend the systemd ini file, said override file will stay in effect even through updates.

Although if you truly have that many files, Windows may fail your file system in other ways. A cursory look says that Windows is causing the Linux side to hit the ulimit on open files (Windows keeps files open), which yes, you can override or ignore but eventually you’ll still hit another form of resource exhaustion. Perhaps look into better data structures such as a database or Parquet file or do the job on a proper OS.
 
Last edited:
Thank you all for the tips. I will surely look into that and see if can split some folders/drives so the file count will go below 1 million.
 
Note that this is a really bad idea, next time virtiofsd is updated, your script will be overwritten or your update will notice and may fail, and you may continue running the old binary.

Better to just modify the startup script
systemctl edit <service>

Where <service> is the service you want to override (eg. virtiofsd).

That will create an override file where you can modify or amend the systemd ini file, said override file will stay in effect even through updates.

Although if you truly have that many files, Windows may fail your file system in other ways. A cursory look says that Windows is causing the Linux side to hit the ulimit on open files (Windows keeps files open), which yes, you can override or ignore but eventually you’ll still hit another form of resource exhaustion. Perhaps look into better data structures such as a database or Parquet file or do the job on a proper OS.
Virtiofsd doesn't seem to have a service though? Could be looking in the wrong location but systemctl edit virtiofsd finds no unit file. systemctl list-unit-files | grep virtio also doesn't return anything
 
Yes, this service should be seen more as an application which is started on demand (with corresponding arguments) which in case of pve is starting a communication channel to a virtual machine.
 
please file a bug, we could probably add an option for this..
 
  • Like
Reactions: waltar