【发布时间】:2021-11-23 21:23:27
【问题描述】:
我正在运行带有 Vagrant 2.2.19 和 VirtualBox 6.1.30 的 Mac OSX Monterey 12.0.1。当我尝试使用vagrant up 通过 mac 终端启动 Vagrant 时。返回此错误消息:
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Checking if box 'laravel/homestead' version '11.5.0' is up to date...
==> homestead: Clearing any previously set network interfaces...
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
我已经尝试卸载并重新安装 VirtualBox 和 Vagrant 以及重新启动 OSX,但我仍然收到与上述相同的消息。
在我寻找答案的过程中,我不断收到将其添加到我的 Vagrantfile 的建议,但我不确定它需要插入到哪里,因为它目前没有在我的文件中,也没有人说明在插入文件:
config.vm.provider "virtualbox" do |v| v.gui = true end
另外,在 Vagrant 的代码库中,我发现这个 sn-p (https://github.com/hashicorp/vagrant/blob/5b501a3fb05ed0ab16cf10991b3df9d231edb5cf/plugins/providers/virtualbox/driver/base.rb) 表明它可能是需要安装或正确安装的内核驱动程序。但我没有找到有关驱动程序安装的任何参考。
if r.stderr =~ /failed to open \/dev\/vboxnetctl/i
# This catches an error message that only shows when kernel
# drivers aren't properly installed.
@logger.error("Error message about unable to open vboxnetctl")
raise Vagrant::Errors::VirtualBoxKernelModuleNotLoaded
end
任何关于我如何对 Vagrant 或 VirtualBox 的配置进行更改以获取 vagrant 并传递错误消息的指导将不胜感激。
【问题讨论】:
标签: vagrant virtualbox macos-monterey