You are not logged in.
I need to synchronize a file between the host and guest machines so I set up a 9p shared directory and everything works fine. I set permissions to 666 and give ownership of the file I want to synchronize to my host user, my host user can write it, my guest user can read but every file the guest writes to is owned by libvirt-qemu and permissions are set to 400 so my regular user cannot access it. Is there a way to change this behavior using the configs or workarounds?
Not sure if this belongs in Newbie Corner, but the alternatives didn't suit this question either.
EDIT: I switched from virtio-9p to virtiofs and I don't have this problem anymore. Not a fix, but it works.
Last edited by UnluckyNinja (2022-07-08 01:08:35)
Offline
Not sure, if this helps, but these options worked for me:
Host:
qemu-system-x86_64 \
... \
-virtfs local,path=$HOME/some/host/path,mount_tag=SHARED_DIR_TAG,security_model=mapped-xattrGuest:
mount -t 9p -o version=9p2000.L,trans=virtio,msize=131072 SHARED_DIR_TAG $HOME/some/guest/pathOffline
Not sure, if this helps, but these options worked for me:
Host:
qemu-system-x86_64 \ ... \ -virtfs local,path=$HOME/some/host/path,mount_tag=SHARED_DIR_TAG,security_model=mapped-xattrGuest:
mount -t 9p -o version=9p2000.L,trans=virtio,msize=131072 SHARED_DIR_TAG $HOME/some/guest/path
What is this SHARED_DIR_TAG? Can this be used in the guest fstab?
Is this SHARED_DIR_TAG the alias? Like "fs0"?
Edit: Nevermind, SHARED_DIR_TAG must be the target dir option in virt-manager.
Last edited by UnluckyNinja (2022-07-07 19:57:56)
Offline
Not sure, if this helps, but these options worked for me:
Host:
qemu-system-x86_64 \ ... \ -virtfs local,path=$HOME/some/host/path,mount_tag=SHARED_DIR_TAG,security_model=mapped-xattrGuest:
mount -t 9p -o version=9p2000.L,trans=virtio,msize=131072 SHARED_DIR_TAG $HOME/some/guest/path
Tried it, but files created in the guest machine are still owned by libvirt-qemu.
Offline
What is this SHARED_DIR_TAG?
It's just a name you are free to choose.
I'm using qemu-system-x86_64 directly, without virt-manager.
I guess you could access the files, if you add your username to the group 'libvirt-qemu'. (Workaround)
Last edited by anick (2022-07-07 20:13:23)
Offline
What is this SHARED_DIR_TAG?
I guess you could access the files, if you add your username to the group 'libvirt-qemu'. (Workaround)
I thought about this but files generated by the guest machine do not have read or write access for group, only for the owner.
Offline