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.

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

  1. 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. 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. 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. Didn’t work for me, seemed like the server process was crashing.

    A bit more googling got me to https://blogs.msdn.microsoft.com/commandline/2019/02/15/whats-new-for-wsl-in-windows-10-version-1903/ , 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. 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. 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.

  7. Cant get it to working, “Spice webdav proxy service” wont start, with error: 1067
    Windows could not start the Spice webdav proxy service on local computer

  8. Unfortunately, when installing ‘Spice webdav’ an error occurs.
    As an alternative, I found a way to share a ‘host’ machine folder by logging in as a user with a password from the XP guest (guest ok = no). The registry must be modified as follows:
    [HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Lsa] “LmCompatibilityLevel” = dword: 00000001
    Also. deselect ‘USE SIMPLE SHARED USE OF FILES’ in ‘folder options’ tab ‘see’
    and put the machine in ‘WORKGROUP’
    Sorry, English is not my native language!
    Source:
    ‘https://bgstack15.wordpress.com/2017/10/01/samba-and-ntlm-for-windows-clients/’

  9. This post was promising but I too got the 1067 errors and could not get the service to start. The missing part of the puzzle for me was that the latest guest tools have to be installed on the windows guest also (https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe). The guest tools installed a lot of what I believe are the virtio drivers, so I think I got much more than necessary. But once installed the proxy service started. Then I was able to configure virt-viewer for share, and the map-drive.bat script mapped the shared folder to z:

  10. No such menu item as “Menu -> Preferences” under either the manager window or the VM config window. And under Edit -> Preferences, there’s nothing for editing the path to the shared directory. (and the version that comes with Linux Mint 19.x doesn’t have an XML edit window).

  11. First I got error 1067 too – turns out that I installed x86 spice-webdav instead x64. After changing it to valid version service starts properly.

    Then when I tried to run .bat, i encountered error 67 (with webdav proxy running!). Found out on github.com/lofyer/spice-webdav that firewall should be disabled. Can confirm, it fully works now.

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.