Both guest and host are running Fedora 32 server edition, pretty much default no gui. From my laptop I connect with virt-manager with the server running Libvirtd. I added a filesystem mount in the guest, but the only mode available is mapped and squash. I expected to also see passthrough.
Any ideas how I can get passthrough available?
Works for me, tested on Fedora 33 host/guest and SELinux in permissive mode.
Thanks, but that doesn’t help.
Passthrough isn’t available, its not even in the list so I can’t select it and when I manually add it in XML, it still doesn’t work.
Still doesn’t work.
The option should be available from Virt-manager too, I’ve always had it there on other distro’s.
It works for me in CLI, just follow the instruction carefully.
If you want to report some missing option, file a bug properly.
I just tried it all again from scratch. Turned off the guest (virsh destroy), then virsh edit guest, virsh start guest.
All modules are loaded on the guest, I checked that with lsmod.
Selinux is temporarily in permissive mode on both guest and host.
The filesystem mounts, but with this config ( with passthrough), regardless of the permissions set from the host on the shared directory, I cannot write to it, and ‘touch filename’ gives a weird message, with or without sudo:
$ touch bla6
touch: setting times of 'bla6': No such file or directory
Maybe it does work but there is something else going on that I don’t understand?
I can now set the owner of the dir from the host to the uid/gid of the user on the guest and from the guest, delete the files that are there. However, I cannot create new ones even as root, it throws that error message above.
So maybe passthrough does work when configured this way, but something else is wrong?
Any ideas please?
You can create files from the same UID that the KVM/QEMU process is running under.
When the process is running in unprivileged mode, it has no rights to create files owned by other UIDs.
Sharing directories with virtual machines and libvirt
Thanks, appreciate your help.
Its running as root. I have not touched the settings in libvirt or qemu.
As far as I understand it from the official qemu docs on 9p setup, (I quote) passthrough, files are stored using the same credentials as they are created on the guest. This requires QEMU to run as root.
However, the behavior when configured in passthrough by editing the xml (virsh edit), suggests that its still in mapped mode. In mapped mode, the users’ uid and gid are stored as attributes and mapped to qemu:qemu. So the guest sees the uids and gids from the user that created them, but on the host they are listed as qemu:qemu.
So we are back to my original issue, passthrough mode does not seem to be available. If there’s anyone able to help me troubleshoot I would greatly appreciate it.