As one does with Vmware Desktop or Virtual Box, with KVM I’d like to create a shared folder where I can drop files between a Linux guest and my Fedora host without having to deal with scp
or file transfers. I understand I could also use nfs or sshfs, but I’d really like to try this with virtiofs as I had this working in Ubuntu in the past.
I am currently on Fedora 41 on an Intel i7 platform. I have previously been able to do this on an Ubuntu system, but I can’t get it to work on my Fedora box.
On the Host system (Fedora 41):
mkdir /home/user/vmshare
sudo chmod 777 /home/user/vmshare
sudo virsh edit fileserver
I add the following to the XML file:
<memoryBacking>
<source type="memfd"/>
<access mode="shared"/>
</memoryBacking>
Then, inside of the <devices>
tags, I add the mapping:
<filesystem type='mount' accessmode='passthrough'>
<driver type="virtiofs"/>
<source dir='/home/user/vmshare'/>
<target dir='/vmshare'/>
</filesystem>
Next, on the Guest VM:
sudo mkdir /vmshare
sudo mount -t virtiofs vmshare /vmshare
However, when I run the last mount command in the Guest, I get the below error message:
mount: vmshare: wrong fs type, bad option, bad superblock on vmshare, missing codepage or helper program, or other error.
Is there a step I’m missing? Is there perhaps some SELinux voodoo that needs to be down to allow this on a Fedora system?