How to Install Docker Desktop on Windows 10 with WSL2 and Configure Image Accelerators
This guide walks you through installing Docker Desktop on Windows 10 using WSL2, handling common startup errors, migrating Docker image storage to another drive, and configuring domestic image accelerators to improve pull speeds, all with step‑by‑step commands and screenshots.
When developing, you often need middleware such as Redis, MongoDB, or Elasticsearch, which traditionally requires manual download, installation, and configuration; using Docker simplifies this process to a few commands.
Linux installation of Docker is straightforward; this article focuses on installing Docker Desktop on Windows 10 with WSL2.
Installation Process
Version Requirements
Docker Desktop for Windows with WSL2 requires Windows 10 64‑bit Home or Pro version 2004 (build 19041) or higher, or Enterprise/Education version 1909 (build 18363) or higher.
If your system is not up to date, use Windows Update or the Microsoft "Easy Upgrade" tool.
Installation Steps
Download and install Docker Desktop from https://docs.docker.com/desktop/windows/install/ .
Download the Linux kernel update package from https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi and install it.
Set WSL 2 as the default version by running in PowerShell: wsl --set-default-version 2
Startup Exception: System.InvalidOperationException
If Docker Desktop fails to start, you may see the following error:
System.InvalidOperationException
Failed to set version to docker-desktop: exit code: -1The PowerShell command wsl may also report "The referenced object type does not support the attempted operation."
Solution
Download NoLsp.exe from http://www.proxifier.com/tmp/Test20200228/NoLsp.exe (VPN may be required) and place it in C:\Windows\System32 or another preferred location.
Run the following command with administrator rights: NoLsp.exe C:\Windows\System32\wsl.exe Success!
Restart WSL and Docker Desktop, then test with: docker run -d -p 80:80 docker/getting-started
Access http://localhost/ in a browser; the welcome page indicates a successful installation.
Configure Image Accelerators
Docker Hub can be slow in China. Configure a domestic mirror by editing the Docker Engine JSON in Settings → Docker Engine and adding a registry-mirrors array, for example:
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]After saving, restart Docker Desktop and verify the mirrors with docker info .
Image Storage Location Migration
By default Docker stores data on the C: drive. To move it to another drive while preserving images:
Quit Docker Desktop.
Export the current data: wsl --export docker-desktop-data "E:\docker-desktop-data.tar"
Unregister the existing distro: wsl --unregister docker-desktop-data
Import the exported data to the new location (e.g., E:\docker\wsl ) with WSL 2: wsl --import docker-desktop-data "E:\docker\wsl" "E:\docker-desktop-data.tar" --version 2
Start Docker Desktop and verify the new storage path.
Conclusion
After following these steps, Docker Desktop is fully installed on Windows, configured with a fast mirror, and its image storage migrated to a larger drive, ready for you to enjoy the benefits of containerization.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.