Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/StartupItems/VirtualBox/VirtualBox start

VirtualBox 4.3+

On recents versions, the file (/Library/StartupItems/VirtualBox/VirtualBox) don't exists, so you need to use the command below:

sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist

Error

Print: http://d.pr/i/1Bvi

There was on 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

Vagrant Git issue about the error: https://github.com/mitchellh/vagrant/issues/1671#issuecomment-22304107

like image 489
Lucas Serafim Avatar asked Aug 09 '13 14:08

Lucas Serafim


3 Answers

I'm running macOS High Sierra 10.13.1 and VirtualBox 5.2.2.

This worked for me:

  1. Grant permission to VirtualBox under System Preferences > Security & Privacy > General (this request is new to macOS High Sierra)
  2. Open Terminal and run: sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
like image 75
Linus Avatar answered Oct 24 '22 07:10

Linus


If your system recently updated the kernel, you many need to rerun the vbox setup again. If this is the case, you will see the following messages when you run virtualbox start command:

$ sudo /path/to/virtualbox start
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (2.6.32-358.23.2.el6.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /etc/init.d/vboxdrv setup

         You will not be able to start VMs until this problem is fixed.
like image 34
johnpaulhayes Avatar answered Oct 24 '22 06:10

johnpaulhayes


This worked for me (macOS Monterey). This reloads all VirtualBox's 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
like image 23
X99 Avatar answered Oct 24 '22 07:10

X99