===== KVM / QEMU Mount a host directory in a VM ===== With the VM shut down, open the VM settings (View Details), select "OS Information" on the list, change to XML and under ''2097152'' add\\ Apply the changes. Then add Hardware and select Filesystem\\ in the XML text set\\
KVM VMM will automatically assign parameters to the address line
If any other parameter than type="pci" is set, no auto-assignment is applied. Set to the directory you want to share on the host and to a name you use in the VM to mount it. Then, apply the changes. Start the VM. in the vm the directory can now be mounted (/mnt/shared must exist):\\ sudo mount -t virtiofs host_shared /mnt/shared To have the share mounted at boot add to /etc/fstab host_shared /mnt/shared virtiofs rw,relatime 0 0 If the vm should not be able to change files on the host, use ro instead of rw.