Martin Kletzander via Users wrote:
What libvirt does is not only access the file, but also change the permissions on the image files in order to allow QEMU access to them.
Hi Marin, thanks for the reply. I made sure that the user has rw permissions also on the mounted directory, not just the files. The problem remains, the file system is mounted with the "wrong" uid on the libvirt host.
I am not sure how CIFS/samba works WRT permissions, but I remember lot of issues with NFS. On the other hand I also know most of the NFS issues are already solved.
Is this somewhere written down? When I was experimenting with NFS (v4.2) for this setup, I had to solve a lot of issues and make sure UID and GID of the files were carefully synchronised between NFS server and libvirt host, and still would not be able to launch a VM using an image from the network fs pool. That was my reason to try CIFS next, as there you have a better separation of user IDs between CIFS server and client.
So as root, can you change the permissions to libvirt-qemu and then access it as the libvirt-qemu user?
If I understand you correctly, you suggest to start the filesystem pool from virsh, then change the owner of the (mounted) files to libvirt-qemu, and then start the VM? This does not work, unfortunately. I can run the chown command recursively on the mounted filesystem, but after the command completes, the files are still owned by root:root, i.e. the user that mounted the drive. I made sure that the mount point is owned by libvirt-qemu before starting the pool, but that also does not make any difference. What I would like to have is some meachanism that would allow me to specify the uid=libvirt-qemu and gid=libvirt-qemu mount options for the CIFS drive, but was not able to, as described in the previous post. Thanks, Thomas