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

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:
roll back to previous MacOS version
Configure vagrant
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.

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

The new build of VirtualBox from this tickets works for me.
https://www.virtualbox.org/ticket/20636
https://www.virtualbox.org/ticket/20637
Where do I go to add this code?
You need to put it into your Vagrantfile
Example:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
config.vm.provider "virtualbox" do |vb|
v.gui = true
end
end

Reinstall the virtualbox with homebrew in a terminal
brew install virtualbox

Related

Vagrant VMware Utility driver

First of all I'm sorry if someone already did this question, in this case please paste the link here because I didn't find anything.
I'm learning vagrant, using virtualbox i don't have problem in running VM, but if I would like to use VMware as provider. I encounter this message and I can't find a way to get out of this.
I think everything is well configured but obviously something is wrong.
When I launch vagrant up --provider=vmware_desktop, I have this error message:
Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver. Please try to run the command
again. If this error persists, please contact support#hashicorp.com
I'm currently using Fedora 35
Operating System: Fedora Linux 35 (Workstation Edition)
Kernel: Linux 5.17.5-200.fc35.x86_64
Architecture: x86-64
I have followed this thread:
https://github.com/hashicorp/vagrant-vmware-desktop/issues/22
and someone had prepared a nice gist -- which I copied below just in case the gist link wasn't anymore.
My issue was mainly the Vagrant 2.2.19 which somehow was not ok with VMWare. 2.2.18 worked fine. Just make sure you follow the above gist step by step.
https://gist.github.com/sbailliez/f22db6434ac84eccb6d3c8833c85ad92
My issue was mainly the Vagrant 2.2.19 which somehow was not ok with VMWare. 2.2.18 worked fine. Just make sure you follow the above gist step by step.
Vagrant and VMWare Tech Preview on Apple M1 Pro
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated
from discussions in https://github.com/hashicorp/vagrant-vmware-desktop/issues/22
Installing Rosetta
First install Rosetta if not already done, this is needed to run x86 code:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Installing Vagrant
Install Vagrant via brew or install it manually. Note that I use 2.2.18 as 2.2.19 did not work for me. (YMMV)
brew install vagrant#2.2.18
Installing VMWare Fusion Tech Preview
You will need to create an account on vmware as it needs user and key information that are user specific.
The registration process is kinda convoluted. Be careful about passwords as the password needs to be less than 20 characters and there are no error messages for this.
You can download the tech preview via the download page.
Once this is installed you will NEED to create a symlink as the vagrant vmware utility etc.. assumes that vmware is installed in a specific directory and the tech preview is installed in a different one.
ln -s /Applications/VMWare\ Fusion\ Tech\ Preview.app /Applications/VMWare\ Fusion.app
Installing Vagrant VMWare provider
It requires two steps. This is detailed in the documentation but follow the steps below:
First go to Vagrant vmware Utility and download the binary and install it. It says x86_64 but it is fine.
The direct link is:
https://releases.hashicorp.com/vagrant-vmware-utility/1.0.21/vagrant-vmware-utility_1.0.21_x86_64.dmg
It needs to be version 1.0.21
Next install the provider:
vagrant plugin install vagrant-vmware-desktop
Create a Vagrant file
Create a file Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "spox/ubuntu-arm"
config.vm.box_version = "1.0.0"
end
Run vagrant
vagrant up
and then
vagrant ssh
Hopefully this should work and you should find yourself with mostly everything working.
Troubleshooting
I have observed various issues that makes the whole experience unstable or creating conflicts.
vagrant 2.2.19 is broken
I have had issues trying to run vagrant 2.2.19. Use 2.2.18
vagrant-vmware provider forwarded ports bound
If you declare forwarding port on your box, for some reasons the provider persists them and keeps it bound in LISTEN state even after you do a vagrant halt.
You can check this using something like:
sudo lsof -i -P | grep LISTEN | grep 'vagrant-v'
You can see the ports are stored in:
cat /opt/vagrant-vmware-desktop/settings/portforwarding.json
To stop the provider use:
sudo launchctl unload -w /Library/LaunchDaemons/com.vagrant.vagrant-vmware-utility.plist
To start it again, use load instead of unload.
nfs exports conflicts
If your vagrant box uses nfs, it seems to pollute the /etc/exports file with duplicate or stale entries over time which will cause vagrant to get angry at you at some point. You may need to prune the entries. It seems related to vagrant#11418
I encountered this same issue you had with the architecture compatibility while trying to set up VM on my Mac M1. Found my solution in this GitHub thread
I just added this lines to the Vagrantfile
config.vm.provider :vmware_desktop do |v|
v.vmx["ethernet0.pcislotnumber"] = "160"
end

VM won't bring up using homestead up

I have no issue running vm's using homestead up but last week I just updated to the latest Windows 10 update and now when I run the command it gives me
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "c8da3222-7052-452a-b590-ff7144b50c9e", "--type", "headless"]
Stderr: VBoxManage.exe: error: The virtual machine 'homestead-7' has terminated unexpectedly during startup with exit code 1 (0x1). More details may be available in 'C:\Users\magal\VirtualBox VMs\homestead-7\Logs\VBoxHardening.log'
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine
Been searching the web for a solution but got no luck.
Box Version : 2.1.0
Without more info the only advice is to run vagrant destroy && vagrant up If you still have issues after that, consider opening a new issue on https://github.com/laravel/homestead/issues/new
Issue was fixed after upgrading my Virtualbox to 5.2.
On Windows 10, I installed everything as ADMINISTRATOR and only the following configuration worked for me:
Vagrant 1.9.2 : Download Vagrant 1.9.2
Oracle VM VirtualBox 5.1.30 : Download Oracle VM VirtualBox 5.1.30
For older versions of VirtualBox, the virtual machine has terminated unexpectedly.
For newer versions of VirtualBox, the host-only adapter cannot be created.
When you upgrade or downgrade, make sure that you permanently delete (Shift + Delete) the following folders from C:\Users\your-user : .vagrant, .VirtualBox and Virtual VM Machines. When using vagrant up, these folders will be created again.
After each program install and uninstall, make sure to restart your computer. Old files from VirtualMachine and Vagrant are persistent until the OS boots up again.

Using Vagrant to set up a VM with KVM/qemu without VirtualBox

I'm getting started Vagrant and want to use it with KVM/qemu (and the Virtual Machine Manager GUI), instead of installing VirtualBox. So I first installed Vagrant:
$ vagrant --version
Vagrant 1.9.1
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some
As per these posts, I require vagrant-libvirt for it to work with KVM, so I installed that next:
$ vagrant plugin list
vagrant-libvirt (0.0.37)
vagrant-share (1.1.6, system)
Next, I to add a CentOS(7) box using vagrant box add "centos/7" and selected libvirt, when prompted. After which, I ran vagrant init and didn't encounter any errors:
$ vagrant init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
However, vagrant up seems to be erroring out, like so:
$ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
Here's the provider section in the Vagrantfile
config.vm.provider :libvirt do |domain|
domain.driver = "qemu"
domain.memory = 512
domain.cpus = 1
end
I tried modifying it to:
config.vm.provider :libvirt do |domain|
domain.driver = "kvm"
domain.host = 'localhost'
domain.uri = 'qemu:///system'
domain.memory = 512
domain.cpus = 1
end
I also tried vagrant up --provider=kvm, vagrant up --provider=qemu, and vagrant up --provider=libvirt too, to no avail.
Is there any step that I've missed? Or another package/dependency that needs to be installed?
Edit: After the adding centos/7 using vagrant, it shows up when running vagrant box list.
$ vagrant box list
centos/7 (libvirt, 1611.01)
Start vagrant box with command
vagrant up --provider=kvm
Although it has been said in https://seven.centos.org/2017/08/updated-centos-vagrant-images-available-v1707-01/ that
The vagrant-libvirt plugin is only compatible with Vagrant 1.5 to 1.8
You can use either the command line option --provider=kvm or you can set the VAGRANT_DEFAULT_PROVIDER environment variable:
export VAGRANT_DEFAULT_PROVIDER=kvm # <-- may be in ~/.profile, /etc/profile, or elsewhere
vagrant up
vagrant-libvirt(0.0.40) is compatible with Vagrant 2.0.2 if you are running Ruby 2.3, at least on Linux Mint 18.3 (Ubuntu 16.04). I used vagrant from the Debian download on the vagrantUp website and installed the plugin using it without any problem.

Vagrant Apache setup on Windows 10

I am having a hard time getting Vagrant to work on Windows 10. Here is what I have done so far:
Installed Git 2.7.4
Installed VirtualBox 5.0.16
Installed Vagrant 1.8.1
I want a pre-configured Apache / PHP box, so I am using 'Scotch Box' (https://github.com/scotch-io/scotch-box). I have cloned the repo and ran vagrant up from the Git Bash prompt.
This successfully created and booted up the VM, however there was a few errors during the process:
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 5.0.16
Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
After this I ran vagrant ssh, this presented me with the Ubuntu intro screen.
I then tried to access the IP address http://192.168.33.10 in my browser, as suggested. However this just brings up a 404 Not Found page. I then ran curl localhost:80 within the VM, this also outputs the same 404 page.
What exactly is going on and how can I diagnose this further? I am not too familiar with Unix so could do with some help.
The error you listed in your question:
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 5.0.16
Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Is actually from a Vagrant plugin, vagrant-vbguest in my experience - which is trying to match your Guest Additions version to your virtualbox version. It is usually harmless.
More to your question, I see a few questions a week about people having issues with the scotchbox. If all you need is apache2 and php5, why not just init a trusty box and install apache2 and php5 packages?
vagrant init ubuntu/trusty64
Add the following to your Vagrantfile:
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y apache2 php5
SHELL
You will also need to enable a network type in your Vagrantfile, so you can access the box from your Host (and browser). Choose one of the below to UNCOMMENT (remove the #) from the generated Vagrantfile:
# config.vm.network "private_network", ip: "192.168.33.10"
or
# config.vm.network "forwarded_port", guest: 80, host: 8080
Run vagrant up and you can access your webserver at http://192.168.33.10 or http://localhost:8080, depending on which networking option you went with.
I found out what the problem was after some Googling.
I had a look at the 000-default.conf file in the /etc/apache2/sites-available directory. In here it had the DocumentRoot set as /var/www/public.
So all I had to do was create a new folder called public on my host machine and put all my website files in there.

There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. windows 10

I just got laravel homestead to run yesterday using powershell. Now, it won't even run. I just suspended vagrant and turned off my pc. Now it's just giving me this error:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "b21f2dd0-7f73-4d0f-b1e0-0f82ecdda1fe",
"--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp33060",
"--natpf1", "delete", "tcp44300", "--natpf1", "delete", "tcp54320",
"--natpf1", "delete", "tcp8000"]
Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified
error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session,
LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp
I had the same problem and the previous answer didn't work for me.
I opened the VirtualBox GUI and saw that the virtual machine was running. I stopped it and then I executed "vagrant up". All worked well.
Ok, so I finally fixed the problem. Tried restarting my laptop and it's not giving me that error anymore. Here's what I did:
Right click on "This PC" / "My Computer" on windows desktop
Select "Properties"
Go to "Advanced" tab
Click "Environment Variables..." at the bottom
Under System Variables click "New..."
Set "Variable name" to "VBOX_INSTALL_PATH"
Set "Variable value" to "C:\Program Files\Oracle\VirtualBox\"
Select "OK" and close all the other settings windows
source: https://github.com/mitchellh/vagrant/issues/3852
Just enable permission for VirtualBox in Security & Privacy
For Mac OS, close all the running VMs and restart the virtual box using following command:
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
First of all destroy the virtual box with vagrant destroy.
Navigate to C:\Users\Justice replace justice by username.
Delete the .vagrant.d folder.
Go into VirtualBox VMs folder and delete everything inside it.
Start it again with vagrant up.
It should work fine.
Try to follow these steps
1. Run cmd as Administrator
2. vagrant halt
3. vagrant up
4. if required vagrant provision but once vagrant is up.
Disable Hyper-V virtualization that is enabled in Windows.
Open a command prompt as administrator and run the following command:
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
Afterwards, reboot the PC and try VirtualBox again.
My error:
Stderr: VBoxManage.exe: error: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
I first tried disabling the "VirtualBox Host-Only" adapter. Didn't work. Then tried downgrading virtualbox from 6.1.28 to 6.1.26 and that didn't work. Removed everything and started over with 6.1.26, still didn't work. After going in circles for a while, I realized there was another adapter I did not disable called "Ethernet 5" with a 'VirtualBox Host-Only..." description. Not sure if it was created the first time I ran the virtualbox 6.1.28, but after I disabled it, it worked. Noticed another was created after that ("Ethernet 6"), so pretty sure the first issue was the same as others with the 6.1.28 and then the error changed to what I posted above.
Disable all VirtualBox Host-Only Ethernet Adapter #*, under the Control Panel > Network & Internet > Network Connections.
After the Windows Update, I get this problem too and I think it is the VirtualBox problem. My solution is re-install VirtualBox.
Also make sure VirtualBox directory path C:\Program Files\Oracle\VirtualBox\ is in PATH environment variable.
For me, just restarting the machine solved the problem. I just had install VirtualBox, maybe the paths weren't correctly set.
I was having the same issue and I just had to enable the hardware virtualization in my computer's BIOS as mentioned in Laravel documentation.
If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. If you are using Hyper-V on a UEFI system you may additionally need to disable Hyper-V in order to access VT-x.
May be it to late to provide my experience with this issue. You probably have to restart your machine and after installing virtualbox and make sure the environmental variable has a value of "C:\Program Files\Oracle\VirtualBox"
System Variable Entry
And Path entry at System variable should have %VBOX_MSI_INSTALL_PATH%
%VBOX_MSI_INSTALL_PATH%
MACOS users only -> I had same problem what i did was
Just enable permission for VirtualBox in Security & Privacy for Oracle.
open PowerShell or cmd as administrator
write bcdedit /set hypervisorlaunchtype off
reboot
You might get this error if you are low on free disk space.
1.Go to Oracle Virtual Box
2.Right click on the Virtual Machine and select Discard Saved State.
3.Then try to start the virtual machine using vagrant up.
Full link: https://www.wintips.org/fix-virtualbox-vm-session-was-closed-before-any-attempt-to-power-it-on/

Resources