Search code examples
dockerwindows-subsystem-for-linuxdocker-desktop

Docker Desktop(Windows) is not starting after adding ".wslconfig" file


Docker Desktop is not starting after adding ".wslconfig" file.

I followed steps given in link-

https://mrakelinggar.medium.com/set-up-configs-like-memory-limits-in-docker-for-windows-and-wsl2-80689997309c

https://itnext.io/wsl2-tips-limit-cpu-memory-when-using-docker-c022535faf6f

When Starting docker desktop getting error message- It look like there is an error with Docker Desktop,restart it to fix it.

.wslconfig file-

[wsl2]
memory=3GB   # Limits VM memory in WSL 2 up to 3GB
processors=4 # Makes the WSL 2 VM use two virtual processors

Snap- enter image description here

Question - if the error goes away after removing the .wslconfig file? Ans- No

Then I installed Docker Desktop using Hyper V instead of wsl-2.

But When I restart laptop, Docker Desktop again failed to start in this method also.

Git Issue- https://github.com/docker/for-win/issues/11822

C:\Users[USER]\AppData\Local\Docker
C:\Users[USER]\AppData\Roaming\Docker
C:\Users[USER]\AppData\Roaming\Docker Desktop

Once deleted, I didn’t have to do anything else, Docker Desktop started booting up as normal.

After Deleting above files docker starts but it's like resetting the docker.

After that I restart my laptop to check whether Docker Runs or not after restarting laptop.

But Still facing same issue.Docker Desktop is not starting.

Current Docker Version - 4.9.0

Snap- enter image description here


Solution

  • Finally, Docker Desktop started running after downgrading the Docker Desktop version form "4.9.0" to "4.8.0", which is one of solution share in below post.

    The issue was not with ".wslconfig", the issue was Docker Desktop Version.

    Current Docker Desktop version 4.8.0 is working on both "Hyper V" and "wsl-2"

    http://www.dev.fyicenter.com/1001459_Docker_failed_to_initialize_Error.html