学习docker的时候,想在windows上面弄个来玩玩。准备开启hyper-v 这个windows功能的时候发现windows家庭版默认都没有hyper-v,只有专业版和企业版有。于是上网找教程。
网上给出的办法就是使用一个命令行脚本,原理不明,将以下代码保存为.cmd文件。
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL