The solution to the error WslRegisterDistribution failed with error: 0x8007023e when installing ubuntu on windows

The following error occurred inexplicably when installing cmd or powershell, or opening linux:

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

Tried a lot of methods but failed, finally tried the following method, maybe it will work for you

  1. Make sure virtualization is enabled in BIOS. (I didn’t make any settings at this step, blindly guessing it should be on, because it was easy to use before and suddenly it didn’t work)
  2. Make sure the Windows image and operating system are working fine.
  3. Take note/backup of all Hyper-V settings! (I didn't even back it up, I must remember it next time, just in case)
  4. Remove all virtual machine capabilities. That is: Hyper-V, Containers, Virtual Machine Platforms, Windows Hypervisor Platform, Windows Sandbox, and Windows Subsystem for Linux. The corresponding option can be removed.

insert image description here

  1. Restart the computer!

  2. After that wsl --set-default-version 2set to wsl2 using

  3. Use the command wsl --installto install, if there is an error 0x80370114, then execute the command Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -Alland enter y
    insert image description here

  4. After restarting, it wsl --installcan be executed

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

Guess you like

Origin blog.csdn.net/MMTS_yang/article/details/129997559