<OS 有关> Docker.Desktop - Unexpected WSL error #14030 不能启动, 问题已经解决 fixed

Windows Docker.Desktop 想用时报错:

"deploying WSL2 distributions ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "WSL2 is not supported with your current machine configuration.

Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS.

Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution

For information please visit https://aka.ms/enablevirtualization\\r\\nError code: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED" output="docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --import docker-desktop <HOME>\AppData\Local\Docker\wsl\main C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar --version 2: WSL2 is not supported with your current machine configuration.

Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS.

Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution For information please visit https://aka.ms/enablevirtualization

Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED : exit status 0xffffffff checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found."

以上是我看到的报错信息。 【重排一下段落,添加下面一段 on 7oct24 pm]

这个case发现到写完这个doc已经用了数小时,在 GOOGLE 里看了一下,绝大部分"Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution" 有这段话的 wsl2 有关的报错,其实都是 WSL2 不能启动,有可能是 Hyper-V 被OS禁用,或是 WSL 2 没有安装 Ubuntu 内核 DD 无法调用Linux, 用下面的方法都应该能解决的。

分析:

为什么会这样?

跟我禁用Hyper-V有关???

之前我在给VM添加VT-x时,曾用命令:

复制代码
bcdedit /set hypervisorlaunchtype off

禁用了 Hyper-V 这个虚拟化功能,因为它与VT-x冲突。

参见:我另一篇文章:

<OS有关> 升级 Windows 10 到 Windows 11 in VMware Workstations 16pro_vm16升17-CSDN博客文章浏览阅读600次,点赞14次,收藏9次。windows10 升级 windows 11 在vmware workstation 16上_vm16升17https://blog.csdn.net/davenian/article/details/142502104

很好奇

Docker.Desktop是用WSL 2(理解为一个虚拟机,在运行Ubuntu)

Docker.Desktop x86_64 安装版,是有 WSL2Hyper-V 两个版本, 我下载的是前者, 我理解WSL2是不支持Hyper-V., 在它的文档也有体现。

Docker.Desktop x86 下载位置:

https://docs.docker.com/desktop/install/windows-install/#system-requirementshttps://docs.docker.com/desktop/install/windows-install/#system-requirements

Dockers.Desktop 虚拟化设置的要求:

Common topics | Docker DocsExplore common troubleshooting topics for Docker Desktophttps://docs.docker.com/desktop/troubleshoot/topics/#virtualization所以我禁用了 Hyper-v在OS层面上。

解决方法:

什么是WSL 2?

Windows Subsystem for Linux 2, 这个是第二版,WSL是Microsoft 提供的一种功能,它允许用户在 Windows 系统上运行原生的 Linux 内核和 Linux 应用程序。

如何安装 WSL 2

powershell 以管理员运行

复制代码
wsl --install

可以看到, 安装 有Ubuntu, 如果没有,只是一闪返回,可以尝试手动安装 Ubuntu, 命令如下:

复制代码
wsl --install -d Ubuntu 

现在我理解为:Docker.Desktop就是要用到Ubuntu系统运行来模拟Linux,WSL 2是虚拟化系统,功能等同于Vmware workstation,就是精简。

必须有的Windows 功能清单

  1. Virtual Machine Platform
  2. Windows Subsystem for Linux
  3. BIOS 启用 CPU 的虚拟化

optionalfeatures 命令

打开 Windows Features 菜单,在这里红框内的必须安装。 我测试时,也"勾选"了Hyper-V(绿框)可以不用。

在上面的第三个链接有提到 "Hypervisor enabled at Windows startup", 我之前已经禁用 Hyper-V, 那再启用它:

复制代码
bcdedit /set hypervisorlaunchtype auto

总结:

因为在Windows 11上关闭了 Hyper-V,造成WSL 2不能启动。 网上找有注销 WSL 再启动D.D,还有看报错内容提示: wsl.exe --install --no-distribution 安装WSL,而不附带Linux,显然都不行。

检查清单:

  1. BIOS 打开 虚拟化
  2. Hyper-V 不能在OS上禁用
  3. WSL安装后,要有Ubuntu

以上 是以Docker.Desktop x86_64 WSL 安装版本为例的。

对了,看系统有没有启用虚拟化看"系统的任务管理器 / Task manager" 绿框部分

结果

如启用了 Hyper-V, Vmware workstaion 里的是虚拟机们,就不能用 VT-x 这些虚拟化加持, 要做个取舍。

我?拿出一个VM跑 Docker.Desktop,我还有NAS 上面也有Docker/Container.。

在CMD里 as administor, 果断执行: bcdedit /set hypervisorlaunchtype off 重启电脑。

以上都是涉及到系统层面的修改,都需要重启Windows 才能生效

相关推荐
XIAOHEZIcode1 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220702 天前
如何搭建本地yum源(上)
运维
武子康2 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
大树885 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠5 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质5 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
Inhand陈工5 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
Alsn865 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
酣大智5 天前
ARP代理--工作原理
运维·网络·arp·arp代理
shushangyun_5 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化