VirtualBox:NS_ERROR_FAILURE (0x80004005)
环境:macOS11.0.1
1. 前言
macOS10.15.7升级最新的11.0.1过后,使用Vagrant创建CentOS7虚拟机启动提示如下错误。
You're running an up-to-date version of Vagrant!
yimt@MacBook-Pro centos7-docker % vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> 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", "517d8765-baba-4661-8aef-8f87cee74139", "--type", "headless"]
Stderr: VBoxManage: error: The virtual machine 'centos7-docker_default_1605406732336_15153' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
2. 解决方法
2.1. 重启VirtualBox
# 重启命令
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
# 提示
Loading VBoxDrv.kext
Extension with identifiers org.virtualbox.kext.VBoxNetFlt,org.virtualbox.kext.VBoxNetAdp,org.virtualbox.kext.VBoxDrv,org.virtualbox.kext.VBoxUSB not approved to load. Please approve using System Preferences.
Error: Failed to load org.virtualbox.kext.VBoxDrv
Loading VBoxUSB.kext
Extension with identifiers org.virtualbox.kext.VBoxDrv,org.virtualbox.kext.VBoxNetFlt,org.virtualbox.kext.VBoxNetAdp,org.virtualbox.kext.VBoxUSB not approved to load. Please approve using System Preferences.
Error: Failed to load org.virtualbox.kext.VBoxUSB
Loading VBoxNetFlt.kext
Extension with identifiers org.virtualbox.kext.VBoxNetAdp,org.virtualbox.kext.VBoxDrv,org.virtualbox.kext.VBoxNetFlt,org.virtualbox.kext.VBoxUSB not approved to load. Please approve using System Preferences.
Error: Failed to load org.virtualbox.kext.VBoxNetFlt
Loading VBoxNetAdp.kext
Extension with identifiers org.virtualbox.kext.VBoxUSB,org.virtualbox.kext.VBoxDrv,org.virtualbox.kext.VBoxNetAdp,org.virtualbox.kext.VBoxNetFlt not approved to load. Please approve using System Preferences.
Error: Failed to load org.virtualbox.kext.VBoxNetAdp
Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxNetAdp
Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxNetFlt
Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxUSB
Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxDrv
Fatal error: VirtualBox
2.2. 检查重启失败提示
不同原因可能提示不同按照自己失败的原因去查找解决方案
Please approve using System Preferences.
提示需要去系统首选项授权,也就是:系统偏好设置->安全与隐私->通用。里面有提示需要允许VirtualBox执行一些特殊操作,我这里面允许过后是提示需要重启,重启完成就可以正常操作。