windows安装ubuntu时错误WslRegisterDistribution failed with error: 0x8007023e的解决方法

cmd或者powershell安装,或者打开linux时 莫名的出现了如下错误:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8007023e
Error: 0x8007023e {
    
    Application Error}
The exception s (0x

尝试了很多的方法都不可以,终于尝试了如下方法,或许对你有效

  1. 确保在 BIOS 中启用了虚拟化。(此步我未做设置,盲猜应该是开着的,因为之前是好用的突然不行了)
  2. 确保 Windows 映像和操作系统运行良好。
  3. 记下/备份所有 Hyper-V 设置!(我竟然未备份,下次一定要记住,以防万一)
  4. 删除所有虚拟机功能。 这就是:Hyper-V、容器、虚拟机平台、Windows Hypervisor 平台、Windows 沙盒和适用于 Linux 的 Windows 子系统。对应的选项去掉即可。

在这里插入图片描述

  1. 重启电脑!

  2. 之后使用wsl --set-default-version 2 设置为 wsl2

  3. 使用命令wsl --install进行安装,若出现错误0x80370114,那么执行命令Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All 输入y即可
    在这里插入图片描述

  4. 重启后,执行wsl --install可以了

PS C:\WINDOWS\system32> wsl --install
Ubuntu 已安装。
正在启动 Ubuntu...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: ***
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This message is shown once a day. To disable it please create the

猜你喜欢

转载自blog.csdn.net/MMTS_yang/article/details/129997559
今日推荐