Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 944
Axiom Avatar asked Aug 31 '25 15:08

Axiom


2 Answers

I managed to solve the problem in this way:

  1. delete config file AppData/Roaming/Docker/settings.json
  2. 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.

like image 67
Janne Rantala Avatar answered Sep 06 '25 17:09

Janne Rantala


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 (full path: C:\Users\%UserName%\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.

like image 34
sudo Avatar answered Sep 06 '25 15:09

sudo