我只是在 Windows 2019 服务器上安装 docker 来运行 linux 容器。
我关注这个 guide ,“在 Windows Server 2019 上运行 Linux 容器”一章。
当我尝试运行 bash shell 时,出现以下错误:
docker.exe: failed to register layer: failed to start service utility VM (applydiffe53547ea1d150a4e4afba05378a3a45be5ea769d52fddf03ff25dbd09e43d20d): container e53547ea1d150a4e4afba05378a3a45be5ea769d52fddf03ff25dbd09e43d20d_svm encountered an error during CreateContainer: failure in a Windows system call: The virtual machine could not be started because a required feature is not installed.
Get-VM WinContainerHost | Set-VMProcessor -ExposeVirtualizationExtensions $true
Get-VM : Hyper-V was unable to find a virtual machine with name "ContainerHost".
最佳答案
抱歉,我没有足够的声誉来评论/询问更多信息。
Hyper-V containers or Moby VM运行 Linux 容器时是必需的——运行这些容器需要虚拟化。所以在这种情况下,你不能使用“服务器容器”。
启用 VT-x 例如来自 BIOS 的虚拟化 - 嵌套虚拟化的强制要求。使用 AWS,您需要 Bare Metal instance .
如果这些都可以,您可以尝试已经提到的命令
Get-VM *WinContainerHost* | Set-VMProcessor -ExposeVirtualizationExtensions $true
Get-VM
命令应该列出所有虚拟机,输出是什么?Install-WindowsFeature -Name Hyper-V,Containers -IncludeAllSubFeature -IncludeManagementTools
https://stackoverflow.com/questions/58289749/