Guide for using virtiofs to share a filesystem from a Linux host to a Windows guest.
No video guide
kyle is fat
This guide goes through setting up virtiofs to share files to a Windows guest. Also possible with Linux guests but this guide only covers Windows.
1: Configure in Virtual Machine Manager
2: Install required guest software
3: Install virtio sotrage drivers
4: Manually enable and start Virtio-FS Service
5: Mounting an existing folder to your shared folder
Enable Shared Memory and Apply
Go to Add Hardware > Filesystem Open XML tab and paste in this (You might have to enable XML Editing)
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs' queue='1024'/>
<source dir='/Path-to-Source'/>
<target dir='share-name-in-guest'/>
</filesystem>
Press Finish
Download and install virtio guest tools
latest download: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win-guest-tools.exe
You may need to reboot
Download and install WinFsp
latest download: https://github.com/billziss-gh/winfsp/releases/latest
!!!!ONLY IF You dont have virtio storage drivers already installed!!!!
If the drivers are already installed then skip to step 4
Download latest virtio-win ISO: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Mount ISO in Windows:
Open Device Manager > Other Devices > Right click 'Mass Storage Controller' > Update Driver
Click 'Browse my computer for drivers' then 'Browse'
Pick your mounted ISO and click OK
Windows should install drivers, click Close
(You might want to install drivers for any other virtio devices)
Open 'Run' (Windows Key + R) and run 'Services.msc'
Scroll down to 'Virtio-FS Service' > Open properties
Set 'Startup type' to Automatic and press 'Start' then 'Apply'
Reboot
You should be able to open your Host Z: drive in Windows
If you can't then make sure VirtIO-FS Services is running
This is useful for adding other filesystems that aren't already in your shared folder
mkdir NAME
sudo mount -o bind /SOURCE /DEST
UNMOUNT using
sudo umount /DEST
Warning that using this method and virtiofs is SLOW, you will NOT get high speeds
Speed comparison of a Gen 3 NVMe SSD to it passed through with virtiofs:
Sources:
https://www.reddit.com/r/VFIO/comments/wpw1bj/how_do_i_setup_file_sharing_between_my_hostarch/
https://www.mail-archive.com/[email protected]/msg02246.html
with help from insomdx#6835