AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1434150
Accepted
Ian Blixt
Ian Blixt
Asked: 2022-10-07 11:47:28 +0800 CST2022-10-07 11:47:28 +0800 CST 2022-10-07 11:47:28 +0800 CST

WSL Ubuntu 安装失败并出现错误:“请使用以下命令重新启动 WSL...”

  • 772

我第一次尝试在我的笔记本电脑上运行 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
windows-subsystem-for-linux
  • 1 1 个回答
  • 1230 Views

1 个回答

  • Voted
  1. Best Answer
    NotTheDr01ds
    2022-10-07T18:54:20+08:002022-10-07T18:54:20+08:00

    是的,您似乎确实在固件中启用了虚拟化,正如您所指出的:

    Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                               Virtualization Enabled In Firmware: Yes
    

    但是您似乎没有启用虚拟机平台 (VMP)。它应该在初始时启用wsl --install,但看起来出了点问题。

    在启用了 VMP(或 Hyper-V)的 Windows 11 系统上,您会看到systeminfo.exe结果略有不同:

    Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
    

    虽然下一个建议不太可能解决问题(但我们可以希望),但它至少可以为我们提供关于为什么未启用 VMP 的线索。

    从管理 PowerShell 运行:

    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    

    从手动安装 - 步骤 3 - 启用虚拟机功能

    然后重启机器。

    在重新启动期间密切注意可能出现的任何错误消息。如果在重新启动过程中一切正常,请从非管理员 PowerShell 尝试:

    wsl --set-default-version 2
    

    紧随其后wsl --install -d Ubuntu。

    • 1

相关问题

  • 如何在 Windows 上重置我的 Ubuntu 安装?

  • Linux 的 Windows 子系统中的 Ubuntu 文件系统根目录在哪里,反之亦然?

  • 新的“Windows 10 上的 Bash”如何真正发挥作用?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve