I have Docker Desktop running with WSL 2 backend. I also have Ubuntu 20.04 installed as my default WSL2 Linux distro.
The problem I am facing is that if I launch C:\Windows\System32\wsl.exe
when Docker is running then the shell is initialized with a very long directory path:
/mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1/mnt/c/Windows/System32
However, if I shutdown docker and start a WSL shell again, then it starts at the expected path: /mnt/c/Windows/System32
I can cd into /mnt/c myself but it is annoying that it doesn't start on the right path.
I also tried running wsl -d "Ubuntu-20.04
to no avail.
It seems that my C volume is mounted on both /mnt/c and the long ugly path above.
Has anyone experienced and resolved this issue?
Docker Version: 2.3.0.3 (45519)
To check whether Docker is installed properly or not, check the Docker version using this command docker --version . If you don't get an error like – bash: /usr/bin/docker: No such file or directory and see the Docker version then you know that Docker is installed successfully.
Docker Desktop for Windows provides a development environment for building, shipping, and running dockerized apps. By enabling the WSL 2 based engine, you can run both Linux and Windows containers in Docker Desktop on the same machine.
No you do not require Docker Desktop to use WSL 2. The only requirements for WSL 2 are that you: Have the right version of Windows installed. Have the Virtual Machine Platform and Windows Subsystem for Linux optional components installed.
In this approach, we will simply stop the Docker Desktop, move the space-eating directories to another drive having sufficient space, and finally creating symlinks. Step 1 - Stop Docker Desktop. Step 2 - Relocate the existing directories %USERPROFILE%\AppData\Local\Docker and C:\ProgramData\Docker to new directories.
It seems to work okay if I start Docker desktop first and then WSL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With