These instructions for sharing host files with a guest are not working because there is no /usr/bin/qemu-kvm.
5 Answers
You can not add a shared folder in virt-manager like it is described in your article because the filesystem passthrough doesn't work well with a windows guest.
To solve your problem you have several options:
- You can share a folder in the local network at your linux host system via SAMBA and access it over the windows filesystem directly.
- You can use
spice-webdavto share a folder like it is described in this article from Guy Rutenberg. This is not recommend for transferring large files. - If you only want to transfer data one or two times instead of having a permanent shared folder you can pack the data in your host system into a
.isofile and add it in virt-manager as a disc to access it in the windows guest system.
- 103
- 331
To save people time this is full steps to make it happned download spice-webdav from here this is latest build :-
https://www.spice-space.org/download/windows/spice-webdavd/spice-webdavd-x86-latest.msi https://www.spice-space.org/download/windows/spice-webdavd/spice-webdavd-x64-latest.msi
Install it in the guest machine (use Brasero to create iso file) , after install check if
Spice webdav proxy” service is actually running (via services.msc) reff
Inside the guest machine run C:\Program File\SPICE webdavd\map-drive.bat to map your host shared folder, which is by default ~/Public
- 133
It's easy to start ssh server on host linux, while it's easy to run ssh client on windows.
run systemctl start sshd on linux and then run winscp on guest: windows 7
- 151
For completeness, as @Salem F said, download the latest spice-webdav from https://www.spice-space.org/download/windows/spice-webdavd/
But before your run C:\Program File\SPICE webdavd\map-drive.bat you have to do a couple things:
- With the VM off, go the settings for the VM and Add Hardware
- Choose Channel, and set the new device name to
org.spice-space.webdav.0and leave the other fields as-is - Start your VM as you would with virt-manager
- Once running, run virt-viewer from your linux host (it should detect your running qemu VM), select your VM from the list, and connect to it.
- In your Windows VM, run services.msc
- Scroll down to Spice webdav proxy and double-click it, set Startup type to automatic, then click start (it would fail to start if I didn't first switch to virt-viewer from virt-manager).
- Now run
C:\Program File\SPICE webdavd\map-drive.batand you should see the drive letter appear in File Explorer
Here is a link to a past that helped: https://www.guyrutenberg.com/2018/10/25/sharing-a-folder-a-windows-guest-under-virt-manager/
- 143
- 7
Here is the built-in method for shared folder with virt-manager (like it is possible to do in VirtualBox), which has the advantage to only share the folder with the guest OS (unlike Samba which could be shared by default with other users on the same network) and is more secure than giving SSH access to the host OS from the guest OS: https://www.debugpoint.com/kvm-share-folder-windows-guest/
Summary, quoted from the website above (tested with a Windows 11 VM but it may work with a Windows 10 VM too):
Click on the icon which says show virtual hardware details in the toolbar. And then click on Memory on the left panel. Select the option “Enable shared memory“. Click Apply.
Click “Add hardware” at the bottom. Select File system from the left panel in the add new hardware window. Then select Driver=virtiofs in the details tab. Click on browse > browse local and select the host path from your Linux system. In the target path, mention any name you want.
Set up WinFSP – FUSE for Windows: https://github.com/winfsp/winfsp/releases/
Download the virtio-win-guest-tools.exe from the below path by going inside stable-virtio folder: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
After installation is complete, reboot Windows virtual machine.
Open the start menu and search for “Services”. Scroll down to find out the “VirtIO-FS Service”. Right-click and hit Start to start the service.
After the service start, open Explorer, and you should see the mount tag which you have created in the first step above, which should be mapped as Z drive.
- 527