Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)


A note about virtiofs

The sharing files and folders are powered by the libvirt shared file system called virtiofs. It provides all the features and parameters to access the directory tree on the host machine. Since most of the virt-manager virtual machine configurations are translated to XML, the share files/folders can also be specified by the XML file.

Share folder in virt-manager

images/383-1.png

images/383-2.png

images/383-3.png

<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<binary path="/usr/libexec/virtiofsd"/>
<source dir="/home/debugpoint/Pictures/Screenshots"/>
<target dir="mount_tag_pictures"/>
<alias name="fs1"/>
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
</filesystem>

mkdir /mnt/pictures

mount -t virtiofs mount_tag_pictures /mnt/pictures

© https://www.debugpoint.com/share-folder-virt-manager/

Содержание