Share Folder Between Windows Guest and Linux Host in KVM using virtiofs


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.

Set up a mount tag in virt-manager

images/382-1.png

  <memoryBacking>
<source type="memfd"/>
<access mode="shared"/>
</memoryBacking>

images/382-2.png

<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<source dir="/home/debugpoint/Pictures"/>
<target dir="linux_pictures"/>
<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</filesystem>

Set up WinFSP – FUSE for Windows

images/382-3.png

Create VirtIO-FS as a service

images/382-4.png

images/382-5.png

sc create VirtioFsSvc binpath="C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" start=auto depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio FS Service"

sc start VirtioFsSvc

images/382-6.png

images/382-7.png

© https://www.debugpoint.com/kvm-share-folder-windows-guest/

Содержание