记一次windows上docker启动失败
参考:https://blog.gitcode.com/0281edc88b9bf109b573418cd1201d52.html
@
概要
写的太乱了,ai帮整理了下
🧾 事件背景(用户描述)
前几天为了清理 C 盘空间,卸载了很多软件,不确定是否误删了系统关键组件。
今天尝试启动 Docker Desktop 时遇到报错:
深色版本
wsl update failed: update failed: updating wsl: exit code: 1:
running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --update --web-download: : exit status 1
🔧 报错处理过程 & 尝试操作
1️⃣ 查询得知需要安装 WSL 并启用 Hyper-V 功能
于是前往 “开启 Windows 功能” 中查找 Hyper-V,但没有找到。
根据教程执行命令:
powershell
深色版本
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
重启电脑后,“Hyper-V” 出现在功能列表中。
再次尝试打开 Docker Desktop,仍然提示需要安装 WSL。
2️⃣ 安装 WSL
查询得知 Docker 需要 WSL 支持,于是前往 Microsoft Store 下载 Ubuntu 发行版。
尝试多个版本均失败,报错如下:
深色版本
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 ???????????
即使尝试推荐的 Ubuntu 18.04 也无效。
3️⃣ 尝试手动安装 WSL 更新包
从网上下载 WSL 内核更新包(如 wsl.2.1.5.0.x64.msi),点击安装后直接结束,并报错:
深色版本
The path 'C:\Users\Administrator\AppData\Local\Temp\wsl.2.1.5.0.x64.msi' cannot be found.
Verify that you have access to this location and try again...
百度搜索结果大多只是引导到 Microsoft Store 安装。
4️⃣ 最终解决方案:使用 winget 安装 WSL
参考某篇文章建议,执行以下命令安装 WSL:
powershell
深色版本
winget install Microsoft.WSL
然后重启电脑,重新打开之前下载的 Ubuntu 版本,进度条开始运行,最终安装成功!
再次启动 Docker Desktop,一切正常!🎉
小结
不要什么都问ai,网页查问题也蛮重要的
 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号