我正在mac上使用vagrant运行虚拟机镜像。在我更新到最新的Mac版本(12.0.1 Monterey)之前,一切都正常。
当我尝试使用vagrant up启动虚拟机时,出现以下错误:
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
如果我进入虚拟机(mac应用程序virtualbox)并在那里启动它,我也会遇到错误(只是说无法启动该虚拟机)。 如果我进入主机网络管理器部分
因此,主机-only适配器似乎存在问题。
经过一番探索和查看其他人的问题和解决方案后,我尝试了以下操作:
- 允许安全和隐私设置中的Oracle,但此设置未出现
- 运行一个重新启动virtualbox的命令(不记得具体内容了,请见谅 :/)
- 重新安装virtualbox
- 安装来自virtualbox(6.1)的测试构建版
- 将virtualbox添加到完整磁盘权限中
- 在vagrantfile中添加以下代码,取自vagrant文档:
config.vm.provider "virtualbox" do |v|
v.gui = true
end
每次我尝试安装virtualbox时,都会出现设置失败的错误提示。但图标又重新出现了。
这是什么问题?如何解决?