Docker Community Forums

Share and learn in the Docker community.

Volumes/bind mounts of windows directories appears to be broken in docker desktop wsl2 integration

In short, when I try to use a Windows directory as a volume or bind mount in WSL 2 with Docker Desktop integration, it just mounts an empty directory instead of the source directory. I do not see this issue in WSL 1.

Full issue description is at https://github.com/docker/for-win/issues/7905.

Has anyone else seen anything like this, or have any ideas for a solution or workaround?

  • Issue Type: Bug
  • OS Version/build: Windows 10 20.04 OS Build 19041.388
  • App Version: Docker Desktop Version 2.2.0.5 (43884) stable
  • Steps to reproduce: docker run -it --rm -v /c/Users/jamesk/Documents/temp:/data ubuntu:bionic

You are far behind the current version. Install the most recent version from stable or from edge channel and try again.

I just updated to the latest version of Docker Desktop (2.3.0.4 (46911) stable), and am still experiencing the same behavior.

Do you have a firewall installed that blocks the traffic to WSL?

I do not have a firewall installed in my WSL 2 Ubuntu distro, but Windows Firewall is up. I wasn’t aware previously but doing some searching it looks like the way Windows files are shared with WSL2 is via a Plan 9 fileshare, which is apparently a network protocol. So I guess it is plausible that Windows Firewall may be blocking that, thanks for the suggestion @tekki . What I can’t find in some quick google searches is how to enable the traffic (i.e. which ports to allow). I would just turn off the firewall temporarily to see if that fixed it, but that appears to be blocked by group policy so I’d have to get someone in IT to help me with that. Short of that, does anyone know what ports for which I can try adding allow rules to the firewall to try to get this to work? Also, would it be expected to immediately start working once firewall rules are added or the firewall is turned off, or would I need to restart WSL and/or Docker Desktop to get any handshakes done to establish the connection once it was unblocked?

I just got IT to disable the firewall entirely, and restarted WSL and Docker Desktop to be sure that any connections/initialization that would need to be done by the Plan 9 fileshare would be done without any potential interference from a firewall, but am still seeing the same behavior, it just mounts an empty directory when I do the docker run command from WSL 2.