Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.55k stars 849 forks source link

Q: Unable to boot or provision #2637

Closed desrosj closed 1 year ago

desrosj commented 1 year ago

I've been trying to get my pre-existing vvv setup to start up and have not been able to.

I ended up starting from scratch, but I still get the same type of error seen below:

Platform: darwin19 shell:/bin/zsh vagrant-goodhosts shared_db_folder_disabled
Vagrant: v2.3.2, virtualbox: v7.0.2

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-20.04'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vvv_ae18a058ed7
==> default: 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%...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 105 of file VBoxManageHostonly.cpp
tomjn commented 1 year ago

which version of VVV is this? Have you tried rebooting your machine? A missing vboxnetclt implies a VBox issue:

tomjn commented 1 year ago

I'm also assuming this is an Intel Mac

tomjn commented 1 year ago

This SO answer may also be helpful: https://stackoverflow.com/a/47652517/57482, and the second answer is a good debugging step: https://stackoverflow.com/a/19492976/57482

This may resolve the issue:

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

https://stackoverflow.com/a/69825124/57482

And this might reload the kernel extensions:

sudo kmutil load -b org.virtualbox.kext.VBoxUSB
sudo kmutil load -b org.virtualbox.kext.VBoxNetFlt
sudo kmutil load -b org.virtualbox.kext.VBoxNetAdp
sudo kmutil load -b org.virtualbox.kext.VBoxDrv

You might need to reboot MacOS. It's frustrating that it requires a reboot even on Windows but never actually tells you.

Stack Overflow
macOS - vagrant up failed, /dev/vboxnetctl: no such file or directory
Can be useful, I found this error. The common solution is reinstall virtualbox but there are a better way. Solution sudo /Library/StartupItems/VirtualBox/VirtualBox restart or sudo /Library/
Stack Overflow
macOS - vagrant up failed, /dev/vboxnetctl: no such file or directory
Can be useful, I found this error. The common solution is reinstall virtualbox but there are a better way. Solution sudo /Library/StartupItems/VirtualBox/VirtualBox restart or sudo /Library/
Stack Overflow
macOS - vagrant up failed, /dev/vboxnetctl: no such file or directory
Can be useful, I found this error. The common solution is reinstall virtualbox but there are a better way. Solution sudo /Library/StartupItems/VirtualBox/VirtualBox restart or sudo /Library/
desrosj commented 1 year ago

I've tried using both the stable and develop branches of VVV.

I'm running

I've uninstalled and reinstalled VirtualBox and Vagrant. I use homebrew to manage this.

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart I get "command not found" for this command.

The sudo kmutil commands and restarting also don't seem to work.

desrosj commented 1 year ago

There are a handful of different variations of these commands on that SO question, but they all seem to give the command not found issue.

tomjn commented 1 year ago

How about:

sudo kextload -b org.virtualbox.kext.VBoxDrv;
sudo kextload -b org.virtualbox.kext.VBoxNetFlt;
sudo kextload -b org.virtualbox.kext.VBoxNetAdp;
sudo kextload -b org.virtualbox.kext.VBoxUSB;

You can also skip the security dialog by manually approving the extension with:

/usr/sbin/spctl kext-consent add VB5E2TV963

This should also help list kernel extensions that aren't from Apple:

kextstat | grep -v com.apple

This is the output I got on VirtualBox 6.1:

❯ kextstat | grep -v com.apple
Executing: /usr/bin/kmutil showloaded
No variant specified, falling back to release
Index Refs Address            Size       Wired      Name (Version) UUID <Linked Against>
  178    3 0xffffff7fa2326000 0xb2000    0xb2000    org.virtualbox.kext.VBoxDrv (6.1.16) DAF044F0-5043-3B8E-8758-5A462567BDAA <8 6 5 3 1>
  183    0 0xffffff7fa2403000 0x5000     0x5000     org.virtualbox.kext.VBoxUSB (6.1.16) CA33FA52-5933-3F0E-9B40-8B1ECF4D6A36 <182 178 66 8 6 5 3 1>
  184    0 0xffffff7fa23fe000 0x4000     0x4000     org.virtualbox.kext.VBoxNetFlt (6.1.16) C93EAF6A-676F-3370-BAE2-BDFD2BF16582 <178 8 6 5 3 1>
  185    0 0xffffff7fa23f8000 0x2000     0x2000     org.virtualbox.kext.VBoxNetAdp (6.1.16) 76200407-D2F0-3D84-BCCF-7EEA18F16654 <178 6 5 1>

Eitherway it sounds like you have a corrupted/incomplete VirtualBox install, you may need to reinstall it. You shouldn't need to run any vagrant commands or destroy any VMs to do that though

desrosj commented 1 year ago

I uninstalled VirtualBox and reinstalled it using the DMG for 6.1.x from the VirtualBox site this time, but getting the same issue. When I run kextstat | grep -v com.apple, I get an empty list. Going to keep trying.

tomjn commented 1 year ago

nothing in your system preferences security panel?

desrosj commented 1 year ago

Nope. But, I think I have it! No idea what's different, but I uninstalled and reinstalled twice more and after the second time it now works. 🤷🏼‍♂️ It's provisioning now. Will check back when it finishes.

desrosj commented 1 year ago

Looks like everything is working as expected now. I'm not really sure what happened or why, but it's working!

Thanks for helping to troubleshoot!