Mounting Shared File System (directory) from KVM Host in Windows Guest
Original Source - Virtiofs Documentation / github Wiki
- Start by launching virt-manager
- Select your Virtual Machine
- You want to go to the View / Details sub section. Where you can add / edit hardware
- Go to the Memory Element and Check / Activate “Enable shared memory”
- Add a new Hardware , Type “Filesystem”, “Source Path” being the folder you want to share with your Windows Guest (eg: /home/user/sharing), “Target Path” being a Tag that you will use to identify it (eg: popos-sharing)
- Start your Windows Guest
- Install WinFSP, you need at least the Core Module - winfsp - GitHub page
- Install virtio-win-guest-tools, you need at least the viofs module - Fedora People - virtio direct downloads
- If you just want to share a single folder, you can just start the service and you're done (command: sc start VirtioFsSvc)
Mounting multiple directories on the same Guest
- Stop the VirtioFsSvc (command: sc stop VirtioFsSvc)
- Disable the Service from auto start (command: sc config VirtioFsSvc start=demand)
- Generate a configuration that is required with the following command. Remember to adapt to your virtiofs.exe location
"C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "<path to the binary>\virtiofs.exe" "-t %1 -m %2"
- Mount your folder with the following command:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsZ mount_tag0 Z:
Note 1: “viofsZ” letter and “Z:” must match. This is the letter that the drive will be mounted to.
Note 2: “popos-sharing” is the tag you used when adding the Filesystem (Target Path)
- Repeat for other folders you want / need.