"wsl": executable file not found in %PATH%, So Docker Desktop is shutting down

I installed and ran Docker Desktop, and the following message welcomed me:

Doker failed to initialize
Docker Desktop is shutting down

Realizing something was wrong, I started to google it. I checked if hyper-V and virtualization were available. It wasn’t a problem. I tried uninstalling the program, rebooting the computer, reinstalling it, erasing the setting.json file, erasing the .docker file, and trying a different version, but it didn’t help me at all.

When I looked closely, there was a way to test if there was anything wrong with the execution process through com.docker.diagnose.exe, and I tried it. As a result, the following message was printed:

and I looked at the log file to find out where the problem occurred. It said:

[2022-08-09T14:23:01.923438000Z][GUI               ][Info   ] Starting...
[2022-08-09T14:23:02.056345300Z][GUI               ][Info   ] An instance is already running. Launching the container view.
[2022-08-09T14:23:02.086018500Z][GUI               ][Warning] Launching the dashboard failed: Operation timed out.
[2022-08-09T14:23:02.094019300Z][GUI               ][Error  ] System.Exception:
Docker Desktop is shutting down.
   Location: Docker.Program.LaunchFrontend(Logger logger) file C:\workspaces\main-merges\src\github.com\docker\pinata\win\src\Docker.Desktop\Program.cs:줄 285
   Location: Docker.Program.Run(IReadOnlyCollection`1 args) file C:\workspaces\main-merges\src\github.com\docker\pinata\win\src\Docker.Desktop\Program.cs:줄 192
[2022-08-09T14:23:03.796920600Z][GoBackendClient   ][Warning] HttpOS Client: connection timed out.
[2022-08-09T14:23:03.798763100Z][SettingsLoader    ][Warning] Failed to fetch settings from backend, retrying in 1 sec
[2022-08-09T14:23:04.109909200Z][IPCClient         ][Info   ] (1385a48d) 66ac4492-GoBackendClient-CSharp C->S BackendAPI GET /ping
[2022-08-09T14:23:05.726925600Z][GoBackendProcess  ][Error  ] Auto restarting $C:\Program Files\Docker\Docker\resources\com.docker.backend.exe -addr unix:\\.\pipe\dockerBackendApiServer -native-api

In summary, “wsl”: executable file not found in %PATH% appears to be the root cause.
But … I don’t know what that means. Is the docker not installed because of the wrong PATH environment variable? Or is the file running wsl in the wrong path? How do I fix this error?

I know that posting to a community like this isn’t always a way to solve a problem, but no matter how much you google it, you don’t get a similar case. It’s so hard to solve this problem on my own. I’ve been tied to this issue for almost a month. I’ll keep trying, but I’d like to ask for a little advice from others.
If you know about this, give me a little hint. I would be very grateful if you could do so.
Thanks for reading this long post :slight_smile:

Have you checked the requirements?

You can use the Hyper-V backend or the WSL2 backend. Your error message indicates you tried to install Docker Desktop using the WSL backend but WSL is not installed.

Thank you for your advice. But my problem continues. As you said, it seems that wsl is not installed on my computer. com.docker.diagnose.exe check also says as below.

[FAIL] DD0024: is WSL installed? exec: "wsl": executable file not found in %PATH%

So I read the document you recommended and installed wsl_update_x64 and Ubuntu-22.04. It ordered to install wsl with the ‘wsl --install’ command, but because it didn’t work for me, I downloaded Ubuntu 22.04 LTS from the Microsoft store. I was able to confirm that the program was probably installed normally.

PS C:\Windows\system32> .\wsl -l -v
NAME     STATE  VERSION
Ubuntu-22.04 Stopped 2

But problems continue to arise. Is this what the document explains? Actually, I didn’t reveal it above, but I’ve installed and used Docker Desktop once before. At that time, I could just run it without having to install it separately for wsl.
I think I need to read the document carefully and think more about what I should do. I would appreciate it if you could let me know if there is anything I misunderstood and performed.
Thank you.

When you installed Docker Desktop before, it is possible that you used the Hyper-V backend.

I am not sure what explaining you mean, but have you checked the logs again to see if the error message is the same?

My Docker keeps saying “wsl”: executable file not found in %!P(MISSING)ATH%!(NOVERB) When I run it, the notification Docker failed to initialize, Docker Desktop is shutting down is the same as before.

But the only difference is
“[FAIL] DD0001: is the application running? Docker is not running.”
“[PASS] DD0001: is the application running?”

This is the result of my docker check. Some of the log parts have been omitted, and the rest are the same as before wsl was installed.

Thank you for your continued help. If you are busy, I can understand even if you can’t reply.

[PASS] DD0027: is there available disk space on the host?
[SKIP] DD0028: is there available VM disk space?
[FAIL] DD0031: does the Docker API work? error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine_linux/v1.24/containers/json?limit=0": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[2022-08-11T07:00:27.309375700Z][com.docker.diagnose.exe][I] ipc.NewClient: 81a31e80-com.docker.diagnose -> \\.\pipe\dockerLifecycleServer VMDockerdAPI
[linuxkit/pkg/desktop-host-tools/pkg/client.NewClientForPath(...)
[       linuxkit/pkg/desktop-host-tools/pkg/client/client.go:59
[linuxkit/pkg/desktop-host-tools/pkg/client.NewClient({0x9b5167, 0x13})
[       linuxkit/pkg/desktop-host-tools/pkg/client/client.go:53 +0x99
[common/pkg/diagkit/gather/diagnose.isDockerEngineRunning()
...

[FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[2022-08-11T07:00:34.399486500Z][com.docker.diagnose.exe][I] ipc.NewClient: cf37b9c8-diagnose -> \\.\pipe\dockerDiagnosticd diagnosticsd
[common/pkg/diagkit/gather/diagnose.glob..func14()
[       common/pkg/diagkit/gather/diagnose/linuxkit.go:18 +0x8b
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0xf3cd60)
[       common/pkg/diagkit/gather/diagnose/test.go:46 +0x43
...
[2022-08-11T07:00:34.400002200Z][com.docker.diagnose.exe][I] (68df991f) cf37b9c8-diagnose C->S diagnosticsd GET /ping
[2022-08-11T07:00:34.404818200Z][com.docker.diagnose.exe][W] (68df991f) cf37b9c8-diagnose C<-S NoResponse GET /ping (4.8071ms): Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.

[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0017: can a VM be started?
[FAIL] DD0024: is WSL installed? exec: "wsl": executable file not found in %PATH%
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[FAIL] DD0025: are WSL distros installed? exec: "wsl": executable file not found in %PATH%
[PASS] DD0026: is the WSL LxssManager service running?
[FAIL] DD0029: is the WSL 2 Linux filesystem corrupt? exec: "wsl": executable file not found in %PATH%
[FAIL] DD0035: is the VM time synchronized? exec: "wsl": executable file not found in %PATH%
[PASS] DD0015: are the binary symlinks installed?
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.
[FAIL] DD0003: is the Docker CLI working? exit status 1
[PASS] DD0013: is the $PATH ok?
[PASS] DD0005: is the user in the docker-users group?
[FAIL] DD0007: is the backend responding? failed to ping com.docker.backend with error: Get "http://ipc/ping": open \\.\pipe\dockerBackendApiServer: The system cannot find the file specified.
[2022-08-11T07:00:40.483317900Z][com.docker.diagnose.exe][I] ipc.NewClient: c9130a1a-diagnose -> \\.\pipe\dockerBackendApiServer BackendAPI
[common/pkg/backend.NewClientForPath({0x9abd52?, 0x1?}, {0xc00048a0e0?, 0x811dc9?})
[       common/pkg/backend/client.go:168 +0x3d
[common/pkg/backend.NewClient({0x9abd52, 0x8})
[       common/pkg/backend/client.go:163 +0x50
[common/pkg/diagkit/gather/diagnose.glob..func9()
...
2022/08/11 16:00:47 exec: "wsl": executable file not found in %!P(MISSING)ATH%!(NOVERB)

My Docker can now be executed.
When I downgraded to docker 4.8.2 and used hyper-v, docker ran normally. But I still don’t know why it didn’t run when I used the latest version (4.11.1) and wsl. The conditions of the detailed environment were not important because my goal was just to create a Docker container and distribute the program.
Thank you for your help rimelek.