Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to deploy distro docker-desktop #8204

Open
ChakritRakuang opened this issue Aug 24, 2020 · 79 comments
Open

Failed to deploy distro docker-desktop #8204

ChakritRakuang opened this issue Aug 24, 2020 · 79 comments

Comments

@ChakritRakuang
Copy link

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: Error: 0xffffffff

stderr:
at Docker.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:line 119
at Docker.Engines.WSL2.WSL2Provisioning.d__17.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 169
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.WSL2Provisioning.d__8.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 78
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.LinuxWSL2Engine.d__24.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 94
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.TaskExtensions.d__0.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

@ChakritRakuang
Copy link
Author

Version: 2.3.0.4 (46911)
Channel: stable
Sha1: d4f5fcf98140180eeef00e02c1c8bb0ad69e35d3
Started on: 2020/08/24 15:53:13.437
Resources: C:\Program Files\Docker\Docker\resources
OS: Windows 10 Enterprise
Edition: Enterprise
Id: 2004
Build: 19041
BuildLabName: 19041.1.amd64fre.vb_release.191206-1406
File: C:\Users\Chakrit Rakhuang\AppData\Local\Docker\log.txt
CommandLine: "C:\Program Files\Docker\Docker\Docker Desktop.exe"
You can send feedback, including this log file, at https://github.com/docker/for-win/issues
[15:53:13.704][GUI ][Info ] Starting...
[15:53:13.773][ComponentVersions ][Info ] Edition community
[15:53:13.775][ComponentVersions ][Info ] Edition community
[15:53:14.823][AppMigrator ][Info ] Current version: 6. Latest version: 6
[15:53:14.884][TrackingSettings ][Info ] Crash report and usage statistics are enabled
[15:53:14.888][SegmentApi ][Info ] Usage statistic: Identify
[15:53:15.228][SegmentApi ][Info ] Usage statistic: appLaunched
[15:53:16.279][ApplicationTemplatesTracking][Info ] Cannot list templates
[15:53:16.279][SegmentApi ][Info ] Usage statistic: eventTemplatesInfo
[15:53:16.281][SegmentApi ][Info ] Usage statistic: heartbeat
[15:53:16.557][LoggingMessageHandler][Info ] [9a7f340a] GET http://backend/version
[15:53:18.111][LoggingMessageHandler][Info ] [9a7f340a] GET http://backend/version -> 200 OK (took 1555ms)
[15:53:18.192][LoggingMessageHandler][Info ] [73bcf73e] GET http://backend/hyperv/vhdx-size?path=C:%5CProgramData%5CDockerDesktop%5Cvm-data%5CDockerDesktop.vhdx
[15:53:18.684][LoggingMessageHandler][Info ] [73bcf73e] GET http://backend/hyperv/vhdx-size?path=C:%5CProgramData%5CDockerDesktop%5Cvm-data%5CDockerDesktop.vhdx -> 200 OK (took 491ms)
[15:53:18.716][LoggingMessageHandler][Info ] [db35d73f] POST http://backend/migrate/app
[15:53:18.726][LoggingMessageHandler][Info ] [db35d73f] POST http://backend/migrate/app -> 204 NoContent (took 10ms)
[15:53:18.736][Engines ][Debug ] Starting
[15:53:18.747][LoggingMessageHandler][Info ] [9e1abc78] POST http://backend/versionpack/enable
[15:53:18.969][LoggingMessageHandler][Info ] [9e1abc78] POST http://backend/versionpack/enable -> 204 NoContent (took 218ms)
[15:53:19.448][GoBackendProcess ][Info ] Starting C:\Program Files\Docker\Docker\resources\com.docker.backend.exe -addr unix:\.\pipe\dockerBackendApiServer
[15:53:19.506][GoBackendProcess ][Info ] Started
[15:53:19.582][MutagenProcess ][Info ] Starting C:\ProgramData\Docker\cli-plugins\docker-mutagen.exe mutagen daemon run
[15:53:19.607][MutagenProcess ][Info ] Started
[15:53:19.664][EngineStateMachine][Debug ] sending state Docker.ApiServices.StateMachines.StartTransition to state change sink
[15:53:19.666][EngineStateMachine][Debug ] State Docker.ApiServices.StateMachines.StartTransition sent to state change sink
[15:53:19.673][EngineStateListener][Debug ] received state Docker.ApiServices.StateMachines.StartTransition from LinuxWSL2
[15:53:19.679][EngineStateNotificationRecorder][Debug ] Registered state {"State":"starting","Mode":"linux","date":1598259199}
[15:53:19.680][SystrayNotifications][Info ] Docker is starting
[15:53:19.722][LinuxWSL2Engine ][Info ] Terminating lingering processes and wsl distros and patching host file
[15:53:19.732][LoggingMessageHandler][Info ] [01ffbea6] POST http://backend/dns/refresh-hosts
[15:53:21.821][MutagenProcess ][Info ] [forwarding] Looking for existing sessions
[15:53:21.879][MutagenProcess ][Info ] [forwarding] Session manager initialized
[15:53:21.879][MutagenProcess ][Info ] [sync] Looking for existing sessions
[15:53:21.879][MutagenProcess ][Info ] [sync] Session manager initialized
[15:53:23.895][DockerHub ][Info ] Login successfull
[15:53:24.851][LoggingMessageHandler][Info ] [01ffbea6] POST http://backend/dns/refresh-hosts -> 204 NoContent (took 5119ms)
[15:53:34.975][LoggingMessageHandler][Info ] [426a008a] GET http://unix/versions
[15:53:35.434][LoggingMessageHandler][Info ] [426a008a] GET http://unix/versions -> 200 OK (took 459ms)
[15:53:36.397][GoBackendProcess ][Info ] started port-forwarding control server on \\.\pipe\dockerVpnKitControl
[15:53:36.487][GoBackendProcess ][Info ] ⇨ http server started on \.\pipe\dockerVpnKitControl
[15:53:36.649][GoBackendProcess ][Info ] listening on unix:\\.\pipe\dockerVpnkitData for data connection
[15:53:36.719][GoBackendProcess ][Info ] ⇨ http server started on \.\pipe\dockerBackendApiServerForGuest
[15:53:36.792][GoBackendProcess ][Info ] enabling filesystem caching
[15:53:36.792][GoBackendProcess ][Info ] filesystem exports are: (2)
[15:53:36.810][GoBackendProcess ][Info ] volume control server listening on \\.\pipe\dockerVolume
[15:53:36.818][GoBackendProcess ][Info ] filesystem server listening on 00000000-0000-0000-0000-000000000000:00001003-facb-11e6-bd58-64006a7986d3
[15:53:36.828][GoBackendProcess ][Info ] file ownership will be determined by the calling user ("fake owner" mode)
[15:53:36.828][GoBackendProcess ][Info ] using mfsymlinks
[15:53:36.841][GoBackendProcess ][Info ] ⇨ http server started on \.\pipe\dockerBackendApiServer
[15:53:41.107][WSL2Provisioning ][Info ] Checking docker-desktop
[15:53:49.172][WSL2Provisioning ][Info ] deploying WSL distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro
[15:53:57.392][WSL2Provisioning ][Error ] Failed to deploy distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: Error: 0xffffffff

stderr:
[15:53:57.401][LinuxWSL2Engine ][Info ] Stopping windows side processes
[15:53:57.641][LinuxWSL2Engine ][Info ] Stopping engine
[15:53:57.725][LoggingMessageHandler][Info ] [9c1f0816] POST http://backend/windowsfeatures/check
[15:53:59.190][LoggingMessageHandler][Info ] [9c1f0816] POST http://backend/windowsfeatures/check -> 200 OK (took 1456ms)
[15:53:59.850][LinuxWSL2Engine ][Info ] Terminating lingering processes and wsl distros and patching host file
[15:53:59.850][LoggingMessageHandler][Info ] [f02f33e0] POST http://backend/dns/refresh-hosts
[15:53:59.993][LoggingMessageHandler][Info ] [f02f33e0] POST http://backend/dns/refresh-hosts -> 204 NoContent (took 143ms)
[15:54:00.001][WSL2Provisioning ][Info ] Checking docker-desktop
[15:54:00.001][WSL2Provisioning ][Info ] deploying WSL distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro
[15:54:02.128][WSL2Provisioning ][Error ] Failed to deploy distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: Error: 0xffffffff

stderr:
[15:54:02.129][LinuxWSL2Engine ][Info ] Stopping windows side processes
[15:54:02.338][LinuxWSL2Engine ][Info ] Stopping engine
[15:54:02.525][EngineStateMachine][Debug ] sending state Docker.ApiServices.StateMachines.FailedToStartState to state change sink
[15:54:02.525][EngineStateMachine][Debug ] State Docker.ApiServices.StateMachines.FailedToStartState sent to state change sink
[15:54:02.525][EngineStateListener][Debug ] received state Docker.ApiServices.StateMachines.FailedToStartState from LinuxWSL2
[15:54:02.526][EngineStateNotificationRecorder][Debug ] Registered state {"State":"failed to start","Mode":"linux","date":1598259242}
[15:54:02.527][SystrayNotifications][Error ] Failed to deploy distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: Error: 0xffffffff

stderr:
[15:54:02.710][GUI ][Info ] Sending Bugsnag report f267437b-2665-465a-8c9a-be373412b960...
[15:54:02.882][GUI ][Info ] Bugsnag report f267437b-2665-465a-8c9a-be373412b960 sent
[15:54:02.884][SegmentApi ][Info ] Usage statistic: eventCrash
[15:54:02.893][Diagnostics ][Warning] Starting to gather diagnostics as User : 'C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe' gather.
[15:54:03.010][Engines ][Error ] Start failed with Failed to deploy distro docker-desktop to C:\Users\Chakrit Rakhuang\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: Error: 0xffffffff

stderr:
at Docker.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:line 119
at Docker.Engines.WSL2.WSL2Provisioning.d__17.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 169
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.WSL2Provisioning.d__8.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 78
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.LinuxWSL2Engine.d__24.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 94
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.TaskExtensions.d__0.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.EngineStateMachine.d__14.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.Engines.d__24.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 109)
[15:54:26.581][GoBackendProcess ][Info ] external: GET /events 200 "Go-http-client/1.1" "
[15:54:26.584][GoBackendProcess ][Info ] external: GET /forwards/list 200 "Go-http-client/1.1" "
[15:54:26.586][GoBackendProcess ][Info ] mutagen sync list --output json
[15:54:26.641][GoBackendProcess ][Info ] mutagen C:\ProgramData\Docker\cli-plugins\docker-mutagen.exe mutagen sync list --output json: null\n
[15:54:26.642][GoBackendProcess ][Info ] external: GET /sync 200 "Go-http-client/1.1" "
[15:57:26.762][Diagnostics ][Info ] Uploading diagnostics 80E9D45E-88E8-42F8-B0A6-C8328A7251BF/20200824085403
[15:58:09.485][Diagnostics ][Info ] Uploaded succesfully diagnostics 80E9D45E-88E8-42F8-B0A6-C8328A7251BF/20200824085403
[15:59:00.567][ErrorReportWindow ][Info ] Open logs
[15:59:00.601][ErrorReportWindow ][Info ] Open logs

@ChakritRakuang
Copy link
Author

80E9D45E-88E8-42F8-B0A6-C8328A7251BF/20200824085403

@ChakritRakuang
Copy link
Author

affect blue screen

@ngd929
Copy link

ngd929 commented Aug 30, 2020

I finally got this resolved after following these steps:

(from #7208)

  • Uninstall Docker and WSL 2 kernel.
  • Go to the Control Panel -> Programs -> Turn Windows features on or off
  • Uncheck the following: Containers, Hyper-V, Windows Subsystem for Linux
  • Restart the system
  • Install Docker without the WSL2 enabled/checked in the first screen
  • Go to the Control Panel -> Programs -> Turn Windows features on or off
  • Turn on/check the Windows Subsystem for Linux
  • Restart the system.
  • Do not install the WSL2 Kernel when reinstalling Docker.

I was not able to launch the Ubuntu WSL initially (got the same error messages in the first post), I then ran "wsl --update" and was able to launch the Ubuntu WSL and got Docker started running again.

My system now has wsl kernel 4.19.128 and Build 20201.rs_prerelease.200822-1922, and the default wsl version is now version 2.

Hope this helps. Cheers.

@ZacharyGonzales-Wellsky
Copy link

ZacharyGonzales-Wellsky commented Oct 1, 2020

I performed similar steps to @ngd929 and was able to start docker without wsl exiting with code: -1:

  • 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

Thanks!

@ankitrgupta1
Copy link

ankitrgupta1 commented Oct 3, 2020

@ngd929 You saved my day! Thanks a lot. However, for me, I had to install the WSL2 update again to get my Docker Desktop start, otherwise it kept on complaining to get it and wouldn't start.

So I believe steps by @ZacharyGonzales-Wellsky has actually worked.

By the way I am running Windows 10 Enterprise version 2004, and Docker Desktop 2.4.0.0

@LanceTrahan
Copy link

LanceTrahan commented Oct 12, 2020

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

@jzajac2
Copy link

jzajac2 commented Oct 20, 2020

I was not able to launch the Ubuntu WSL initially (got the same error messages in the first post), I then ran "wsl --update" and was able to launch the Ubuntu WSL and got Docker started running again.

Followed your steps, but when running "wsl --update", it doesn't seem to be an option, it just outputs the help/usage info. The state I'm in is after running previous nine steps/bullet points, and then upon reboot and starting docker shows the message suggesting to install the kernel update:
image

I closed out of that dialog, restarted docker, and then all-the-things started working 🤷

@LanceTrahan
Copy link

There's a note in the 2.4.2 Edge release notes:
https://docs.docker.com/docker-for-windows/edge-release-notes/#bug-fixes-and-minor-changes

  • Fixed an issue that can intermittently cause the WSL 2 backend to fail to start.

@Kamil-Zakiev
Copy link

I've just faced the issue on the latest version of Docker but it was resolved once I "Quit Docker Desktop" and launched it again
image

@Ashok-Architect
Copy link

Appreciated. Thank you for helpful solution here.

@ka-ramba
Copy link

ka-ramba commented Nov 3, 2020

There's a note in the 2.4.2 Edge release notes:
https://docs.docker.com/docker-for-windows/edge-release-notes/#bug-fixes-and-minor-changes

  • Fixed an issue that can intermittently cause the WSL 2 backend to fail to start.

I did not see that problem. Docker autoupdated yesterday and now it is crashing on start 100%. Not sure if the mentioned "fix" is to blame.

@betodevq
Copy link

betodevq commented Nov 3, 2020

There's a note in the 2.4.2 Edge release notes:
https://docs.docker.com/docker-for-windows/edge-release-notes/#bug-fixes-and-minor-changes

  • Fixed an issue that can intermittently cause the WSL 2 backend to fail to start.

I did not see that problem. Docker autoupdated yesterday and now it is crashing on start 100%. Not sure if the mentioned "fix" is to blame.

Same happened to me, I tried @ZacharyGonzales-Wellsky steps and it works now. I don't know why this happened though.

@nishantjonnala007
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

Thank you. I followed the steps that you mentioned and it fixed the issue.

@artempogosian
Copy link

I had the same issue and was able to solve it by:

  • enabling Intel Virtualization Technology in my BIOS
  • allowing NUMA spanning in Hyper-V settings
  • reinstalling Docker with WSL-2 option ticked and installing WSL2 Linux kernel update package for x64 machines

@manasanoolu7
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

Thank you so much, it really helped me.

@lalitadithya
Copy link

FWIW all I had to do was run the following commands in PowerShell and then restart docker and it started to work.

wsl --unregister docker-desktop-data
wsl --shutdown

Unfortunately, I lost all images that were cached locally.

@gusarov
Copy link

gusarov commented Jan 26, 2021

Got this after automatic upgrade to 3.1.0
Tried everything listed, nothing helps

@sandrobocon
Copy link

sandrobocon commented Feb 2, 2021

After upgrade to 3.1.0 mine started crashing as well, I had to disable Acrylic DNS Proxy.
Now it seems to be ok again, but I lost some features I was using.
You can find more info in:
microsoft/WSL#4364 (comment)

Edited: As said by @yuptogun, if you are using Laravel Valet you can try to stop it.
valet stop. I noted that if you stop valet, start WSL, and after WSL working, start valet again, it works.

@yuptogun
Copy link

yuptogun commented Feb 6, 2021

To add to the upper comment, this includes the case that you have Laravel Valet running.
Try valet stop if you have one.

@Aeilert
Copy link

Aeilert commented Mar 18, 2021

I also had this problem after an upgrade to 3.1.0. After trying multiple suggested solutions here, I finally got it working by doing the following.

  1. Uninstall Docker 3.1.0 and WSL from Control Panel
  2. Download and install Docker Dekstop 3.2.2
  3. Turn off Windows features
    a. Go to the Control Panel -> Programs -> Turn Windows features on or off
    b. Uncheck the following: Windows Subsystem for Linux
    c. Reboot
  4. Turn on Windows features
    a. Open Powershell in Admin mode
    b. Enable WSL w/ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    c. Enable Virtual Machine w/ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    d. Reboot
  5. Check that WSL is installed and working (run wsl -help from Powershell)
  6. Download and install the Linux kernel update package
  7. Set WSL 2 as your default version (run wsl --set-default-version 2 from Powershell)
  8. Install and launch a Linux distribution (from Microsoft Store)
  9. Start Docker Desktop

The installation of a separate Linux distribution might be superfluous, but I kept running into issues with wsl without it. Specially starting Docker Desktop wo/ the presence of a Linux distribution seems to interfere with WSL leading it to freeze and just return this message: The service cannot be started, either because it is disabled or because if has no enabled devices associated with it..

EDIT: In case anyone else is also experiencing that WSL becomes sporadically unresponsive w/ the above mentioned error message, then restarting LxssManager is a possible solution that avoids the need to disable/enable features. See suggested solutions as posted in microsoft/WSL#5836 and microsoft/WSL#3386. Running sc config LxssManager start=auto from the command line in admin-mode worked for me.

@thetechanics
Copy link

thetechanics commented Mar 25, 2021

@LanceTrahan - Yours is the ideal solution. Thank you.

@thetechanics
Copy link

Like @Aeilert , I too had to download and install the Linux kernel update package. The non-Windows Insider section of this reference helped.

@CodeFish-xiao
Copy link

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\peropero\AppData\Local\Docker\wsl\distro: exit code: -1
stdout: ���:

@ap1969
Copy link

ap1969 commented Apr 17, 2021

Like #8204 (comment) above, I had to disable Acrylic DNS then relaunch Docker Desktop and it started fine.

@namatoj
Copy link

namatoj commented Apr 29, 2021

FWIW all I had to do was run the following commands in PowerShell and then restart docker and it started to work.

wsl --unregister docker-desktop-data
wsl --shutdown

Unfortunately, I lost all images that were cached locally.

This solved the problem for me. I'm very glad that I didn't need to uninstall and reinstall WSL.

@alpharameeztech
Copy link

I finally got this resolved after following these steps:

(from #7208)

  • Uninstall Docker and WSL 2 kernel.
  • Go to the Control Panel -> Programs -> Turn Windows features on or off
  • Uncheck the following: Containers, Hyper-V, Windows Subsystem for Linux
  • Restart the system
  • Install Docker without the WSL2 enabled/checked in the first screen
  • Go to the Control Panel -> Programs -> Turn Windows features on or off
  • Turn on/check the Windows Subsystem for Linux
  • Restart the system.
  • Do not install the WSL2 Kernel when reinstalling Docker.

I was not able to launch the Ubuntu WSL initially (got the same error messages in the first post), I then ran "wsl --update" and was able to launch the Ubuntu WSL and got Docker started running again.

My system now has wsl kernel 4.19.128 and Build 20201.rs_prerelease.200822-1922, and the default wsl version is now version 2.

Hope this helps. Cheers.

but this wont run Linux based containers on windows right?

@Imaclean74
Copy link

Still happening consistently for me, as of a couple of weeks ago after a windows insiders update. Have tried all of the above steps from @alpharameeztech - but still failing with the same error :(

@ahmb
Copy link

ahmb commented Oct 6, 2021

Also try updating your .wslconfig file:

microsoft/WSL#5107 (comment)

@ahmb
Copy link

ahmb commented Oct 6, 2021

I selected the Docker autoupdate from 3.5.0 (I think) to 3.5.2 on Win 11. The install failed. Uninstalling, rebooting and installing 3.5.2 still failed Uninstalled, rebooted and installed 3.5.0 still failed

renamed .wslconfig to .xwslconfig in users\username after rsuggestion by XSonic uninstall, reboot and install 3.5.0 succeeded

the wslconfig I had set the ram to 8GB as a max, and added 2 processors

type .xwslconfig [wsl2] kernel=C:\temp\myCustomKernel memory=8GB # Limits VM memory in WSL 2 to 8 GB processors=2 # Makes the WSL 2 VM use two virtual processors

please quote the first line out # , in your .wslconfig (c:\users\abc.wslconfig) file:

microsoft/WSL#5107 (comment)

@conradjonp
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

Has anyone encountered this issue with a corporate laptop? Our IT team could follow these steps and it works, but the issues comes back regardless the next day. Seems like something is reverting in the WSL2 update.

@Asmedeus998
Copy link

Asmedeus998 commented Oct 23, 2021

None of above work for me.
I follow this:
https://stackoverflow.com/questions/64191759/wslregisterdistribution-failed-with-error-0xffffffff

It started to work again.

Tested work on Docker Desktop: 3.6 and 4.1.1

@jboullion
Copy link

@Asmedeus998 Thank you! This worked for me when none of the other steps did!

@cristiancundari
Copy link

Tried many times to uninstall and reinstalling docker following each time a different procedure, then @Asmedeus998 pointed solution finally solved my issue. I was using Acrylic DNS that was using port 53.

@Fydon
Copy link

Fydon commented Nov 15, 2021

For me the DNS Client service was disabled. I had to do something like these settings, except I had to set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache to 2 and then restart

@fede-2110
Copy link

I also had this problem after an upgrade to 3.1.0. After trying multiple suggested solutions here, I finally got it working by doing the following.

  1. Uninstall Docker 3.1.0 and WSL from Control Panel
  2. Download and install Docker Dekstop 3.2.2
  3. Turn off Windows features
    a. Go to the Control Panel -> Programs -> Turn Windows features on or off
    b. Uncheck the following: Windows Subsystem for Linux
    c. Reboot
  4. Turn on Windows features
    a. Open Powershell in Admin mode
    b. Enable WSL w/ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    c. Enable Virtual Machine w/ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    d. Reboot
  5. Check that WSL is installed and working (run wsl -help from Powershell)
  6. Download and install the Linux kernel update package
  7. Set WSL 2 as your default version (run wsl --set-default-version 2 from Powershell)
  8. Install and launch a Linux distribution (from Microsoft Store)
  9. Start Docker Desktop

The installation of a separate Linux distribution might be superfluous, but I kept running into issues with wsl without it. Specially starting Docker Desktop wo/ the presence of a Linux distribution seems to interfere with WSL leading it to freeze and just return this message: The service cannot be started, either because it is disabled or because if has no enabled devices associated with it..

EDIT: In case anyone else is also experiencing that WSL becomes sporadically unresponsive w/ the above mentioned error message, then restarting LxssManager is a possible solution that avoids the need to disable/enable features. See suggested solutions as posted in microsoft/WSL#5836 and microsoft/WSL#3386. Running sc config LxssManager start=auto from the command line in admin-mode worked for me.

Thanks man! Really appreciate it

@revl94
Copy link

revl94 commented Jan 16, 2022

Execute: wsl -l -v

If does not connect follow this:

Go to the Control Panel -> Programs -> Turn Windows features on or off
Uncheck Windows Subsystem for Linux in Windows Features
Reboot
Turn the feature back on
Reboot

Now open Docker Desktop

@spk33
Copy link

spk33 commented Jan 26, 2022

i installed latest version 4.4.4.0 and getting bellow error tried restart,reinstall,clean and purge ,didnt work i have enabled WSL2

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\USERNAME.s\AppData\Local\Docker\wsl\distro: exit code: -529697949
stdout:
stderr:
at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
at Docker.Engines.WSL2.WSL2Provisioning.d__17.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.WSL2Provisioning.d__8.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 77
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.WSL2.LinuxWSL2Engine.d__28.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 179
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.TaskExtensions.d__0.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\PR-17132\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

Diagnose returned following results
image

Hope this helps

@brianhaddock
Copy link

Just a note for anyone seeing this while running a split vpn. Disable the split vpn and viola, Docker starts working again.

@eduardo-mior
Copy link

After a few hours I found that the problem was the .wslconfig file.

Docker needs at least 1GB to work, I was putting 512MB and it failed.

@rugabunda
Copy link

I couldn't get this or android subsystem working, until I saw it mentioned here if port 53 is in use it can cause problems for these subsystems; disabled acrylic dns-proxy and problem solved.

@michal-turzynski
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

This worked for me, thank you! 🙏

@Saif-XI-Coderz
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

This worked for me too thanks

@danleonard-nj
Copy link

This was a recurring issue for me and it took me a stupidly long time to realize that NordVPN was causing it. If I disconnect from the VPN, problem's solved.

For the future Google searcher.

@rifaterdemsahin
Copy link

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

i would use
image
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/enable-or-disable-windows-features-using-dism?view=windows-11#to-disable-windows-features

@rifaterdemsahin
Copy link

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:

  1. Uncheck Windows Subsystem for Linux in Windows Features
  2. Reboot
  3. Turn the feature back on
  4. Re-apply the WSL2 update
  5. 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

This worked for me too thanks

does not work
image

@rifaterdemsahin
Copy link

After a few hours I found that the problem was the .wslconfig file.

Docker needs at least 1GB to work, I was putting 512MB and it failed.

i dont it is the data size...i clean it and nothing changes
image

@smtxdev
Copy link

smtxdev commented Jul 12, 2022

I could fix it.

I got the error:

Failed to deploy distro docker-desktop to C:\Users\XYZ\AppData\Local\Docker\wsl\distro: exit code: -1

How I fixed it:

  • Open an admin powershell and try wsl --update
  • After some time (ca. 25sec) the command opens something like this (if it fails):

image

  • Here you are stuck now because the update does not continue. You can close these windows for now.

  • Download this tool MS install/uninstall troubleshooter

  • Execute the troubleshooter -> Next

  • Choose problems with uninstalling (something like this)

  • Find in the list "Windows Subsystem for Linux Update" -> Press next and let Windows do its thing

  • If its done restart your PC

  • Then open an admin powershell and try again wsl --update - This time the update will work and you can finally start docker desktop again.

Let me know if that works for you as well.

@Roundhole
Copy link

@danleonard-nj

This was a recurring issue for me and it took me a stupidly long time to realize that NordVPN was causing it. If I disconnect from the VPN, problem's solved.

For the future Google searcher.

@brianhaddock

Just a note for anyone seeing this while running a split vpn. Disable the split vpn and viola, Docker starts working again.

The two of you combined resolved my encountering of this issue - disabling NordVPN's Split Tunnelling feature works a treat, and I still get to use the VPN. Thank you!

@DanielWiebe
Copy link

Hey all (and the future people who run into this issue),

I tried the aforementioned solutions on my company's Alienware m15 which supposedly has "virtualization enabled" on my 9th Gen i7 in task manager, but no BIOS options to enable Intel Virtualization technology.

I got a VM running a deactivated copy of Win10 Pro in Hyper-V, and tried uninstalling X, enabling Y, rebooting Z after disabling W, No dice. I tried many orderings of numerous solutions above. Still nothing. I was beginning to think hope was lost and It's my machine's fault or some IT policy. I even tried wsl --install Ubuntu-20.04 to see if I could get Docker loaded on that. CMD told me that "The virtual machine could not be started because a required feature is not installed." Oh joy...

I then stumbled upon this article https://blog.davidchristiansen.com/2016/11/run-hyper-v-docker-on-virtual-machine/ and I tried this command Set-VMProcessor -VMName "Win10 VM2" -ExposeVirtualizationExtensions $true where Win10 VM2 is your VM name, and BINGO. That solved my multi day issue.

Then I scrolled further on this page and saw that @NikolaosWakem wrote the solution as well:

If you use HyperV VM's for client development (like me ;-) and are trying to get Docker Desktop running on the VM.. run

Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization

For me, WindowsFeatures such as Containers, Hyper-V and its subsidiaries, Virtual Machine Platform, Windows Subsystem for Linux were all enabled and WSL 2 Kernel update was also installed before I ran the above command on my host's admin account in CmdPrompt (Admin).

Hope this helps someone avoid days worth of troubleshooting.

Cheers,

Daniel

@vaggelisdi
Copy link

Guys that steps worked for me:

  1. Uninstall Docker + wsl2
  2. Make sure Windows Subsystem for Linux, Containers and Hyper-V in Windows Features are all checked (wsl was only checked for me, so check them all)
  3. Reboot
  4. download WSL2 (with administration privilege) using the command in the powershell -> wsl --install
  5. download Docker with WSL2 feature checked.

I hope you find this helpful!

@Manardson
Copy link

Manardson commented Jan 1, 2023

None of these instructions worked for me. Here is what did the trick for my Win10 Home:

  1. Optional: Do all the latest Windows updates.
  2. In elevated Command Prompt paste:

DISM /Online /Enable-Feature /All /FeatureName:MSMQ-Container DISM /Online /Enable-Feature /All /FeatureName:MSMQ-DCOMProxy DISM /Online /Enable-Feature /All /FeatureName:MSMQ-Server DISM /Online /Enable-Feature /All /FeatureName:MSMQ-HTTP DISM /Online /Enable-Feature /All /FeatureName:MSMQ-Multicast DISM /Online /Enable-Feature /All /FeatureName:MSMQ-Triggers DISM /Online /Enable-Feature /All /FeatureName:WCF-MSMQ-Activation45 DISM /Online /Enable-Feature /All /FeatureName:WAS-WindowsActivationService DISM /Online /Enable-Feature /All /FeatureName:WAS-ProcessModel DISM /Online /Enable-Feature /All /FeatureName:WAS-NetFxEnvironment DISM /Online /Enable-Feature /All /FeatureName:WAS-ConfigurationAPI

@wyvern800
Copy link

wyvern800 commented Mar 16, 2023

I also had this problem after an upgrade to 3.1.0. After trying multiple suggested solutions here, I finally got it working by doing the following.

  1. Uninstall Docker 3.1.0 and WSL from Control Panel
  2. Download and install Docker Dekstop 3.2.2
  3. Turn off Windows features
    a. Go to the Control Panel -> Programs -> Turn Windows features on or off
    b. Uncheck the following: Windows Subsystem for Linux
    c. Reboot
  4. Turn on Windows features
    a. Open Powershell in Admin mode
    b. Enable WSL w/ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    c. Enable Virtual Machine w/ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    d. Reboot
  5. Check that WSL is installed and working (run wsl -help from Powershell)
  6. Download and install the Linux kernel update package
  7. Set WSL 2 as your default version (run wsl --set-default-version 2 from Powershell)
  8. Install and launch a Linux distribution (from Microsoft Store)
  9. Start Docker Desktop

The installation of a separate Linux distribution might be superfluous, but I kept running into issues with wsl without it. Specially starting Docker Desktop wo/ the presence of a Linux distribution seems to interfere with WSL leading it to freeze and just return this message: The service cannot be started, either because it is disabled or because if has no enabled devices associated with it..

EDIT: In case anyone else is also experiencing that WSL becomes sporadically unresponsive w/ the above mentioned error message, then restarting LxssManager is a possible solution that avoids the need to disable/enable features. See suggested solutions as posted in microsoft/WSL#5836 and microsoft/WSL#3386. Running sc config LxssManager start=auto from the command line in admin-mode worked for me.

Worked only doing step 4, thank you

@docker-robot
Copy link

docker-robot bot commented Jun 23, 2023

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests