将 Mac 更新至 MacOS Monterey,现在 vagrant up 无法正常工作

Kri*_*ler 5 virtualbox vagrant

我将我的 Mac 更新到了蒙特利。然后,在更新虚拟框并在“系统偏好设置”>“安全和隐私”中允许权限后,我尝试在项目中进行流浪。

我收到此错误:

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

Command: ["startvm", "2f108a05-a574-4e42-b03d-36b2abfa8d26", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'projectwebsite.test' has terminated unexpectedly during startup because of signal 10
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
Run Code Online (Sandbox Code Playgroud)

我应该做什么来修复它?我查看了解决方案,其中提到了有关 GUI 和 Headless 的内容。我看到这篇文章说 VBoxHeadline 不能在 macOS Monterey 中运行。(https://www.virtualbox.org/ticket/20636)。所以我必须配置 vagrant 在 gui 中运行

所以我有的选择:

  1. 回滚到以前的 MacOS 版本
  2. 配置流浪汉
  3. 还有什么?

问题:如何配置vagrant?这篇文章令人困惑:https://www.vagrantup.com/docs/providers/virtualbox/configuration#gui-vs-headless。我该去哪里添加这个代码呢?

config.vm.provider "virtualbox" do |v|
  v.gui = true
end
Run Code Online (Sandbox Code Playgroud)

对所有这些事情都很困惑。

ALe*_*ide 1

这绝对是一个修复 \xe2\x80\x94 https://github.com/hashicorp/vagrant/issues/12557#issuecomment-958183899

\n

还有两条线索:

\n
    \n
  • 我可以补充一点,如果你的本地网站仍然打不开,就像根本没有加载一样,那么你应该修改macos /etc/hosts并将ip地址更改为192.168.56.*(* \xe2\x80\x94 输入任何数字,但它应该低于 192.168.56。,根据新的网络配置更改)。

    \n
  • \n
  • 如果 php 仍然无法工作,您可能需要重新启动 fpm:

    \n

    sudo 服务 php7.4-fpm 重新启动

    \n
  • \n
\n