内容目录
CPUAMD R9
RAM128G
系统是 windows10,之前很久就装过 Docker Desktop ,也运行过几次 Demo 容器,突然有一天就显示用不了了,显示如下报错:
Docker Desktop - Unexpected WSL error An unexpected error occurred while executing a WSL command. Either shut down WSL down with wsl --shutdown, and/or reboot your machine. You can also try reinstalling WSL and/or Docker Desktop. If the issue persists, collect diagnostics and submit an issue . deploying WSL2 distributions ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "当前计算机配置不支持 WSL2。rn请启用“虚拟机平台”可选组件,并确保在 BIOS 中启用虚拟化。rn通过运行以下命令启用“虚拟机平台”: wsl.exe --install --no-distributionrn有关信息,请访问 https://aka.ms/enablevirtualizationrn错误代码: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLEDrn" output="docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:WindowsSystem32wsl.exe --import docker-desktop <HOME>AppDataLocalDockerwslmain C:Program FilesDockerDockerresourceswslwsl-bootstrap.tar --version 2: 当前计算机配置不支持 WSL2。 请启用“虚拟机平台”可选组件,并确保在 BIOS 中启用虚拟化。 通过运行以下命令启用“虚拟机平台”: wsl.exe --install --no-distribution 有关信息,请访问 https://aka.ms/enablevirtualization 错误代码: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED : exit status 0xffffffff checking if isocache exists: CreateFile wsl$docker-desktop-dataisocache: The network name cannot be found.
1. 检查过 BIOS 的 CPU 相关虚拟化设置是开启的
2. 检查过 Windows10 的启用相关设置中,hyperv 和 linux 相关虚拟化也是开启的
WSL 安装的是 debain 版本 2
后来我反复开关机玩了几次设置后,感觉还是虚拟化没有开启,就是说 Windows 的启用设置中显示的开启其实不是真的开启了,如果你也遇到一样的问题,你可以试一下
bcdedit /enum | findstr -i hypervisorlaunchtype
我这里显示的是
hypervisorlaunchtype Off
但是 windows 的设置显示的是

这就很恶心了,不知道是 GUI 的问题还是什么,解决方式就是通过命令行的方式进行开启
bcdedit /set hypervisorlaunchtype Auto
设置完检查一遍,确保

OK,重启电脑,再打开 Docker Desktop,正常启动