使用 VirtualBox 时,发现无法关闭 Hyper-V。

轲 金 5 信誉分
2025-10-04T21:15:50.02+00:00

我在使用VirtualBox时发现无法调用Hyper-V(显示龟速模式,Execution Engine:native API),使用以下ps1代码发现Hyper-V已被占用:

# 检查 Hyper-V/Hypervisor 占用情况
Write-Host "=== Hypervisor 检测脚本 ===`n"
# Step 1: 检查 systeminfo
Write-Host "[1] 检查 systeminfo..."
$sysinfo = systeminfo | findstr /i "Hyper-V"
if ($sysinfo -match "已检测到虚拟机监控程序") {
    Write-Host "⚠ 已检测到 hypervisor (可能占用了 VT-x/AMD-V)"
} else {
    Write-Host "✅ 未检测到 hypervisor,可以被 VirtualBox 使用"
}
Write-Host $sysinfo "`n"
# Step 2: 检查 bcdedit 配置
Write-Host "[2] 检查 bcdedit..."
$bcd = bcdedit /enum {current}
$hvsetting = $bcd | findstr hypervisorlaunchtype
if ($hvsetting) {
    Write-Host "bcdedit 配置: $hvsetting"
} else {
    Write-Host "bcdedit 配置: 未显式设置 (默认=Auto)"
}
Write-Host ""
# Step 3: 检查常见占用进程
Write-Host "[3] 检查常见占用虚拟化的进程..."
$procs = "vmmem","vmmemWSL","qemu-system-x86_64","Bluestacks","LdVBoxHeadless","NemuHeadless"
foreach ($p in $procs) {
    $running = Get-Process -Name $p -ErrorAction SilentlyContinue
    if ($running) {
        Write-Host "⚠ 检测到进程: $p (可能占用虚拟化)"
    }
}
Write-Host "进程检查完成。`n"
# Step 4: 建议动作
Write-Host "[4] 建议动作:"
if ($sysinfo -match "已检测到虚拟机监控程序") {
    Write-Host "👉 建议运行: bcdedit /set hypervisorlaunchtype off"
    Write-Host "   然后重启电脑,再次运行本脚本确认。"
} else {
    Write-Host "✅ 系统没有加载 hypervisor,可以直接运行 VirtualBox。"
}

输出如下:

User's image 我尝试过运行bcdedit的指令。

然后我尝试在Windows功能中关闭Hyper-V相关的功能后重启还是不行,于是我使用以下代码再次下载HpyerV并重新关闭依旧不能让VB摆脱龟速模式:

pushd "%~dp0"

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"

del hyper-v.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

我该怎么做才能关闭Hyper-V?

开发人员技术 | 通用 Windows 平台 (UWP)
0 个注释 无注释
{count} 票

1 个答案

排序依据: 非常有帮助
  1. 好事不留名 0 信誉分
    2025-10-22T14:51:58.34+00:00

    最彻底的方法:
    把Hyper-V功能直接关掉

    English

    The most thorough method:

    Turn off the Hyper-V feature directly

    0 个注释 无注释

你的答案

问题作者可以将答案标记为“接受的答案”,这有助于用户了解已解决作者问题的答案。