启动桌面Docker提示虚拟服务未启动
在启动 Docker Desktop 时,可能会遇到以下提示:
Docker Desktop - Virtual Machine Platform not enabled
Virtual Machine Platform not enabled
该错误通常是由于 Windows 未启用 “Virtual Machine Platform” 功能导致的,这是运行 Docker Desktop(特别是基于 WSL 2 的后端)所必需的组件。
使用 PowerShell 命令启用 Virtual Machine Platform 并重启计算机。可以通过 DISM
或 Enable-WindowsOptionalFeature
命令来启用 Virtual Machine Platform。
解决方案 1:使用 DISM 命令
以管理员身份运行 PowerShell 执行以下命令启用 Virtual Machine Platform:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
解决方案2:使用 PowerShell Enable-WindowsOptionalFeature 命令
同样,以管理员身份运行 PowerShell,执行以下命令:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart
重启计算机 以应用更改:
Restart-Computer
重启计算机后,再次启动 Docker Desktop,错误提示应消失。如果仍然遇到问题,检查 BIOS 设置是否已启用虚拟化技术(VT-x 或 AMD-V)。
启用 Virtual Machine Platform 是运行 Docker Desktop 的前提条件之一。可以使用 DISM
或 Enable-WindowsOptionalFeature
命令来快速启用该功能,确保在 BIOS 里启用了虚拟化技术,并在操作完成后重启计算机以应用更改。