What to do if you have enabled Use the WSL2 based engine in Docker Desktop with insufficient WSL2 installation

environment

background

image.png

If you enable Use the WSL2 based engine of Docker Desktop when WSL2 is not installed sufficiently (*), Docker Desktop may not be able to start in some cases.

Once this happened, I did a Factory Reset on Docker Desktop and reinstalled it didn't help. (Use the WSL2 based engine is ☑.)

solution

Start Docker Desktop →[During startup]→ Fall due to an error

Open the Docker Desktop settings window from the task tray during "Starting". After that, uncheck Use the WSL2 based engine again.

Once the settings window opens, it's okay. If Docker Desktop crashes with an error when you press the Apply button, it looks like the setup isn't complete, but you can close the window manually.

If you start Docker Desktop again, it should start with WSL2 unchecked.

NOTE: Error messages printed to Docker Desktop

[16:02:30.382][LoggingMessageHandler][Info   ] [5b30b70a] <BackendAPIClient end> POST http://backend/hyperv/stop -> 204 NoContent (took 9149ms)
[16:02:30.387][ApiProxy          ][Info   ] Killing existing com.docker.proxy with PID 19304
[16:02:30.429][VpnKit            ][Info   ] Killing existing vpnkit with PID 16264
[16:02:30.458][VpnKitBridge      ][Info   ] Killing existing vpnkit-bridge with PID 2208
[16:02:30.482][EngineStateMachine][Debug  ] sending state Docker.ApiServices.StateMachines.StoppedState to state change sink
[16:02:30.482][EngineStateMachine][Debug  ] State Docker.ApiServices.StateMachines.StoppedState sent to state change sink
[16:02:30.482][EngineStateListener][Debug  ] received state Docker.ApiServices.StateMachines.StoppedState from LinuxHyperV
[16:02:30.483][EngineStateNotificationRecorder][Debug  ] Registered state {"State":"stopped","Mode":"linux","date":1599634950}
[16:02:30.483][SystrayNotifications][Info   ] Docker has stopped
[16:02:30.483][LoggingMessageHandler][Info   ] [a1a2394b] <NotificationsClient start> POST http://localhost/engine/state
[16:02:30.492][LoggingMessageHandler][Info   ] [a1a2394b] <NotificationsClient end> POST http://localhost/engine/state -> 200 OK (took 8ms)
[16:02:30.501][Engines           ][Debug  ] Starting
[16:02:30.502][LoggingMessageHandler][Info   ] [abeb5d24] <BackendAPIClient start> POST http://backend/versionpack/enable
[16:02:30.520][LoggingMessageHandler][Info   ] [abeb5d24] <BackendAPIClient end> POST http://backend/versionpack/enable -> 204 NoContent (took 18ms)
[16:02:30.520][EngineStateMachine][Debug  ] sending state Docker.ApiServices.StateMachines.StartTransition to state change sink
[16:02:30.520][EngineStateMachine][Debug  ] State Docker.ApiServices.StateMachines.StartTransition sent to state change sink
[16:02:30.521][EngineStateListener][Debug  ] received state Docker.ApiServices.StateMachines.StartTransition from LinuxWSL2
[16:02:30.521][EngineStateNotificationRecorder][Debug  ] Registered state {"State":"starting","Mode":"linux","date":1599634950}
[16:02:30.521][SystrayNotifications][Info   ] Docker is starting
[16:02:30.522][LoggingMessageHandler][Info   ] [fdbe74be] <NotificationsClient start> POST http://localhost/engine/state
[16:02:30.527][LinuxWSL2Engine   ][Info   ] Terminating lingering processes and wsl distros and patching host file
[16:02:30.527][LoggingMessageHandler][Info   ] [15e2371f] <BackendAPIClient start> POST http://backend/dns/refresh-hosts
[16:02:30.532][LoggingMessageHandler][Info   ] [fdbe74be] <NotificationsClient end> POST http://localhost/engine/state -> 200 OK (took 10ms)
[16:02:30.604][LoggingMessageHandler][Info   ] [15e2371f] <BackendAPIClient end> POST http://backend/dns/refresh-hosts -> 204 NoContent (took 77ms)
[16:02:30.609][WSL2Provisioning  ][Info   ] Checking docker-desktop
[16:02:30.613][WSL2Provisioning  ][Info   ] deploying WSL distro docker-desktop to C:\Users\ogawa\AppData\Local\Docker\wsl\distro
[16:02:31.338][WSL2Provisioning  ][Error  ] Failed to set version to docker-desktop: exit code: -1
 stdout: ?[L?W0?0F0h0W0_0?d\Oo00?SgqW0_0?0?0?0?0?0?0n0.z^?g0o0?0?0?0?0U0?0f0D0~0[0?00
 
 stderr: 
[16:02:31.343][LinuxWSL2Engine   ][Info   ] Stopping windows side processes
[16:02:31.418][LinuxWSL2Engine   ][Info   ] Stopping engine
[16:02:31.529][LinuxWSL2Engine   ][Warning] Failed to send stop message to distro, will terminate abrubtly: 
[16:02:31.647][LoggingMessageHandler][Info   ] [fe4e5f2d] <BackendAPIClient start> POST http://backend/windowsfeatures/check
[16:02:32.062][LoggingMessageHandler][Info   ] [fe4e5f2d] <BackendAPIClient end> POST http://backend/windowsfeatures/check -> 200 OK (took 414ms)
[16:02:32.607][LinuxWSL2Engine   ][Info   ] Terminating lingering processes and wsl distros and patching host file
[16:02:32.607][LoggingMessageHandler][Info   ] [84dcd8a7] <BackendAPIClient start> POST http://backend/dns/refresh-hosts
[16:02:32.667][WSL2Provisioning  ][Info   ] Checking docker-desktop
[16:02:32.667][WSL2Provisioning  ][Info   ] deploying WSL distro docker-desktop to C:\Users\ogawa\AppData\Local\Docker\wsl\distro
[16:02:32.686][LoggingMessageHandler][Info   ] [84dcd8a7] <BackendAPIClient end> POST http://backend/dns/refresh-hosts -> 204 NoContent (took 77ms)
[16:02:33.320][WSL2Provisioning  ][Error  ] Failed to set version to docker-desktop: exit code: -1
 stdout: ?[L?W0?0F0h0W0_0?d\Oo00?SgqW0_0?0?0?0?0?0?0n0.z^?g0o0?0?0?0?0U0?0f0D0~0[0?00
 
 stderr: 
[16:02:33.320][LinuxWSL2Engine   ][Info   ] Stopping windows side processes
[16:02:33.387][LinuxWSL2Engine   ][Info   ] Stopping engine
[16:02:33.473][LinuxWSL2Engine   ][Warning] Failed to send stop message to distro, will terminate abrubtly: 
[16:02:33.556][EngineStateMachine][Debug  ] sending state Docker.ApiServices.StateMachines.FailedToStartState to state change sink
[16:02:33.556][EngineStateMachine][Debug  ] State Docker.ApiServices.StateMachines.FailedToStartState sent to state change sink
[16:02:33.556][EngineStateListener][Debug  ] received state Docker.ApiServices.StateMachines.FailedToStartState from LinuxWSL2
[16:02:33.557][EngineStateNotificationRecorder][Debug  ] Registered state {"State":"failed to start","Mode":"linux","date":1599634953}
[16:02:33.557][LoggingMessageHandler][Info   ] [26d81e32] <NotificationsClient start> POST http://localhost/engine/state
[16:02:33.558][SystrayNotifications][Error  ] Failed to set version to docker-desktop: exit code: -1
 stdout: ?[L?W0?0F0h0W0_0?d\Oo00?SgqW0_0?0?0?0?0?0?0n0.z^?g0o0?0?0?0?0U0?0f0D0~0[0?00
 
 stderr: 
[16:02:33.568][LoggingMessageHandler][Info   ] [26d81e32] <NotificationsClient end> POST http://localhost/engine/state -> 200 OK (took 11ms)
[16:02:33.589][Engines           ][Error  ] Start failed with Failed to set version to docker-desktop: exit code: -1
 stdout: ?[L?W0?0F0h0W0_0?d\Oo00?SgqW0_0?0?0?0?0?0?0n0.z^?g0o0?0?0?0?0U0?0f0D0~0[0?00
 
 stderr: 
Location Docker.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode)Location C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:Line 119
Location Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__6.MoveNext()Location C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:Line 48
---End of stack trace from where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Location Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__23.MoveNext()Location C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:Line 91
---End of stack trace from where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Location Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext()Location 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 where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Location Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext()Location 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 where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext()Location 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 where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Location Docker.ApiServices.StateMachines.EngineStateMachine.<StartAsync>d__14.MoveNext()Location 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 where the exception was just thrown---
Location System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Location System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Location Docker.Engines.Engines.<StartAsync>d__24.MoveNext()Location C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:Line 109)

Recommended Posts

What to do if you have enabled Use the WSL2 based engine in Docker Desktop with insufficient WSL2 installation
What to do if you can't use the rails command
What to do if you change the Listen Address from the settings screen with Mattermost docker
What to do if you forget the root password in CentOS7
What to do if the debug gem installation fails
What to do if you can't get the text of an element in Selenium
What to do if you cannot execute with the command "Java package name / class name"
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do if you installed Ruby with rbenv but the version does not change
[Rails] What to do if you can't get an error message with the errors method
What to do if you get angry with "ERROR: There are no scenarios; must have at least one" even though you should have entered yarn in Docker
What to do if validation doesn't work with the update action
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
What to do if you get a DISPLAY error in gym.render ()
What to do if you get angry with OpenSSL with pyenv install
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you can't get parameters with form_with
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if you get a groovy warning in Thymeleaf Layout
What to do if the prefix c is not bound in JSP
[Composer] [Laravel] What to do if you cannot install due to insufficient memory
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
What to do if you don't like the code generated by swagger-codegen-cli
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if Operation not permitted is displayed when you execute a command in the terminal
If you have trouble with the character code problem in Myanmar (Burmese)
What to do if you install Ubuntu
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you get the error message unrecognized selector send to instance "***"
What to do if the changes are not reflected in the jar manifest file
What to do if you have installed Java for OS X on macOS
What to do if Docker Desktop fails to launch on your M1 MacBook Pro
What to do if you get angry if you don't have nokogiri while installing wp2txt
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if ffi installation fails when launching an application in Rails
What to do if the server tomcat dies
What to do if you push incorrect information
What do you use when converting to String?
What to do if you hit the wall of Too many symbol files when uploading with App Store Connect
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
What to do if you can't find the JDK you put in SDKMAN after migrating from bash to zsh on macOS
If you use SQLite with VSCode, use the extension (how to see the binary file of sqlite3)
What to do if you get a wrong number of arguments error in binding.pry
What to do if you get the error Couldn't find Item without an ID
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if the Rails server can't start
What to do if you accidentally create a model
If you want to use Mockito with Kotlin, use mockito-kotlin
If you want to recreate the instance in cloud9
What to do if password authentication fails in Docker/Postgres
How to make a jar with old Hadoop (hadoop-core-0.20.2-cdh3u6) in Gradle: (What to do if you get Could not expand ZIP ..)
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do if you get ActiveRecord :: StatementInvalid: Mysql2 :: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near when you try to reset Heroku
[Java] [Spring] What to do if you cannot Autowire with Type Mismatch after annotating Spring Security
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name