Windows 10:无法运行 WSL(Ubuntu、Alpine、Docker)

Windows 10:无法运行 WSL(Ubuntu、Alpine、Docker)

在我的笔记本电脑(Dell Latitude 5590,Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz[核心 4] [逻辑处理器 8],BIOS v 1.16.0)上,运行 Windows 10(10.0.19042),我无法再启动 Ubuntu,也无法启动 Docker(Docker Desktop 3.2.2)。

WSL版本是5.4.72。

启动 Ubuntu,我得到:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8000000d
Error: 0x8000000d An illegal state change was requested.

Press any key to continue...

wslconfig 说:

> wslconfig.exe /list /all
Windows Subsystem for Linux Distributions:
docker-desktop
Ubuntu-20.04

如果我尝试清理/清除 Docker 的所有数据(从 Docker Desktop 的仪表板),或者重置为出厂设置,我会收到以下错误:

System.InvalidOperationException:
Failed to terminate distro: exit code: -1
 stdout: There is no distribution with the supplied name.


 stderr: 
   at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
   at Docker.Engines.WSL2.WSL2Provisioning.<TerminateDistroAsync>d__15.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 153
--- 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.<TerminateDistrosAsync>d__11.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 118
--- 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.<UnprovisionAsync>d__9.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 91
--- 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.<DoDestroyAsync>d__32.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 316
--- 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.DestroyTransition.<DoRunAsync>d__6.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\DestroyTransition.cs:line 39
--- 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.<DestroyAsync>d__16.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 90
--- 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.<RemoveDataAsync>d__24.MoveNext() in C:\workspaces\PR-15387\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 190

几天前系统还可以正常工作。我不知道发生了什么(可能是固件/操作系统/软件更新?)。

我已经尝试了以下方法,但都不起作用:

  • 卸载并重新安装 Ubuntu(20.04)-> 启动 Ubuntu 时,错误切换到:

     Installing, this may take a few minutes...
     WslRegisterDistribution failed with error: 0x800706be
     Error: 0x800706be The remote procedure call failed.
    
     Press any key to continue...
    
  • 尝试安装 Alpine WSL:出现同样的错误:

     Installing, this may take a few minutes...
     WslRegisterDistribution failed with error: 0x800706be
     WslRegisterDistribution failed
     Error: 0x800706be The remote procedure call failed.
    
     Press any key to continue...
    
  • 卸载并重新安装 Docker Desktop

  • 执行以下描述的过程:https://docs.microsoft.com/en-us/windows/wsl/install-win10

  • 重启我的机器

  • 验证 BIOS 设置中是否启用了 WSL 和 Hd 虚拟化

  • 从开始菜单中搜索“打开或关闭 Windows 功能”;验证“虚拟机平台”是否已启用

  • 在提升的 powershell 中运行以下一个或多个或全部操作:

     Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
     Dism /Online /Cleanup-Image /RestoreHealth
     wsl --unregister docker-desktop
     wsl --unregister docker-desktop-data
    
  • 推出此批次:

     net stop wuauserv
     net stop Cryptsvc
     ren %windir%\SoftwareDistribution sdold.old
     ren %windir%\system32\catroot2 crt2old.old
     net start wuauserv
     net start Cryptsvc
    
  • 卸载了 Ubuntu、Docker、WSL,具体内容如下https://pureinfotech.com/uninstall-wsl2-windows-10/,从头开始重新安装所有内容

  • 切换到 Windows 容器 -> 收到运行请求

     Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
    

    在提升的 PowerShell 中运行所需的命令 -> 成功切换到 Windows 容器;再次尝试切换到 Linux 容器 -> 没办法:Docker 继续运行 Windows 容器。

  • 在 powerShell 中,启动以下命令:

    Start-Service "Hyper-V Virtual Machine Management"
    Start-Service "Hyper-V Host Compute Service"
    
  • 更新 Docker Desktop 至版本 3.3.3

  • 在提升的命令提示符下运行以下命令:

     DISM.exe /Online /Cleanup-image /Restorehealth
     sfc /scannow
    
  • 推出时间:

     BCDedit /set hypervisorlaunchtype Off
    

    (也尝试过:

     bcdedit /set hypervisorlaunchtype auto
    

  • 推出时间:

     dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
    
  • 尝试以安全模式重启 Windows 并启动 Ubuntu -> 没有成功

  • 从仪表板更改了 Docker Desktop 的设置,禁用“使用基于 WSL 2 的引擎”->docker 可与 Linux 容器一起使用!(但这并不能解决问题)

  • 在互联网上搜索了其他解决方案 - >没有一个解决我的问题

有什么建议么?

相关内容