Hello there, I'm trying virtiofsd from few weeks and I really like it, but I'm having a little problem.
I'm using it with Proxmox in a non standard configuration in my little home server with mdadm raid to pass a directory tree from the host to a guest virtual machine.
I know that my setup isn't officially supported but considering that there are others people here that are using virtiofsd I hope to receive a feedback. I have also opened an issue on virtiofsd gitlab but I'm not sure if my problem is virtiofsd or proxmox related.
What happens to me is that virtiofsd doesn't garant write access at users allowed by group permission.
In Proxmox I start virtiofsd with this configuration:
Code:
/usr/lib/kvm/virtiofsd --socket-path=/var/run/virtiofsd-data-VM1.sock -o source=/media/data/vm1/ -o cache=always -o debug
-chardev socket,id=char0,path=/var/run/virtiofsd-data-VM1.sock -device vhost-user-fs-pci,chardev=char0,tag=data -object memory-backend-memfd,id=mem,size=4096M,share=on -numa node,memdev=mem
In my Virtual machine I mount everything with fstab:
Code:
data /media/data virtiofs rw 0 2
At the moment my Virtual Machine is a Debian Buster with kernel from Backports:
Code:
$ uname -a
Linux debian 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux
But I also have tested the latest Ubuntu server with same result.
The problem is the following.
The source
/media/data/vm1/ passed from the host, in the guest becomes
/media/data and in it there is the following directories tree with the following permissions:
Code:
$ ls -la /media/data/
total 16
drwxrwxr-x 4 root root 4096 mag 30 17:15 .
drwxr-xr-x 4 root root 4096 apr 27 17:41 ..
drwxrwx--- 7 root users 4096 mag 30 17:14 Documents
drwxrwxr-x 6 root users 4096 lug 15 2019 www
but if I try to write something in /media/data/Documents with an user that is in the
users group I have a permission denied error:
Code:
$ touch /media/data/Documents/test.txt
touch: cannot touch ‘/media/data/Documents/test.txt’: Permission denied
obviously I don't have any problem in writing in ‘/media/data/Documents/’ with sudo and the strange thing is that also if I'm not able to write in the directory with my user, instead I'm able to read its content:
Code:
$ ls -la /media/data/Documents/
total 8
drwxrwx--- 7 root users 4096 mag 30 18:26 .
drwxrwxr-x 4 root root 4096 mag 30 17:15 ..
-rw-r--r-- 1 root root 0 mag 30 18:26 test2.txt
-rw-r--r-- 1 root root 0 mag 30 18:26 test3.txt
-rw-r--r-- 1 root root 0 mag 30 18:26 test.txt
The problem shouldn't be about my permissions, in fact if I copy ‘/media/’ with same permissions (cp -rp) outside the mount point provided by virtiofsd, for example in /tmp/media/data/Documents/, then everything works correctly and I'm able to write and read with the users in the users group.
I also noticed that if I change the ownership of /media/data/Documents from root:users to root:myuser then the user 'myuser' is able to write in that directory.
At the moment to solve this problem I had to change the permission of /media/data/Documents from 770 to 777 but this isn't a great solution. I have also discovered that if I change the permission from 777 to 776 I still have permission denied error If I try to write in the directory.
I also tried using a virtiofsd compiled from sources, from stable and dev branch but with same result.
I also tried using the virtio-fs device backend written in Rust, stil same problem.
Honestly seems strange to me that virtiofsd fails on a so important thing as group permission, so I'm thinking that this is caused by my fault.
Otherwise, could be a Proxmox related error? M'I doing some error?
Someone else that has using virtiofsd has noticed a similar problem?