我第一次尝试在我的笔记本电脑上运行 Linux 程序。我的机器运行的是 Windows 11。我遵循了在 WSL 上安装 Ubuntu 的在线指南,例如此处的指南:
https://learn.microsoft.com/en-us/windows/wsl/install
https://learn.microsoft.com/en-us/windows/wsl/install-manual
https://learn.microsoft.com/en-us/windows/wsl/setup/environment
但是当我安装 Ubuntu 时,出现下图中的错误:
这是我一直在运行以尝试解决的命令。
确认 WSL 已安装:
PS C:\Users\User> wsl --install
Windows Subsystem for Linux is already installed.
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'.
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
SLES-12 SUSE Linux Enterprise Server v12
SLES-15 SUSE Linux Enterprise Server v15
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
OracleLinux_8_5 Oracle Linux 8.5
OracleLinux_7_9 Oracle Linux 7.9
PS C:\Users\User> wsl -l -v
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
安装 Ubuntu,启动,获取附件图像中的错误消息。按照该错误消息中的命令说明进行操作:
PS C:\Users\User> wsl --shutdown
PS C:\Users\User> wsl --unregister Ubuntu
Unregistering...
There is no distribution with the supplied name.
手动卸载 Ubuntu:
PS C:\Users\User> wsl --install -d Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...
在单独的 Ubuntu 外壳中:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization
Press any key to continue...
我已经启用了虚拟化,并通过以下方式确认systeminfo.exe
:
PS C:\Users\User> systeminfo.exe
...
Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes