Docker Failed to Initialize on Windows 10 - docker

I have an issue with running the Docker Desktop on my Windows 10 PC. After trying to run it I got an error:
Docker failed to initialize - Docker Desktop is shutting down
I already tried reinstalling (as admin), restarting PC, restarting docker services, removing content from .../AppData/Local/Docker and .../AppData/Roaming/Docker folders, but still receiving the same error message.
Does anyone have an idea how can I fix it?
Thank you a lot!

Simply local Appdata on your windows box, go to Roaming->Docker and delete the settings.json file. Restart docker and you will be fine.
Appdata can be located at this path: C:\Users\LifeIsGood\AppData\Roaming\Docker
NB. LifeisGood is my username

Downgrade to the older version solved my issue

You can try uninstalling docker and deleting
/Users/AppData/Local/Docker
/Users/AppData/Roaming/Docker
C:/Program Files/Docker
C:/ProgramData/Docker
Reinstalling Docker
However, what worked for me ultimately was deleting .docker in /Users folder and restarting docker.

I get that a lot on my laptop. I restart the "Hyper-V Host Compute Service" in Services. When that has restarted, I can start Docker Desktop.
I haven't found a permanent fix.

I had the same issue while starting the "Linux container" but windows container was working fine.
After trying All the possible methods to make docker desktop work, In case that is not worked then try this one. This one worked for me.
Please make sure to use older version of docker desktop ( mine is 4.4)
In docker desktop,
Go to settings --> General --> Use the WSL 2 based engine
Where If that check box turned On, Just Turn that off.

Related

Docker failed to initialize Docker Desktop is shutting down

This question was already asked a lot, but I didn't found a solution which is working for me.
I downloaded Docker Desktop with his guide for my windows 10 machine. After a successful installation the application does not start.
Following this solution didn't work. I deleted settings.json and restarted everything without success. Even reinstalling did not work. Any one has an other idea?
Edit:Reinstalling an older version (3.6.0 in my case) fixed the issue, but there has to be some other way...
Stop all processes with Docker and remove all content from the directory
C:\Users\<User>\AppData\Roaming\Docker
After that start Docker Desktop.

Docker Daemon not running on windows 11

I am a beginner into Docker stuff, I am on windows 11 and whenever I try to open docker desktop it doesn't open.
Always this error message shows up, also whenever I try to run docker ps or docker images
or anything related to docker it always shows this error
can anyone help
I have turned on hyper-v, wsl etc but nothing seems to work
I had the same issue, tried to get assistance from docker support and did lota google but nothing worked.
I had a gut feeling that the issue was not within the Docker Desktop as i have tried all the options including deleting docker appdata etc. sov, i started investigating WSL and noticed the distros docker-desktop-data, docker-desktop was in stopped & uninstalling state. These states never changed and appears even after uninstalling Docker desktop and windows reboot.
PowerShell (admin)
wsl -l -v
I removed those distros after uninstalling docker desktop completely (including deleting docker folders from appdata manually)
PowerShell (admin)
wsl --unregister "DistributionName"
Replacing "DistributionName" with the name of your targeted distribution will unregister that distribution from WSL so it can be reinstalled or cleaned up. Caution: Once unregistered, all data, settings, and software associated with that distribution will be permanently lost. Reinstalling from the store will install a clean copy of the distribution. For example, wsl --unregister "DistributionName" would remove "DistributionName" from the distributions available in WSL. Running wsl --list will reveal that it is no longer listed.
PowerShell (admin)
wsl --unregister docker-desktop-data
wsl --unregister docker-desktop
Finally, reinstalled Docker desktop and its associated applications.
It started working perfectly!
That is followed by docker/for-win issue 12413, and this question (which suggests a fresh installation of Windows 11 itself!)
Only workaround so far (to avoid reinstalling W11):
I tried reinstalling a couple times and different versions and nothing worked, the UI would just never show up.
The only solution really was to delete C:\Users\<username>\AppData\Roaming\Docker and C:\Users\<username>\AppData\Roaming\Docker Desktop.
I was facing similar issue with Windows 10 and Docker Desktop 4.16.3 (96739)
I had disabled WSL2 based engine.
Just executed below command using Power shell( admin):
wsl --unregister docker-desktop-data
wsl --unregister docker-desktop
And my issue got solved like snap of finger.
Thanks
After trying all the solutions listed here and nothing worked for me, i simply reinstalled wls2 from windows app store. and everything worked fine for me.

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!
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.
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.
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
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.
I hit this issue today, and the steps below are what worked for me - the gist is that I needed to install WSL 2 beforehand. Most of my steps were derived from here:
open powershell as admin
wsl -l -v # Windows Subsystem for Linux has no installed distributions
install linux kernel update from here # in my case, x64-based
wsl --set-default-version 2
wsl --list --online # shows several linux distributions, I picked a recent one
wsl --install -d Ubuntu-20.04 # then create default linux user name and password
install windows docker desktop from here # now starts successfully
Manged to switch to Windows Containers. (Docker v4.9.0)
What I did was to change the following in the settings.json:
"useWindowsContainers": true,
"wslEngineEnabled": true,
Also set security on folder:
C:\ProgramData\Docker (I set "Everyone" full control.)
After that I used the "Switch to Windows Containers"-feature from the task-bar icon content menu
I tried Janne Rantala's method.
But the same problem occurs again after several days.
My final solution is to uninstall Docker Desktop, then download and run the installation file as an administrator.
Then the problem no longer appears again.
I was able to resolve this issue on my machine by installing the Linux kernel update package as described in the Microsoft guide
I have been having some Docker setting up troubles for a fair amount of time. I think I had to just make sure I removed all references of Docker. After buying Windows 10 pro I still had issues, I did have to look into the following folders:
C:\Users\%UserName%\AppData\Local\Temp\Docker
C:\Users\%UserName%\AppData\Roaming\Docker
I also deleted the Docker file in my programfiles folder
Navigated to said file and deleted Docker files.
Used the docker installer, checkboxes (to use wsl2).
I was faicing the same issue and resolved. I have just open Microsoft Store application and after that opened the docker and its working fine. This is wired but sharing this so it might helps someone.
I solved this issue by enabling the windows feature "Windows Hypervisor Platform" and restarting my computer.
I installed Docker Desktop v4.16.2

Docker is always show "Docker Engine starting..."

Hello I got new existing projects and using docker.
The problem is my docker desktop app always in Docker Engine starting..., but in my icon it's already show Docker Desktop is running.
running on windows 10🙏
Just close docker desktop app and then open it up again, it will run normally again
Had the same issue running Docker Desktop 3.2.2.
Fixed by downloading Docker Desktop 3.3.0 (https://docs.docker.com/docker-for-windows/release-notes/)
In some cases the following method works:
open cmd as admin
enter net stop winnat
start or restart docker desktop
enter net start winnat
Here is my solution.
Run the following two lines of commands inside PowerShell.
First Exit docker hub desktop, then run these commands in PowerShell:
wsl --unregister docker-desktop
wsl --unregister docker-desktop-data
Note: It should be noted that this removes all docker containers and data. (WLS: Unregisters the distribution and deletes the root filesystem.)
Suddennly i opened my laptop and started Docker, it was displaying only "Docker desktop starting" and stuck here for long time. I tried to delete settings.json(auto created on starting docker again) at \AppData\Roaming\Docker
but nothing worked.
So, i simply restarted my laptop undoing all changes, and this time after few mins Docker desktop started successfully.
When I check, I was using the latest version so downgrade the Desktop version 4 to version 3.
https://docs.docker.com/desktop/previous-versions/3.x-windows/
summary - Try with a different version other than the latest one.
Hope this helps !!!
version 4.16.2 must be updated immediately to 4.16.3
open update to latest window and read the update cause:
Fixed Docker Desktop failing to start...
It couldn't be updated, so uninstall and install it again.
Rebooting fixed the issue for me.

System.InvalidOperationException: Failed to deploy distro docker-desktop to <localpath>: exit code: -1

I am trying to run docker Desktop in my windows 10 Local. have installed it successfully but while running it I am getting the below error.
System.InvalidOperationException:
Failed to deploy distro docker-desktop to <localpath>: exit code: -1
stdout: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
I think it is saying some windows services need to be enabled, but I don't know which service has to be enabled could someone please help me with this concern?
docker version
C:\Users\lenova>docker --version
Docker version 20.10.2, build 2291f61
Uninstall Docker.
Uncheck Containers, Hyper-V, Windows Subsystem for Linux in Windows features
Restart the system
Install Docker Desktop
Restart System
Start Docker Desktop
Right click on docker icon, run as administrator (if you have administrator rights on your computer). It solved the problem for me.
Try delete %USERPROFILE%/.wslconfig. If it helps then you can try to modify it so that it work. As for me I deleted the file, because on my workstation docker didn't want to work with it
Almost sure, that the accepted answer will work. However, it won't be an option, if you utilize WSL for other purposes as well. In that case, you may have several configurations/apps in WSL and just reinstalling or deleting your configuration will probably be a bad solution.
Furthermore: WSL is not the issue for this error! It is created by Docker engine configuration which will kill the WSL service (LxxsManager). This may happen because of
changed configuration (by you) or
because of a Docker update, maybe also
because of Windows updates
You can find a detailed discussion about this issue on Docker's GitHub Issues.
I personally experienced this problem after installing updates on Windows while running Docker v3.5.2. And again, reinstalling/killing WSL is not an option for me! So I tried to kill all services (Docker and WSL) and update Docker. Unfortunately that did not work in first place, since LxxsManager was in some weird state and I could not even kill it any more (even a kill command as admin with force switch did not do it's job!)... So here is my solution to fix that problem:
Remove Docker from autostart
Restart Windows (Yippiee: WSL works again! 🥰)
Install a new version of Docker (in my case v.4.2.0)
Restart Windows again (probably not necessary, but for me it was because Docker engine did not start before a Windows restart)
Start Docker (Yippiee: Docker works again! ☺️)
Note: Since I did not change Docker configuration, I installed an update. If you changed configuration options resulting in that crash, your solution may be different. Literally, instead of updating Docker (step 3) you would probably roll back your Docker configuration changes instead.
The quality of Docker for Windows is very bad. I catch these dangerous very often.
Check list:
(1) Use this tool https://www.nirsoft.net/utils/regscanner.html . Search docker, delete all.
(2) Remove WSL sub system, Hyper-V, then restart
(3). Create file foo.reg has content
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3]
"AppFullPath"="C:\\Windows\\System32\\wsl.exe"
"PermittedLspCategories"=dword:80000000
run.
(4) Uninstall Docker
(5) Run cmd type ... . Delete folder .docker
Delete Docker folder in Program Files
(6) delete
(7) Install latest version of Docker.
(8) Re-install feature WSL for Windows.
Install Ubuntu from Windows store
(9) Re-install Docker (as Administrator)
(10) Run Docker as Administrator .
In my case, I was getting a similar error. This was happening because Docker desktop didn't have permissions to access the path C:\Users\Adithya\AppData\Local\Docker\wsl\distro. This started happening after I switched to WSL2 backend.
The solution was to kill all docker process. Next, Run Docker Desktop as Administrator.
System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Adithya\AppData\Local\Docker\wsl\distro:
exit code: -1 stdout: The operation timed out because a response was not received from the virtual machine or container.
run as administrator , and you switch the container to windows by clicking the icon bar in the right corner taskbar and choose switch to windows container
https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10-linux
If you don't need to run Linux and Windows containers side-by-side, an option is to turn off the WSL and use Hyper-v instead. This should work fine.
I had to exit Private Internet Access (PIA) VPN to get docker to work on my system. Not sure why.
I had the PgAdmin 4 app running, and when I closed it and tried starting Docker Desktop again it booted normally.
Not sure if there is a link, but an easy solution to try.
This worked for me: https://github.com/MicrosoftDocs/WSL/issues/547#issuecomment-873540236
Copy below snippet:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3]
"AppFullPath"="C:\\Windows\\System32\\wsl.exe"
"PermittedLspCategories"=dword:80000000
Save it as a file wsl.reg
Execute the file to update the registry
Launch Ubuntu again
Issue resolved
In my case, the issue was caused by Acrylic DNS server. Anything that holds port 53, would be a problem.
Interesting that it all worked fine for a few days after installation, maybe because I did not reboot the laptop all that time, only used the deep hibernation. So it was hard to guess what could break the docker setup, I was sure that it was because of the recently installed windows or docker updates.
Restarting wsl worked for me.
Run the following
wsl --shutdown, wait for it to shutdown
wsl, wait for it to start
Start Docker Desktop after this.
On Windows 10:
Open Services
Right click on LXSSMANAGER -> Restart
Close wsl using cmd with following command:
wsl --shutdown
Execute following start wsl again:
wsl
I solved by the following steps:
Uninstall Docker and WSL 2 kernel.
Uncheck Containers, Hyper-V, Windows Subsystem for Linux in Windows
features
Restart the system
Install Docker Desktop
Restart System
Start Docker Desktop
The problem is in WSL as it becomes unresponsive and returns a service error if you try the following command in PowerShell:
wsl -l -v
I believe the process can be simplified a bit more with:
Uncheck Windows Subsystem for Linux in Windows Features
Reboot
Turn the feature back on
Re-apply the WSL2 update
Reboot
No need to uninstall/reinstall Docker Desktop.
This got me back up and running with Windows 10 Home (which requires WSL2) and Docker Desktop 2.4.0

Resources