Hello everyone,
I’m facing a critical issue where my Docker containers (specifically Radarr, Sonarr, etc.) running via Docker Desktop on Windows cannot access files on my local C: drive. What’s more concerning is that the underlying WSL 2 distribution itself also cannot see these files, despite Windows File Explorer confirming their existence. I’ve tried nearly every troubleshooting step imaginable, including full reinstalls, and I’m at my wit’s end.
My Setup
- Operating System: Windows 11 (OS Build 10.0.22631.5335)
- Docker Desktop Version: 4.41.2
- WSL Version: 2.5.7.0
- Kernel Version: 6.6.87.1-1
- WSLg Version: 1.0.66
- MSRDC Version: 1.2.6074
- Direct3D Version: 1.611.1-81528511
- DXCore Version: 10.0.26100.1-240331-1435.ge-release
- WSL 2 Backend: Yes, Docker Desktop is configured to use the WSL 2 engine.
The Problem
I’m using Docker Compose with bind mounts for my media stack. Example from docker-compose.yml:
volumes:
- C:\data\media\movies:/data/movies
- When I run
docker exec radarr ls -l /data/moviesinside the container, it consistently showstotal 0(i.e., the directory appears empty). - Crucially, when I go directly into the
docker-desktopWSL 2 shell (wsl -d docker-desktop) and runls -l /mnt/c/data/media/movies, it also showstotal 0or, if I try to list specific content likels -l "/mnt/c/data/media/movies/The Man (2005)", it saysNo such file or directory. - To rule out issues with specific paths, I created a simple folder
C:\WSL_TEST\SUB_FOLDERdirectly on myC:drive, confirmed its existence in Windows File Explorer, butls -l /mnt/c/WSL_TESTfrom within thedocker-desktopWSL 2 shell still returnsNo such file or directory.
Repro Steps
- Initial Setup (What should happen on a fresh system):
- Install Windows Subsystem for Linux (WSL 2).
- Install Docker Desktop for Windows, configured to use the WSL 2 backend.
- Create a simple directory on the Windows
C:drive, e.g.,C:\WSL_TEST, and place an empty subfolderC:\WSL_TEST\SUB_FOLDERinside it. - Create another directory, e.g.,
C:\data\media\movies, and place some files/folders inside it (or leave empty for testingtotal 0). - Create a
docker-compose.ymlfile (e.g.,C:\docker-compose\test-app\docker-compose.yml) that includes a service with a bind mount to a Windows path, e.g.:
services:
testapp:
image: alpine/git
container_name: test_app
command: sh -c "ls -l /data/movies && tail -f /dev/null"
volumes:
- C:\data\media\movies:/data/movies
- To Reproduce the Bug (What I experience):
- After the setup, from a PowerShell window, enter the
docker-desktopWSL 2 shell:wsl -d docker-desktop. - Attempt to list the contents of any
C:drive folder:ls -l /mnt/c/WSL_TESTls -l /mnt/c/data/media/movies
- From PowerShell, in the
docker-composedirectory:docker compose up -d. - Then,
docker exec test_app ls -l /data/movies.
- Exhaustive Troubleshooting Already Performed (No change in behaviour after each step):
- Verified
docker-compose.ymlbind mount syntax. - Applied
chmod -R 777andchown -R 1000:1000toC:\data(via/mnt/c/data) from within WSL 2. - Performed
docker compose downthendocker compose up -d. - Quit and restarted Docker Desktop application via system tray.
- Ran
wsl --terminate docker-desktopin PowerShell, then restarted Docker Desktop. - WSL 2 Distribution Hard Reset:
- Ran
wsl --unregister docker-desktopin PowerShell. - Quit Docker Desktop.
- Rebooted PC.
- Launched Docker Desktop (which implicitly re-created the
docker-desktopWSL VM).
- Ran
- Full WSL 2 Platform Reinstallation:
- Quit Docker Desktop.
- Unregistered all WSL 2 distributions (
wsl --unregister docker-desktop). - Unticked “Virtual Machine Platform” and “Windows Subsystem for Linux” in “Turn Windows features on or off”.
- Rebooted PC.
- Ran
wsl --installin PowerShell (Admin). - Rebooted PC again (as prompted by
wsl --install). - Ran
wsl --updateandwsl --shutdownin PowerShell (Admin).
- Docker Desktop Clean Reinstallation:
- Uninstalled Docker Desktop via “Apps and Features”.
- Rebooted PC.
- Downloaded the latest Docker Desktop installer and performed a fresh installation.
- Confirmed: Checked Antivirus/Security Software (e.g., temporary disable, exclusions applied where possible).
- Confirmed: Ran
chkdsk C: /f /ron the C: drive (with reboot).
Expected Behavior
What were you expecting to see? Include any relevant examples or documentation links.
- When running
ls -l /mnt/c/WSL_TESTorls -l /mnt/c/data/media/moviesfrom within thedocker-desktopWSL 2 shell, I expect to see the actual contents of those folders as they appear in Windows File Explorer (e.g., listingSUB_FOLDERinsideWSL_TEST, or my movie files/folders insidemovies). - The
docker compose up -dcommand should start thetest_appcontainer successfully. docker exec test_app ls -l /data/moviesshould list the contents of theC:\data/media/moviesfolder as seen from the container’s perspective.
Actual Behavior
What happened instead?
- From the
docker-desktopWSL 2 shell:
ls -l /mnt/c/WSL_TESTconsistently returnsls: /mnt/c/WSL_TEST: No such file or directory.ls -l /mnt/c/data/media/moviesconsistently returnstotal 0(if the directory is empty) orls: /mnt/c/data/media/movies: No such file or directory(if trying to list specific known contents).
- Windows File Explorer unequivocally shows that
C:\WSL_TEST,C:\WSL_TEST\SUB_FOLDER, andC:\data\media\movies(with its contents) all exist and are accessible from Windows. - Docker containers using bind mounts to these paths (e.g.,
/data/movies) consistently see them as empty or inaccessible, leading to applications like Radarr failing to find media.
Diagnostic Logs
As I am unable to generate these logs directly, please provide guidance on which specific logs would be most helpful given the nature of this issue (e.g., WSL 2 kernel logs, 9p diagnostics, or specific Docker Desktop logs related to drive mounting). I am happy to collect them if instructed.