wsl ubuntu安装报错 0x80370102解决

时间:2025-03-21 12:38:06

记录wsl踩坑

win10 系统,由于之前装过又卸过一次wsl,此次装wsl2和Ubuntu20.04的时候踩了一些坑,在此记录一下。主要报错代码为 0x80370102。

检查电脑配置

  1. 系统版本 :start+R, 输入winver查看,版本为19045,符合大于1903要求。
  2. CPU虚拟化:任务管理器 -性能-cpu查看,确认已启用。
  3. 检查windows相关功能是否启用:包括Hyper-V, Virtual Machine Platform 和Windows subsystem for linux.
    发现找不到Hyper-V, 按照教程创建空白txt文件,重命名为并以管理员权限运行。(等待时间较长)
pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >

for /f %%i in ('findstr /i .  2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del 

Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

但是问题依旧没有解决

继续检查hyper-v

命令行中输入

bcdedit

发现hypervisorlaunchtype 处于off状态
于是执行以下命令开启

bcdedit /set hypervisorlaunchtype Auto

继续尝试ubuntu安装,进入账户设置界面,问题解决