Skip to content

Instantly share code, notes, and snippets.

@mblarsen
Created August 10, 2014 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mblarsen/42b3b5c5a785d0565c2a to your computer and use it in GitHub Desktop.
Save mblarsen/42b3b5c5a785d0565c2a to your computer and use it in GitHub Desktop.
Fix for when vbox/vagrant/VBoxManage won't start due to NS_ERROR_FAILURE/host-only adapter
#!/bin/bash
#
# 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 HostNetworkInterface, interface IHostNetworkInterface
# VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 68 of file VBoxManageHostonly.cpp
#
# VM must be running to open SSH connection. Run `vagrant up`
# to start the virtual machine.
#
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
@mblarsen
Copy link
Author

Usually occurs on vagrant up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment