环境: Macos11.4 Beta 上使用vagrant
问题: 安装vagrant后运行 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: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 95 of file VBoxManageHostonly.cpp

image.png

解决

1.进入System Preferences -> 点击左下角🔐图标使其处于开启状态 -> 点击Allow

Screen Shot 20210428 at 4.33.59 PM.png

2.然后弹出要求重新启动对话框,重启后,即可正常使用vagrant

Screen Shot 20210428 at 4.34.33 PM.png

Q.E.D.