Sharing a folder a windows guest under virt-manager

Sharing data between guest and host system is necessary in many scenarios. If the guest is a Linux system, you can simply add a shared folder that will be automatically mounted. However, this does not work if the guest is Windows. Sometimes, you can simply workaround it by using Samba shares, but in some scenarios network configuration makes it difficult. For example, when using usermode networking, the host machine can’t communicate easily via the network with the guest.

However, there is another way to share folders in virt-manager that actually works for Windows guest – SPICE . The first step is to configure the sharing in virt-manager. In the VM details view, click on “Add Hardware” and select a “Channel” device. Set the new device name to org.spice-space.webdav.0 and leave the other fields as-is.

Now start the guest machine and install spice-webdav on the guest machine. After installing spice-webdav make sure the “Spice webdav proxy” service is actually running (via services.msc).

Now running C:\Program File\SPICE webdavd\map-drive.bat will map the shared folder, which is by default ~/Public. If you encounter the following error

System error 67 has occurred.

the network name cannot be found

It means that the Spice webdav proxy service is not running.

If you want to change the shared folder, you will have to use virt-viewer instead of virt-manager, and configure it under File->Preferences.

8 thoughts on “Sharing a folder a windows guest under virt-manager

  1. pstrang

    I got this running with a linux virt-manager and windows guest.
    Seemed to be working, though extremely laggy while browsing directories.
    However, when I try to copy or access large files, say only 400-500 MB and larger, the windows guest errors out with a message to indicate the file size limit is exceeded.
    Really? Have you ran into this before?
    Thank you.

  2. Guy Post author

    I didn’t stress test it, so I didn’t run into large files problems. When I need to copy very large files back and forth, I usually just mount the disk image and work directly on it.

  3. pstrang

    I really like this concept, but it’s not ready for prime time….at least from my experience. It was far too laggy to be useful. For some of my windows-based applications, in order to access files over the share, I had to keep a windows explorer window open and continually refresh the shared folders. This would allow the application to access the files from a hang state. It would work for a few seconds, then I’d need to refresh again. Apparently, whatever file library the application used was not compatible with this share.

    I’ve abandoned this concept and run a local samba share. Orders of magnitude better performance (once I got the samba tricks figured out).

  4. mark999

    Didn’t work for me, seemed like the server process was crashing.

    A bit more googling got me to , which talks about sharing files between WSL linux and windows. Not terribly interesting for us… except that it says the sharing is done over 9p and mentions a 9p client.

    Once this update is out, I’m wondering if that 9p client (or server) would work for filesharing between linux hosts and windows guests.

    In the meantime, though, WSL got me thinking – how would I transfer files from one linux host to another? scp, of course! So I generated a key, added the pub component to my host’s authorized_keys, and now I can scp files around. The lack of gui could be an issue for some, but I’m quite happy with the command line myself.

  5. nesretep

    I am trying to find a way to share files between a linux host and a window7 VM that does require exposing the VM to my network. We are trying to keep it isolated from the greater network on purpose. This eliminates the samba method of sharing as far as I can tell. Any suggestions?

  6. pstrang

    This method would work without network, but it’s buggy/laggy. I switched to samba instead. But if you must remain off the network, then give this method a try.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.