I have a folder /common
on an Ubuntu Server 22 host which is RW accessible by all users in group users
i.e. user alice
(with uid 1000
) is a member of users
(with gid 12345
) and has fuull RW access to /common
on the host.
On a KVM (also Ubuntu Server 22) on that host, I have the same user alice
and group users
with the same uid
and gid
respectively. The subuid and subgid (read from cat /etc/subuid
and cat /etc/subgid
) are different on both host and KVM.
I am sharing this folder from the Host to the KVM via virtiofs with the mount tag common-mount
, using this entry in /etc/fstab
:
common-mount /common virtiofs defaults 0 0
followed by sudo mount -a
to mount the folder
However the mounted folder /common
on that KVM is read-only to KVM user alice
despite having the same uid and belonging to users
. If I chmod 777
the folder /common
on the host, that becomes accessible on the KVM, but I need chmod 775
for group RW-access and security.
Based on this link https://libvirt.org/kbase/virtiofs.html the differing subuid and subgid might be behind the issue, but when I made attempts to map them using idmap, the KVM became unbootable. If this relates to the solution, I am uncertain of the correct syntax.