virtualBox 不能为虚拟电脑打开一个新任务Failed to get device handle and/or partition ID
C:\Users\Administrator>vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Checking if box ‘centos/7’ version ‘2004.01’ is up to date…
==> default: Clearing any previously set forwarded ports…
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
==> default: Forwarding ports…
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM…
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: [“startvm”, “3ee0ca4d-8f34-4107-9dbb-10c2f329704c”, “–type”, “headless”]
Stderr: VBoxManage.exe: error: Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE).
VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
原因:
1, 开启了hyper-v
2, 使用wsl时开启虚拟机
解决办法
1、关闭hyper-v,用命令或见下图操作。 (命令:以管理员启动 powershell,执行:bcdedit /set hypervisorlaunchtype off)
2、关闭wsl虚拟机(重点)。
以管理员启动 powershell,执行:
Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
重新启动电脑之后再次打开虚拟机, 可以成功启动
更多详细信息可以参考原文链接:https://blog.csdn.net/weixin_43431218/article/details/126582968