Possible issue with shared folder from host to virtual machine

I ran into an issue when trying to connect a shared folder from my host to my virtual OS in KVM. The folder actually does appear in the virtual OS, but it's empty, unlike the folder in the host which has files in it. I'm not ruling out the possibility that I configured something wrong, but the instructions on setting it up seemed to be pretty straightforward. Basically I did the following procedures: mkdir ~/shared chmod 777 ~/shared Went to VirtManager enabled shared memory, added FileSystem with driver virtiofs. My source path to find the folder was /home/username/shared and the target path was /mnt/shared. Upon booting the virtual machine everything seemed to work. I found the folder where it should be, only there was nothing in it. And on the host there was files I had already placed in the folder. So this is where I'm at now.

On 3 Sep 2024 15:05 -0000, from users@lists.libvirt.org (Mulloch94--- via Users):
mkdir ~/shared
chmod 777 ~/shared
Went to VirtManager enabled shared memory, added FileSystem with driver virtiofs. My source path to find the folder was /home/username/shared and the target path was /mnt/shared.
Upon booting the virtual machine everything seemed to work. I found the folder where it should be, only there was nothing in it. And on the host there was files I had already placed in the folder. So this is where I'm at now.
I'm not certain, but I wouldn't be the least bit surprised if there is a permissions issue at play here. Yes, you set the specific directory to 0777; but that says nothing about ~ or any of its parent directories. Try placing one in some world-readable location; say, /tmp/shared; share that into the VM; and see if you get different results. And while the VM is running, try placing something in it which you can look for outside the VM. Is the directory writable from within the VM? Also, is that VM inside your user session or the system session? -- Michael Kjörling 🔗 https://michael.kjorling.se “Remember when, on the Internet, nobody cared that you were a dog?”
participants (2)
-
Michael Kjörling
-
Mulloch94@protonmail.com