2026年7月21日 星期二

VirtualBox 不能勾選 Nested/VT-x AMD-V

VirtualBox 安裝 CentOS 10 時出現「Warning: Deprecated Hardware is detected: x86_64-v2: AuthenticAMD: AMD Ryzen 7 3700X 8-Core Processor will not be maintained in a future major release and may be disabled」錯誤訊息。


原因是 Nested VT-x/AMD-V 巢狀虛擬化功能沒勾選。

如果 CPU 有支援,但在 VirtualBox 不能勾選 Nested VT-x/AMD-V 巢狀虛擬化功能,有兩種可能,
一種是 BIOS 沒開啟該功能,一種是被 Windows Hyper-V 占用。

我在華碩主機板已開啟虛擬化功能 (SVM Mode),系統各種查看工具也都顯示已開啟 AMD-V,
但 VirtualBox 仍不能勾選 Nested VT-x/AMD-V



系統資訊均顯示已開啟 AMD-V 




想起不久前裝過 Docker Desktop,原來 Docker Desktop 依存在 WSL 底下,最新版的 WSL 2 會使用 Hyper-V 架構的子集來啟用其虛擬化,所以我裝了 Docker Desktop 後,AMD-V 就被占用了。

解決方法是,使用 BCDEdit 指令,將 hypervisorlaunchtype 設定為 off (預設值為 auto)
這個指令須用管理員身分開啟 cmd 執行,重開機後生效
若只輸入 BCDEdit,等同 BCDEdit /enum,可用來查看目前設定值 
BCDEdit /set hypervisorlaunchtype off


其他:
  • 網上有些資料說用 VBoxManage.exe modifyvm "CentOS10" --nested-hw-virt on 指令,可開啟 VirtualBox 裡的  Nested VT-x/AMD-V 設定。
    實測後,應該只是介面上看起來開啟了,但實際沒開啟
    實際上有無開啟,可查看虛擬機右下角資訊

  • 網上也有從修改 Windows 功能開關的修改方式,但我沒測試,我用 BCDEdit 修改前後,看起來是都沒變


  • VirtualBox 可以用 Nested VT-x/AMD-V 巢狀虛擬化功能後,會變成  Docker Desktop 不能用


    原本







參考:

沒有留言:

張貼留言