win11DevEco5鸿蒙模拟器无法开启,提示未开启Hyper-V,开启Hyper-V后依然报未开启Hyper-V的提示,导致无法打开模拟器的解决方案
启动鸿蒙模拟器的时候,报这个错
需要在控制面板> 程序 > 程序与功能 > 启动或关闭Windows功能,开启这三个
如果你是win11家庭版,没有Hyper-V,那就在桌面新建一个文本文档,重命名为Hyper-V Installer.cmd
然后使用编辑,将以下代码粘贴进去,并保存
pushd "%~dp0"
dir /b %SystemRoot%servicingPackages*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%servicingPackages%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
然后右键,使用管理员身份运行,运行完成后重启电脑。
如果重启后,并且3个功能都开启了,依然显示未开启Hyper-V:
在命令提示符里面输入
bcdedit /set hypervisorlaunchtype off
然后重启
重启后输入
bcdedit /set hypervisorlaunchtype Auto
再重启,打开模拟器,就可以正常打开了