The missing mounted folder in Docker Desktop on WSL 2 is usually caused by stale file system caches, incorrect integration settings, or permission mismatches between the Windows host and the Linux guest. Resolving this requires verifying that the specific directory is correctly listed in the File Sharing settings, ensuring the WSL distribution is properly integrated with Docker, and restarting the relevant services to clear cached state.
Verify File Sharing Configuration
The most common cause for a mounted volume appearing empty or missing is that the host directory has not been explicitly granted access to the Docker daemon. Docker Desktop operates within a lightweight virtual machine (typically running Hyper-V or WSL 2 backend), and it does not have automatic read/write access to all folders on your Windows drive for security reasons. You must manually configure which directories are shared.
To fix this, open the Docker Desktop application from your system tray or start menu. Navigate to the Settings gear icon, located in the top-right corner of the main window. Select the Resources option from the left-hand sidebar, and then click on File Sharing. In the text input field, enter the exact path of the folder that is missing from your container mounts. For example, if you are trying to mount /c/Users/YourName/project, ensure that path is added to the list. Click Apply & Restart to save the changes. This action restarts the Docker engine and re-indexes the shared files, often resolving the visibility issue immediately.
Check WSL Integration Status
If the file sharing settings are correct but the folder remains inaccessible, the issue may lie with the WSL integration layer itself. Docker Desktop uses WSL 2 as its backend runtime, meaning it relies on specific Linux distributions to run containers. If the integration is disabled or corrupted, the container cannot see the host filesystem correctly.
Return to the Settings menu in Docker Desktop and select General. Ensure that the option Use the WSL 2 based engine is checked. Next, navigate to the Resources section again and select WSL Integration. Here, you will see a list of installed Linux distributions. Verify that the toggle switch next to your active distribution (such as Ubuntu-20.04 or Debian) is enabled. If it is already enabled, try toggling it off and then back on to reset the connection. After making any changes, click Apply & Restart.
It is also worth checking if multiple WSL instances are conflicting. Sometimes, an older or unused distribution can interfere with the primary one used by Docker. Ensure that only the necessary distributions are integrated. If you suspect the integration is broken beyond simple toggling, you can force a refresh by shutting down WSL entirely from the command prompt. Open PowerShell or Command Prompt and run the following command:
wsl --shutdown
This command terminates all running WSL 2 instances and clears the underlying VM state. Once executed, restart Docker Desktop. The application will automatically spin up a fresh WSL instance, which should rebuild the file system connections from scratch.
Inspect Permissions and Ownership
Even when paths are shared and integration is active, permission errors can manifest as "missing" folders if the container user lacks access rights. By default, Docker containers often run as the root user inside the container, but they map to a specific UID/GID on the host. If your Windows folder has restrictive NTFS permissions, or if the Linux side has strict ownership rules, the mount may appear empty.
Open your WSL terminal and check the permissions of the mounted directory using the ls -ld command. Compare this with the permissions on the Windows host. If you are using a custom user setup, ensure that the UID of the Linux user matches the permissions expected by the application inside the container. You can adjust permissions on the Windows side by right-clicking the folder, selecting Properties, going to the Security tab, and ensuring that the user account running Docker Desktop has Full Control. On the Linux side, you might need to use chown or chmod to align the ownership, though this is less common for standard development workflows.
Restart Docker Services Completely
Sometimes, the Docker daemon holds onto stale metadata about mounted volumes. A simple restart of the application might not be enough if the background services are hung. To perform a complete reset of the Docker environment, you can use the built-in troubleshooting tools.
In Docker Desktop, go to Settings > Troubleshoot. Click on Reset to bring up options like Reset to factory defaults or Clear DNS cache. While resetting to factory defaults is a nuclear option that deletes all images and containers, it is effective for persistent mounting issues. Alternatively, simply restarting the Docker Engine via the system tray context menu can help. Right-click the Docker whale icon, select Restart, and wait for the status indicator to turn green before checking your volumes again.
Frequently Asked Questions
Why does my volume show as empty instead of missing?
This typically indicates that the mount succeeded but the container user lacks permission to read the files, or the files are hidden due to case-sensitivity differences between Windows and Linux. Check the permissions on both the host and guest sides.
Can I share network drives instead of local folders?
Docker Desktop generally does not support sharing mapped network drives (like Z: drives) directly into containers due to performance and stability limitations. You should copy data to a local C: drive folder and share that instead.
How do I know which WSL distribution Docker is using?
You can check this by running docker info in your terminal. Look for the "Server Version" and "OSType" fields, or check the WSL Integration settings in Docker Desktop to see which distro is currently active and integrated.
Does disabling Hyper-V affect WSL 2 file sharing?
No, WSL 2 runs on a lightweight utility VM managed by the Hyper-V platform, but you do not need to manage Hyper-V directly. Disabling Hyper-V features in Windows might break WSL 2 entirely, so keep it enabled if you are using the WSL 2 backend.
What if the folder appears after a reboot but disappears again?
This suggests a caching issue or a service startup order problem. Ensure that Docker Desktop is set to start automatically with Windows, and consider adding a delay in your startup scripts if you are automating volume creation.