admin管理员组

文章数量:1650765

报错情况

Containers Windows Feature is not available
   在 CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable()
   在 CommunityInstaller.EnableFeaturesAction.<DoAsync>d__29.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__29.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 CommunityInstaller.InstallWorkflow.<ProcessAsync>d__24.MoveNext()
   

解决方法:
把Hyper-V.bat文件内修改成

pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause

管理员运行,重启安装即可。
注:有的教程里没有加pause导致报错

本文标签: 报错DockercontainersfeatureWindows