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.

20 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.

  12. jrv Said the missing part of the puzzle for him was figuring out that the guest tools had to be installed on the client. It’s the opposite problem for me. Apparently there are tools that need to be installed on the host. Could someone tell me what those tools are (for Ubuntu 20.04 x64) ? BTW, the map-drive.bat file worked perfectly for me in my Win7 guest and the Spice webdav proxy service is running in services.msc.

  13. Hi,

    I did the part where I need to select “spice-space.webdav in qemu but in the guest the only Spice folder is “Spice Agent” and the two files inside that are “vdagent” and “vdservice”.

  14. Hi, thank you but this is just not working for me.
    Host: Archlinux x64
    Guest: Windows 10 x64

    I got the 67 error in Windows, even with the proxy service running.

  15. With me it did not work too, but no 1067 error.
    I did use Debian 11 and Windows10 32bit (because it uses less memory), and the software like Qemu and Virtmanager are coming from Debian.
    Spice webdav proxy service seems to start, but stops after some time.

  16. I got strange case – running the viewer I have running Win7 session. Calling the viewer to show active sessions I got nothing running!!! What’s wrong? I just want to have a folder that is shared between my Linux and Win7 working as a guest in QEMU/KVM
    https://i.imgur.com/CzjFQua.png
    So far nothing works.

  17. I finally managed to get the shared folder working by the combined help from a couple of posts here.

    At first I got the 1067 error – but I actually had to go into Services and try to start it to see the error. This I fixed by installing guest tools (was a bit nervous about that one since I’m running gpu passthrough and didn’t want the virtual drivers to take over from my nvidia drivers and mess thing up)

    Then I went about running the the shell script which did nothing – neither as a normal user or choosing to run it as administrator. Didn’t even get an error.

    Finally I tried opening virt-viewer (as described in another post) and discovered that I actually had to tick a box to share the folder “public”.

    Now everything seems to be working like it should.

    Also – for you who suffer from the size limit when moving larger files between your OS’s – try this one:
    https://answers.microsoft.com/en-us/ie/forum/all/error-0x800700df-the-file-size-exceeds-the-limit/d208bba6-920c-4639-bd45-f345f462934f

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.