Search code examples
dockerubuntuwindows-subsystem-for-linux

WSL Failed to Initialize on Windows 11


I installed Docker on a clean laptop with the official Windows 11 with the latest update. Pre-installed WSL2 for Windows 11 according to Microsoft documentation. When running docker, the "docker starting..." is infinite. Attaching the error log. Error sending starting WSL engine:

Docker.Core.HttpBadResponseException: {"message":"2 errors occurred:\n\t* provisioning docker WSL distros: unregistering WSL distro "docker-desktop": unregistering WSL "docker-desktop": winapi error #2147746562\n\t* checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.\n\n"}

I tried to reinstall WSL and Docker. Deleted %appdata%/docker. For the test, I tried to install the Ubuntu subsystem through the Microsoft store. She didn't work either. Most likely a problem with the WSL. Tried to disable and enable again Windows features (WSL Support and Virtual Machine feature).


Solution

  • I had the same error solved it by: https://github.com/docker/for-win/issues/7039

    Don't need to reinstall it.

    Open windows shell as Administrator and run:

    wsl --unregister docker-desktop
    

    Then go to services, stop Docker Desktop service, then start it again.