I'm trying to figure out how to properly mount external drives in Docker Desktop on my two Windows PCs. My main machine is a Windows 10 PC, and I also have a Windows 11 Dell Optiplex 7070 where Docker Desktop is installed. Both PCs use the same username and password, and I've ensured they have the same access and permissions to external drives.
I have multiple external drives connected to my Windows 10 PC which I share with my Windows 11 PC, and I want to mount these drive paths into various Docker containers.
Here's where I'm stuck: when I use WSL2 as my backend, I can't access the Docker containers from my daily PC, even though both PCs are connected to the same network. As a result, I've switched to using Hyper-V to access the Docker containers remotely, but I'm aware this might be an obsolete setup in the future.
I've encountered a lot of frustration with mounting external drives. I created a batch file with net use commands that runs at startup to establish persistent connections to the drives before Docker starts, but I still can't get the containers to access any of the data stored on these drives.
I've tried different mount paths, like:
1. /host_mnt/driveletter/folder
2. /mnt/driveletter/folder
3. //pcname/share
While /mnt/driveletter/folder works fine for local files, the containers still can't access the files in those mounted volumes. File Sharing is successful for local paths, but not for external ones. For instance, I can't access a music folder on a shared drive letter D: using combinations like /mnt/D/music, /host_mnt/D/music, and many others.
I can't switch to WSL2 since that would cut off my access to containers from my main PC, and I can't move to Linux either since this PC is my only Windows 11 machine. I'm hoping to keep it that way while I look for a new gaming PC later on.
Is there a viable way to achieve this setup? Or am I possibly chasing something that's not feasible? I'm not necessarily looking for direct answers, just some guidance from anyone who has been through this before. Thanks!
3 Answers
I feel you on this one—mounting drives in Docker for Windows can be a headache! You've done well by using `net use` and having it run at startup. I’ve read that for external drives, making sure they’re mounted under the correct path is essential.
Also, when using WSL2, remember to run Docker commands from the WSL terminal and not from PowerShell to ensure you're using the right path syntax. If you have spaces in your file or folder names, wrap the path in quotes when running docker commands.
It sounds like a tricky setup, for sure! I've had similar issues with WSL2 not allowing access from remote PCs. It's like it isolates everything to just the host machine, so I get where you're coming from with wanting to use Hyper-V instead.
As for mounting drives, I recommend sticking with one method to keep it simple—like using the `/mnt/driveletter/folder`. Just make sure the drives are consistently connected when Docker is starting, and check if your Windows permissions are set to allow Docker access. Sometimes, issues with file sharing arise from access rights on Windows, especially with NTFS drives.
Don't forget to check the Docker Desktop settings to confirm your shared drives are included there too! That's been a common spot people seem to overlook.
Totally agree! I had to toggle those settings a few times before everything synced up. Sometimes Windows can just get finicky with permissions.
Mounting issues can definitely drive you up the wall! I had a similar experience, and what worked for me was using shared folders in VMware instead of Docker Desktop. It's a bit of a different approach, but it could make accessing files easier without the same restrictions that WSL2 has.
With VMware, you can directly connect your USB drives, but remember that it locks them out from Windows while they’re mounted to the VM. Just a thought! Maybe give VMware a try if you need that direct access and don't mind a bit of initial setup.
I hadn’t considered VMware before—thanks for the suggestion! I’ll definitely look into that as an alternative if the drive mounting continues to be problematic.

Exactly! I've made that mistake before, thinking I could run Docker commands from PowerShell without realizing it uses different path formats. It's those little things that can throw everything off.