Reputation: 184
I am running macOS Monterey 12.0.1 with Vagrant 2.2.19 and VirtualBox 6.1.30. When I attempt to start up Vagrant via the mac terminal using vagrant up
this error message is returned:
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
I have tried uninstalling and reinstalling both VirtualBox and Vagrant along with reboots of macOS but I'm still getting the same above message.
In my search for an answer I keep coming across a suggestion to add this to my Vagrantfile but I'm unsure where it needs to be inserted since it does not currently have it in my file and no one ever states where in the file to insert it:
config.vm.provider "virtualbox" do |v| v.gui = true end
Also, within the codebase for Vagrant, I found this snippet indicating it might be a kernel driver needing to be installed or properly installed. But I'm not finding any references on driver installation.
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
Any guidance on how I might make changes to my configuration to Vagrant or VirtualBox to get vagrant up and passed the error messages would be appreciated.
Upvotes: 0
Views: 2103
Reputation: 650
I was facing a similar issue with the latest vagrant and VirtualBox versions on macOS Ventura
. In my case, the issue was solved by doing the following:
Run these commands:
sudo su
csrutil clear
Then uninstall VirtualBox using the official uninstaller after that reboot the system.
After the reboot install VirtualBox again using:
brew install --cask virtualbox
Add this line to your Vagrantfile:
virtualbox__intnet: true
And finally:
vagrant up
Upvotes: 1
Reputation: 26056
The second I updated Vagrant to version 2.3.3 on my macOS 13 (Ventura) machine I was able to use my existing Vagrant script to start up without any hacks, kludges or kernel extension magic. It now works 100% as expected.
The official changelog for Vagrant 2.3.3 clearly states this; bold emphasis is mine:
IMPROVEMENTS:
- core: Bump net-ssh dependency to 7.0 and remove patches [GH-12979]
- synced_folders/rsync: Include ssh extra_args value [GH-12973]
BUG FIXES:
- command/serve: Force root level namespace for Google constant [GH-12989]
- guest/solaris: Fix insecure key authorized keys removal [GH-12740]
- provider/virtualbox: Fix :private_network support for VirtualBox 7 on macOS [GH-12983]
- provider/virtualbox: Prevent localization of command output [GH-12994]
- provisioner/ansible: Update setup packages in debian capability [GH-12832]
Upvotes: 1
Reputation: 184
Someone directed me to this post: https://laracasts.com/discuss/channels/general-discussion/homestead-macos-monterey-boot-issue-headless-error-virtualbox?page=1&replyId=744904
Since I am using a newer version of virtualbox 6.1.30 than listed in this post and 6.1.30 fixes virtualbox installing I decided to move on to retrying the kernal extension commands listed (after confirming that the files referenced already existed which they do).
The commands are:
sudo kextload /Library/Application\ Support/VirtualBox/VBoxDrv.kext -r /Library/Extensions
sudo kextload /Library/Application\ Support/VirtualBox/VBoxNetAdp.kext -r /Library/Extensions
sudo kextload /Library/Application\ Support/VirtualBox/VBoxNetFlt.kext -r /Library/Extensions
sudo kextload /Library/Application\ Support/VirtualBox/VBoxUSB.kext -r /Library/Extensions
The second command responded that I needed to reboot. So I ignored, went ahead and ran the rest of the commands, THEN rebooted the computer.
Then in the Homestead project directory I ran vagrant up
again.
This time it worked successfully and is still running headless - a bit like me. :)
Additional notes (In case I need to come back for my own answers):
The Mix manifest does not exist
after running php artisan serve and navigating to localhost. To resolve I ran php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
allow
.npm ci && npm run dev
npm run watch
Upvotes: 1