'Docker not starting on Windows 11 with WSL 2
I'm trying to setup docker with WSL 2 to run a Dockerfile. I downloaded Docker Desktop, and when I tried to follow the quick start guide, I got the following error:
docker: error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%d2Fdocker_engine/v1.24/containers/create?name=repo": open //./pipe/docker_enginer: The system cannot find the file specified.
I set com.docker.service to run in the Task Manager, and have run:
“c:\Program Files\Docker\Docker\DockerCli.exe” -SwitchDaemon
I have also quit Docker Desktop and reopened it in admin mode, and I still get the message that Docker Desktop has stopped.
Please let me know if there's any other options, thanks!
Solution 1:[1]
If you are running Docker Desktop for Windows 4.5.0 then you should be aware of an existing issue where the default backend selected after installing is not the correct one.
You can switch to the correct backend manually by editing the file located at: %APPDATA%\Docker\settings.json
(sometimes is %APPDATA%\Roaming\Docker\settings.json
) and at the bottom of the file change the value for the wslEngineEnabled
field to true
. After that Docker Desktop should start correctly.
Similar issue and solution is mentioned here by the user mccaa25.
Solution 2:[2]
latest version 4.5.0 It won't work for me too, for me downgrade to 4.4.4 it worked. It may be problem with the latest version
for released note and older version Here
Note: You can install an older version and update to latest version 4.5.0
Solution 3:[3]
Wow! I spent multiple days trying to get Docker for windows 11 to work. What finally did it was downgrading to version 4.4.4 as @GinglrBell recommended. Here's a link Docker version 4.4.4.
Make sure WSL is installed and virtualization is enabled. If you try to open WSL and you get an error telling you to enable virtualization in BIOS, run this command as Admin in powershell: bcdedit /set hypervisorlaunchtype auto
(Docker src). Then restart your PC.
Solution 4:[4]
I managed to solve the problem in this way:
- delete config file
AppData/Roaming/Docker/settings.json
- start Docker Desktop (it will create new default settings.json)
You need to re-configure settings, so it is also good idea to save the old settings.json and compare settings with the new one.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | IsaacCisneros |
Solution 2 | |
Solution 3 | |
Solution 4 | Janne Rantala |