在执行 vagrant up 时启动 VM 时 Mac 上的 Vagrant VBoxManage 错误

Vagrant VBoxManage Error on Mac when booting a VM while executing vagrant up

每次我在 Mac 上执行 vagrant up 时,我都会收到以下错误:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "f0d41d96-6687-451e-b682-1ec409013b15", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'Block2Sem2_default_1619613054845_45024' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

我尝试重新安装 Vagrant 和 VirtualBox,但没有任何效果。

所以经过这么多时间我终于弄明白了:

在 Mac 上确保您的安全设置设置正确。 要检查,请转到 Security > Input-Monitoring > “接受 VirtualBox”。然后转到 Accessibility >“接受 AEServer”和“VirtualBox”。 然后重新加载你的 vagrant 机器,一切正常。

我在 Mac 命令中尝试 运行 'vagrant up' 时遇到了同样的错误,这就是我所做的:

单击:系统首选项 > 安全和隐私 > 解锁安全和隐私 > Select 允许访问 Oracle VirtualBox > 接受重新启动 Mac 的提示 > 重新启动后,返回到您的终端 > re运行 'vagrant up'.

希望这对您有所帮助。