Header Ads

Install Docker Desktop on Windows Drive D: and Fix WSL Errors

Docker is a key ingredient when you are working with a multiple Linux distributions, any cross platform tool installations or containers. Installing docker on windows seems a simple task. However, if not done properly then you might end-up having unknown errors in your docker tool.

Today, I shall be demonstrating installation of Docker Desktop app for Windows 10/11 machine on windows disk drive D: and also provide solution to fix unexpected error about Windows Subsystem for Linux (WSL) on docker desktop app.

 


Prerequisites:

Before proceeding any further in this article, following are some of the many prerequisites for this article:
  1. Enable Hyper-V.
  2. Enable Windows Subsystem for Linux.
  3. Download Docker Desktop for Windows.
  4. Knowledge of Windows Command Prompt.
Let's begin now.

1) If you do not properly install Docker Desktop app on windows then you might end-up having following error when opening Docker Desktop app i.e.



 
2) Make sure that Hyper-V and Windows Subsystem for Linux features are enabled on your machine along with installation of Linux Distro. I have installed Ubuntu 22.04 on my machine for this article i.e.
 
 

 

3) Open windows command prompt as administrator and type below command to update WSL i.e.

wsl --update --web-download



4) Next, use below command to verify the version of WSL installed distro. By default, you will see version 1 next to your WSL distro. i.e.

wsl.exe -l -v



5) For Docker Desktop app to work without WSL unexpected errors. The supported WSL distro version is 2. So, use below commands to update your WSL distro version to 2. Note that change "Ubuntu" to the name of your installed distro .EXE file  i.e.

wsl --set-default-version 2
wsl --set-version Ubuntu 2



6) Now, Download Docker Desktop Installer for windows to your target path and do not execute the file by double clicking. By default, Docker Desktop app will be installed into Drive C: which I do not recommend because it takes quite significant amount of disk storage space. So, if you install it on windows drive C: then your drive will quickly run out of space. I have placed my Docker Desktop Installer file on drive "D:\Dockers" folder.

7) Open windows command prompt as administrator again and change to your Docker Desktop Installer file path folder. Since, I have downloaded the file in "D:\Dockers" folder, so, below will be my commands to change into this directory i.e.


8) Now, type below command and hit enter. Make sure to change your target installation path, WSL default data path and windows container default path. The Docker Desktop app will be installed successfully on windows drive D: in my case. You can choose your target disk drive before executing below command. i.e.

start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir="D:\Program Files\Docker\Docker" --wsl-default-data-root="D:\Program Files\Docker\wsl" --windows-containers-default-data-root="D:\\Program Files\\Docker\\win"



9) Open Docker Desktop app and you will be able to see that Docker Desktop app is running successfully without any unexpected WSL errors. Go to settings -> Resources -> WSL Integrations. You will be able to see your installed WSL distro in the available list. You can activate that distro if you like. Note that when your WSL version is 1, you not only see errors within Docker Desktop app but your WSL distro will also not display under WSL integrations because Docker Desktop app only supports WSL version 2. i.e.




Conclusion

In this article, you will learn to install Docker Desktop app error free. You will also learn to fix WSL unexpected error that occur because of improper installation of the Docker Desktop app on windows and finally, you will learn to install the Docker Desktop app on your target windows disk drive which is drive D: in this article.


Video Demo