You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure虚拟机安装Docker Desktop 4.17.0时WSL2配置报错求助

问题描述

在Azure虚拟机上安装Docker Desktop 4.17.0时,需完成WSL2配置作为前置条件,但安装Ubuntu过程中出现以下错误:

Installing: Ubuntu
Ubuntu has been installed.
Launching 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...
The installation process for distribution 'Ubuntu' failed with exit code: 1.
Error code: Wsl/InstallDistro/WSL_E_INSTALL_PROCESS_FAILED
PS C:\Windows\system32>

根据错误提示中的指导,尝试使用Set-VMProcessor -VMName -ExposeVirtualizationExtensions $true命令,但该Cmdlet在当前虚拟机上不可用。询问该Cmdlet能否单独安装,还是属于虚拟机创建阶段的管理员限制?

解决方案与说明
  • Set-VMProcessor属于Hyper-V模块中的Cmdlet,无法单独安装,它是Hyper-V管理工具集的一部分,只有系统安装了Hyper-V角色或Hyper-V管理工具后才能调用,但这不是解决Azure VM上WSL2问题的关键。
  • 在Azure虚拟机场景下,该命令不可用的核心原因是:Azure VM本身运行在Hyper-V虚拟化层之上,要在这类嵌套虚拟化环境中启用WSL2,必须在创建Azure虚拟机时就开启嵌套虚拟化选项,无法在VM创建完成后通过该Cmdlet补配置。
  • 具体解决步骤:
    1. 确认当前Azure VM的实例规格是否支持嵌套虚拟化(通常需要Dv3、Ev3及以上系列的VM实例)。
    2. 若当前VM不支持或未开启嵌套虚拟化,可删除现有VM并保留磁盘,重新创建VM时,在配置选项中启用"嵌套虚拟化";也可通过Azure PowerShell或CLI创建时添加参数-EnableNestedVirtualization $true。
    3. 重新创建VM后,启用Windows系统的"Virtual Machine Platform"和"Windows Subsystem for Linux"可选功能,再重新配置WSL2和安装Ubuntu。

内容的提问来源于stack exchange,提问作者Prabal Rakshit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 11:42:38