Updated Mac to MacOS Monterey and now vagrant up isn't working

Viewed 3281

I updated my mac to Monterey. Then I tried to vagrant up in a project after I updated the virtual box and allowed permission in my System Preferences > Security & Privacy.

I get this error:

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

What should I do to fix it? I looked at solutions and it said something about GUI and Headless. I came across this article saying that VBoxHeadline doesn't run in macOS Monterey. (https://www.virtualbox.org/ticket/20636). So I have to configure vagrant to run in gui

So the options I have:

  1. roll back to previous MacOS version
  2. Configure vagrant
  3. What else?

Question: How do I configure vagrant? This article is confusing: https://www.vagrantup.com/docs/providers/virtualbox/configuration#gui-vs-headless. Where do I go to add this code?

config.vm.provider "virtualbox" do |v|
  v.gui = true
end

So confused about all those things.

3 Answers

This is definitely a fix — https://github.com/hashicorp/vagrant/issues/12557#issuecomment-958183899

Two more clues:

  • I may add that if your local website still does not open as if not loading at all, then you should modify macos /etc/hosts and change ip address to 192.168.56.* (* — put any number, but it should be under 192.168.56., as per new network configuration changes).

  • If the php still not working, you might need to restart an fpm:

    sudo service php7.4-fpm restart

Reinstall the virtualbox with homebrew in a terminal

brew install virtualbox

Related