Problem Description:
This article solves two Docker errors:
1.WSL 2 installation is incomplete.
2.System.InvalidOperationException: Failed to set version to docker-desktop: exit code: -1
After successfully installing Docker today, I ran Docker and the following error occurred:
WSL 2 installation is incomplete.
The WSL 2 Linux kernel is now installed using a separate MSI update package.Please click the link and follow the instructions to install the kernel update:https://aka.ms/wsl2kernel.
Press Restart after installing the Linux kernel.
Cause Analysis:
Docker is a tool for packaging, distributing, and deploying applications.
Basically a lightweight virtual machine. There are only things we need in the virtual machine, other superfluous things are necessary.
Important Concepts: Image, Container
Image: Similar to software installation package, it can be quickly spread and installed.
Container: After the software is installed, each software running environment is independent and isolated, which is called a container.
Advantages: It ensures that running on different machines is a consistent operating environment, and there will be no situation where my machine runs normally and your machine runs properly.
When we install docker desktop, he asks if we need to use wsl2 (Windows based subsystem for Linux). If not, we’ll run with a Hyper-V virtual machine. However, this subsystem has better performance compared to virtual machines.
The WAL 2 Linux kernel is now installed using a separate MSI update package.
That’s the problem!
solution:
Let’s go to the system to check whether the Linux subsystem of Windows is enabled. The steps are as follows:
Control Panel -> Programs -> Programs and Features
Check if you have checked here: Enable Windows Subsystem for Linux
If not, we check it, restart the computer, and open Docker.
If you still report WSL 2 installation is incomplete. problem. There is only one reason left:
the version of wsl2 we are using is very old, so it needs to be updated manually. We can download the latest version of wsl2 from Microsoft’s official website according to the prompt, and then open it normally.
Visit the link below to download and install the update:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
If the download is slow, use the Google browser to download, it is easy to use!
Install the latest version of wsl2:
reboot. run.
So far, most of them can run successfully. If not, there is the ultimate trick:
if you report an error at this time System.InvalidOperationException: Failed to set version to docker-desktop: exit code: -1
The error is as follows:
System.InvalidOperationException:
Failed to set version to docker-desktop: exit code: -1
stdout: �S��v�[a�{|�W
N/ec\Ջ�v�d\O0
stderr:
在 Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:行号 146
在 Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:Line 82
--- The end of the stack trace in the previous location where the exception was raised ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__26.MoveNext() 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:行号 104
--- The end of the stack trace in the previous location where the exception was raised ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:行号 29
--- The end of the stack trace in the previous location where the exception was raised ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:行号 67
--- The end of the stack trace in the previous location where the exception was raised ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:行号 92
We open cmd as an administrator:
enter:
netsh winsock reset
Execute, 100% solve this problem!
Note: This command should be used with caution. This is to delete the original docker system, which is equivalent to resetting docker-desktop. The images and containers in me are gone. Restarting docker-desktop will regenerate docker-desktop and docker-desktop-data
Read More:
- WSL 2 installation is incomplete Error [How to Solve]
- [Solved] System.InvalidOperationException: Failed to deploy distro docker-desktop……
- Transaction check error during docker CE installation [How to Solve]
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate has expired or is not yet valid
- Start Docker Quickstart Terminal error This computer is running Hyper-V. VirtualBox won’t boot a 64bits VM when Hyper-V is activated
- The spring project is normal locally, and the bean cannot be found error is thrown when entering the docker container
- [Solved] CentOS build a docker error: job for docker.service failed….
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- [Solved] error during connect: This error may indicate that the docker daemon is not running
- [Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…
- Docker service startup error: Job for docker.service failed because the control process exited with error code.
- [Solved] docker Error: bridge docker0 failed: exchange full
- [Solved] Docker Start Error: iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 10241
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- [Solved] Docker Error: Failed to connect to bus: Host is down
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/portainer/portainer/…
- Docker Create or Start Nginx Error: docker: Error response from daemon: driver failed programming external connectivity
- Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen is reported when docker port mapping or starting the container
- QtCreator Error: “member access into incomplete type QHeaderView“
- Linux C++ Error: invalid use of incomplete type [How to Solve]