Feature request: Allow virtiofs --inode-file-handles=prefer to be enabled independently of VM ostype

kanemari

New Member
Aug 23, 2025
24
0
1
Environment

Proxmox VE 9.2.5
pve-qemu-kvm 11.0.2-2
qemu-server 9.2.1

VM uses virtiofs backed by CephFS:
Example generated virtiofsd command:

Code:
/usr/libexec/virtiofsd \
--fd=17 \
--shared-dir=/mnt/pve/cephfs-storage/backup \
--posix-acl \
--announce-submounts \
--syslog

Issue

virtiofsd has an option: --inode-file-handles=prefer which avoids keeping raw file descriptors open for inode tracking and prevents deleted-but-open inode accumulation during metadata-heavy workloads. This option is currently automatically enabled by Proxmox only when the VM ostype is detected as Windows.

Relevant code:

Code:
/usr/share/perl5/PVE/QemuServer/Virtiofs.pm

# See https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1136
my $prefer_inode_fh = PVE::QemuServer::Helpers::windows_version($conf->{ostype}) ? 1 : 0;

Problem case

There are valid Linux guest workloads which have the same filesystem access pattern as Windows guests.

Example:
  • Linux VM
  • virtiofs mount backed by CephFS
  • VM exports the mounted filesystem via Samba/CIFS to Windows clients
The Linux guest itself is not a Windows VM, so Proxmox does not enable --inode-file-handles=prefer. However, the workload is effectively Windows filesystem access:
  • heavy metadata operations
  • directory enumeration
  • stat-heavy workloads
  • retention/purge scans
This can cause virtiofsd to retain inode references longer than expected.

Changing ostype: l26 to ostype: win11 does enable the inode file handle behaviour, but it is not usable as Proxmox then applies Windows virtiofs restrictions and refuses configurations using ACLs:

Code:
TASK ERROR: Please disable ACLs for virtiofs on Windows VMs, otherwise the virtiofs shared directory cannot be mounted.

For Linux guests using CephFS and sharing via CIFS to windows clients, POSIX ACL support is required.

Therefore:
  • ostype=l26 → keeps ACLs but no inode file handles
  • ostype=win11 → enables inode file handles but breaks ACL requirements
There is currently no supported configuration that provides both.

Proposed change

Add an explicit virtiofs configuration option independent of guest OS detection.

For example:

Code:
virtiofs0: cephfs-storage-backup,inode-file-handles=prefer

or:

Code:
args: --inode-file-handles=prefer

but ideally as a first-class pve-qm-virtiofs property. The resulting logic would become:

prefer inode handles if:
guest is Windows
OR
user explicitly configured inode-file-handles=prefer

Current workaround

Manually modifying: /usr/share/perl5/PVE/QemuServer/Virtiofs.pm to force: my $prefer_inode_fh = 1; but this is not upgrade-safe.

Request

Please expose --inode-file-handles as a configurable virtiofs option instead of tying it exclusively to Windows guest detection. This would support Linux guests providing Windows-compatible file services (Samba/CIFS) without sacrificing POSIX ACL support.
 
this is interesting - only because I used virtiofs backed by ZFS for the last few years and never had any issues with too many files being open. Or if I did, there were never enough for it to cause any errors that I noticed. Whereas since moving to cephfs it has complained constantly about the MDS clients not releasing cache pressure - almost immediately after anything traverses my file system (mostly backup jobs), and troubleshooting led me to virtiofs holding too many open files even after they are not in use.

Either way, having more flexibility with enabling inode handles looks like a good thing - whether its considered as a bug or enhancement I dont mind.