root@pve:/home/rngadam# apt install virtiofsd -y
root@pve:/home/rngadam# /usr/lib/kvm/virtiofsd --version
virtiofsd 1.10.1
follow instructions in https://gist.github.com/Drallas/7e4a6f6f36610eeb0bbb5d011c8ca0be
in proxmox
cd /var/lib/vz/snippets
curl https://raw.githubusercontent.com/Drallas/Virtio-fs-Hookscript/refs/heads/main/Script/virtiofs_hook.pl -o virtiofs_hook.pl
curl https://raw.githubusercontent.com/Drallas/Virtio-fs-Hookscript/refs/heads/main/Script/virtiofs_hook.conf
chmod u+x virtiofs_hook.pl
setup vmid 108 (example):
qm set 108 --hookscript local:snippets/virtiofs_hook.pl
qm start 108
systemctl status virtiofsd-108-media@108
in VM:
mkdir -p /media
mount -t virtiofs 108-media /media
in fstab:
108-media /media virtiofs nofail 0 2
Similar to how LXC bindmounts do mapping of uid from 100000 (on Proxmox host) to 0 (on VM_, we try to have mapping uid and gid, modify the systemd service.
Modify:
/etc/systemd/system/[email protected]
at the ExecStart line, append:
--uid-map :0:100000:65536: --gid-map :0:100000:65536:
then
systemctl daemon-reload
systemctl restart virtiofsd-108-media@108
but journalctl -u virtiofsd-108-media@108 shows:
Feb 10 19:31:35 pve virtiofsd[1389112]: [2025-02-11T00:31:35Z ERROR virtiofsd] Error entering sandbox: gid_map can only be used by unprivileged user where sandbox mod is namespace (Use '--sandbox namespace' instead)
Feb 10 19:31:35 pve systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Tried --sandbox namespace
with no changes