Windows 已占 VT-x 的终极排查与根治手册
Windows 已占 VT-x 的终极排查与根治手册
症状:
- BIOS 里 Intel VT-x / AMD SVM 已 Enabled
- 任务管理器 → CPU → 虚拟化:已启用
- 可 VMware / VirtualBox / 安卓模拟器仍报 “VT-x not available”
- PowerShell 执行
Get-ComputerInfo | findstr HyperVisorPresent
返回 True结论:Windows 自己把 CPU 虚拟化指令集抢走了。只要让上面那行变成 False,虚拟机就能立即硬件加速启动。
一、先判断是谁在占用
管理员 PowerShell 一句话:
Get-ComputerInfo | findstr HyperVisorPresent
- True → 继续按本文操作
- False → 问题不在 Windows,回头检查 BIOS、CPU 微码、第三方杀毒/模拟器
二、一次性卸载所有能抢 VT 的 Windows 组件
- 用管理员权限打开 Windows Terminal / PowerShell
- 复制整段执行(支持 Win10/11 全版本):
# ① 卸功能
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V,Microsoft-Hyper-V-Tools,Microsoft-Hyper-V-Management-PowerShell,VirtualMachinePlatform,Microsoft-Windows-Subsystem-Linux -NoRestart# ② 关 VBS / Device Guard / Credential Guard
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "EnableVirtualizationBasedSecurity" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "RequirePlatformSecurityFeatures" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard" /v "Enabled" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 0 /f# ③ 关 HVCI 并加启动锁
bcdedit /set hypervisorlaunchtype off
bcdedit /set vm No
bcdedit /set loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set vsmlaunchtype Off# ④ 禁用全部 Hyper-V 驱动
$hvDrivers = @("bttflt","gencounter","hyperkbd","HyperVideo","storflt","vmgid","vpci","vpcivsp","hypervisor")
foreach ($drv in $hvDrivers) {sc.exe config $drv start= disabledStop-Service $drv -Force -ErrorAction SilentlyContinue
}# ⑤ 如装过 WSL2,也卸掉
wsl --shutdown
wsl --unregister Ubuntu # 有别的发行版就逐个 unregister
- 重启电脑
三、重启后验证
Get-ComputerInfo | findstr HyperVisorPresent
看到 False 即成功;True 说明仍有漏网之鱼,继续第 4 步。
四、常见漏网点速查
场景 | 额外动作 |
---|---|
Windows 安全中心 → 设备安全性 → 内核隔离 → 内存完整性 | 必须 关闭 |
企业版/教育版加过域 | 组策略可能强制开 Device Guard,需让管理员把对应 GPO 设 Disabled |
360、火绒、瑞星 “核晶/晶核” 防护 | 设置里关掉 VT 防护 或干脆卸载 |
安卓模拟器(蓝叠、雷电、MuMu) | 设置 → 引擎 → 关闭 VT 兼容模式,退出后仍要卸载虚拟网卡驱动 |
主板 BIOS 隐藏开关 | 笔记本再检查 Kernel DMA Protection、Thunderbolt Security Level → 设 Disabled |
五、最终绿灯检查
-
LeoMoon CPU-V(绿色小工具)
三行全绿即可:- This CPU supports hardware virtualization: Yes
- Hardware virtualization is enabled: Yes
- Locked by BIOS/Firmware: No
-
或命令行再确认
Get-ComputerInfo | findstr HyperVisorPresent
返回 False 收工。
六、如果还是 False 不了
# 1. 仍在运行的带 hyper 字样的驱动
Get-WmiObject Win32_SystemDriver | Where-Object {$_.State -eq "Running" -and $_.DisplayName -like "*hyper*"} | Format-Table Name, DisplayName# 2. BCD 完整输出
bcdedit /enum
基本可以定位到具体是哪个驱动或策略又把 hypervisor 拉起来,再对症处理即可。
七、一句话总结
只要 HyperVisorPresent
变成 False
,VMware、VirtualBox、安卓模拟器就会立刻拿到 VT-x/AMD-V,报错瞬间消失。
按本文脚本一次性执行,90% 的机器重启即可根治,再也不用翻箱倒柜找 BIOS 开关。祝排障顺利,虚拟化愉快!