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
    • 最新
    • 标签
主页 / server / 问题 / 1169719
Accepted
Justin Dearing
Justin Dearing
Asked: 2025-01-03 01:28:28 +0800 CST2025-01-03 01:28:28 +0800 CST 2025-01-03 01:28:28 +0800 CST

WSL 发行版无法安装在 Windows Server Core 2025 上

  • 772

我在 Azure 上运行 Windows 2025 Server Core VM。我在其上运行了 Azure DevOps 构建代理、docker for Windows 容器和 powershell core。所有这一切都运行正常。

我运行了没有参数的 WSL 命令,并对安装 WSL 的提示说“是”。

然后我尝试安装 WSL:

PS C:\Users\azadmin> wsl --install Ubuntu-18.04
Downloading: Ubuntu 18.04 LTS
Installing: Ubuntu 18.04 LTS
PS C:\Users\azadmin> wsl
Windows Subsystem for Linux has no installed distributions.

Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install <Distro>' to install.

Distributions can also be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Error code: Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND

我做了一些研究,意识到我需要从 B 系列扩展到 D 系列,以便在Install-WindowsFeature Hyper-V出现故障时启用 Hyper-V 嵌套虚拟化。因此,我运行了以下命令并重新启动:

安装-Windows功能 Hyper-V、容器、DHCP

行为仍然没有改变。

我甚至启动了第二个全新的 Server Core VM 并验证了相同的行为。

在此处输入图片描述

** Windows 服务器 2022 **

我在最新更新的 Server 2022 中遇到了不同的错误Class not registered

PS C:\Users\azadmin> wsl --install -d ubuntu
Class not registered
PS C:\Users\azadmin> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
>>
OS Name:                   Microsoft Windows Server 2022 Datacenter Azure Edition
OS Version:                10.0.20348 N/A Build 20348
PS C:\Users\azadmin>

我甚至尝试过Install-WindowsFeature Microsoft-Windows-Subsystem-Linux。

所做的只是在输出中添加一行wsl --install

PS C:\Users\azadmin> wsl --install
Windows Subsystem for Linux is already installed.
Class not registered
PS C:\Users\azadmin>
windows
  • 1 1 个回答
  • 213 Views

1 个回答

  • Voted
  1. Best Answer
    Justin Dearing
    2025-01-08T10:32:13+08:002025-01-08T10:32:13+08:00

    如果您在 Hyper-V 中安装虚拟机,错误消息会好得多。例如,在 2003 年,在本地 Hpper-V 实例上,您会得到:

    PS C:\Users\Administrator> wsl --install -d debian
    wsl.exe --install is not supported on ServerCore and NanoServer.
    Please visit https://aka.ms/wslinstallservercore to learn more.
    PS C:\Users\Administrator>
    

    手动安装 WSL 包的方法是安装 appx 文件。例如:

    curl.exe -L https://aka.ms/wsl-debian-gnulinux -o debian.app

    下载可以使用 进行安装的 Debian 应用程序文件Add-AppxPackage。查看完整列表。

    不幸的是,Add-AppxPackage它不适用于服务器核心。

    > Add-AppPackage .\debian.appx
    Add-AppPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed. Please contact your software vendor.
    Deployment Add operation with target volume C: on Package
    TheDebianProject.DebianGNULinux_1.12.2.0_neutral_~_76v4gfsz19hv4 from:  (debian.appx)  failed with error 0x8007007F.
    See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
    NOTE: For additional information, look for [ActivityId] aee7e124-6172-0000-f658-e8ae7261db01 in the Event Log or use
    the command line Get-AppPackageLog -ActivityID aee7e124-6172-0000-f658-e8ae7261db01
    At line:1 char:1
    + Add-AppPackage .\debian.appx
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : WriteError: (C:\Users\Administrator\debian.appx:String) [Add-AppxPackage], IOException
        + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
    

    但是,appx 包只是一个 zip 文件,可以使用 Windows 附带的 tar.exe 版本解压。对于 WSL 包,它是一个嵌套的 appx 文件。您需要将 x64 appx 文件解压到 appx 文件内的某个位置,例如%USERPROFILE%\AppData\Local\DebianWSL

    解压下一个 appx 文件

    然后,您可以在刚刚创建的目录中查找 exe(在本例中为 debian.exe),然后运行它。然后您就有了 WSL。

    • 0

相关问题

  • 知道任何适用于 Windows 的快速可编写脚本的 ftp 客户端吗?[关闭]

  • 如果 Windows 服务崩溃,如何自动重新启动它?

  • 无法安排任务(访问被拒绝)

  • 物理机重启时自动重启虚拟机(VMWare)

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve