Optimize-VHD未找到或已删除



我启用了WSL2。我正在尝试使用

收缩Docker磁盘
Optimize-VHD -Path $Env:LOCALAPPDATADockerwsldataext4.vhdx -Mode Full

但是我得到错误:

Optimize-VHD : Hyper-V encountered an error trying to access an object on computer 'XXXXX' because the object was not
found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is runnin
g.
At line:1 char:1
+ Optimize-VHD -Path .ext4.vhdx -Mode Full
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (:) [Optimize-VHD], VirtualizationException
+ FullyQualifiedErrorId : ObjectNotFound,Microsoft.Vhd.PowerShell.Cmdlets.OptimizeVhd

需要重建Windows vm文件。以admin权限运行:

mofcomp.exe %SYSTEMROOT%System32WindowsVirtualization.V2.mof

相关内容

  • 没有找到相关文章

最新更新