169

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

4
  • VirtualBox 4.3.2 allegedly solves needing to restart after every boot.
    – Nate Bundy
    Nov 22, 2013 at 22:31
  • @lucas-serafim Can you please add a note on which OS this question refers to? For example there is neither a binary called "launchctl" nor a root folder "/Library" on common Windows or Linux installations.
    – feeela
    Jun 6, 2018 at 8:43
  • hello @freeela this was on osx Jun 6, 2018 at 21:01
  • 1
    I use macosx monterey - none of the settings worked for me - I had to remove and reinstall virtualbox and allow oracle during macosx notary process. then things worked for me. Dec 14, 2021 at 21:25

10 Answers 10

114

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
7
  • 1
    This also worked for me, running macOS High Sierra 10.13.1 Dec 8, 2017 at 7:59
  • 2
    Worked for macOS 10.14 (Mojave)
    – Bergrebell
    Nov 5, 2018 at 9:13
  • Thanks! Works for me as well on for macOS 10.14.2 (Mojave) Mar 5, 2019 at 20:54
  • Worked in macOS Catalina: 10.15.7
    – MrAn3
    Oct 15, 2020 at 16:22
  • 3
    This seemed to be required after recent Apple security update running Big Sur
    – Daniel
    Sep 14, 2021 at 10:52
27

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.
5
  • 22
    for mac sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart worked
    – jmj
    Nov 4, 2014 at 0:54
  • 3
    In my particular case didn't not solve my case I have to delete VirtualBox and install all over again. Hope that help you! Oct 3, 2015 at 11:21
  • This was the proper explanation of the issue for me, but the way I solved it on arch was with Brad Pitchers solution of vboxreload Feb 26, 2016 at 15:36
  • The mac solution by @JigarJoshi fixed vagrant after upgrading to OS X Sierra.
    – loafer
    Oct 31, 2016 at 10:02
  • 5
    1st comment used to work, but now I receive this error: Unloading VBoxUSB.kext Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxUSB Unloading VBoxNetFlt.kext Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxNetFlt Unloading VBoxNetAdp.kext Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxNetAdp Unloading VBoxDrv.kext Executing: /usr/bin/kmutil unload -b org.virtualbox.kext.VBoxDrv Error: VBoxDrv.kext is already loaded Error: VBoxUSB.kext is already loaded Error: VBoxNetFlt.kext is already loaded Error: VBoxNetAdp.kext is already loaded
    – Vini.g.fer
    Jan 19, 2021 at 13:37
27

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
4
  • 4
    just running above codes fixed for me with osx Monterey. thanks. Nov 9, 2021 at 8:18
  • 2
    Same, macOS Monterey users - do this Nov 25, 2021 at 13:18
  • 3
    macOS Monterey user here. Got it fixed just by running this commands. Thanks. Jan 19, 2022 at 6:36
  • 3
    you might have to go to Privacy& Settings in macOS preferences, unlock the key icon und "approve" to install stuff from Oracle Software, then restart!
    – Sliq
    Jun 27, 2022 at 19:53
21

I had some problems with vbox running on Ubuntu 17.10 when starting a virtual machine with host-only adapted/bridge network. Looking for an answer I found numerous commands that are useful when having that kind of problems. Here they are:

VIRTUAL HOST PROBLEMS

failed to open /dev/vboxnetctl

vboxnet0 - this is the bad guy who is causing all the trouble.

VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory.

These commands are not used in particular order. They are just generally useful and problem-solving.

1) sudo modprobe vboxdrv

2) sudo modprobe vboxnetadp - (host only interface)

3) sudo modprobe vboxnetflt - (make vboxnet0 accecible)

IF YOU HAVE PROBLEMS WITH SECURE BOOT RUNNING the FIRST COMMAND I RECOMMEND DISABLING SECURE BOOT IN BIOS (or reboot).

modprobe: FATAL: Module vboxnetftl not found in directory /lib/modules/4.13.0-21-generic

(bridge networking)

4) sudo apt-get install virtualbox-dkms (extension) -> go to command 1 after this

5) sudo vboxmanage hostonlyif create

These sometimes might work:

I. service --status-all

II service service_name restart

3
  • 3
    Using Ubuntu 16.04, I followed steps 1-3 here and it solved my issues (virtual box now up and running). Thanks! Jan 14, 2018 at 4:56
  • rather than disabling secureboot, you can self sign the cert and add it to the module. gist.github.com/fabiog1901/ec0b19b514c0d7abe4f30b715a1ccf00
    – fabiog1901
    Aug 5, 2020 at 16:49
  • On Manjaro (Arch) system I hit the same issue. Running the first 3 modprobe commands were sufficient for me to get past the error.
    – Brooks
    Feb 11, 2022 at 22:38
7

Tried above all remedies, few commands although executed, did not work. Nothing is present in my Mac (el captain) of sort /Library/StartupItems/Vir*, and below command failed:

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

Reinstalling latest VirtualBox and then running below command helped me having VM running

sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist
3
  • - it was the reinstalling virtual box that fixed it for me.
    – Matt
    Sep 26, 2016 at 14:05
  • Reinstalling Vbox and running that command worked for me. No other fixes worked. OS X Sierra 10.12.5. Many thanks!
    – KriiV
    Jun 20, 2017 at 10:46
  • I did a lot of things from this thread. vagrant up only started working until I followed this instructions in Mac Os 10.13.3 :-)
    – Sergeon
    Mar 10, 2018 at 18:55
6

I had a similar problem starting a virtual box on High Sierra.

macOS High Sierra 10.13 introduces a new feature that requires user approval before loading newly-installed third-party kernel extensions (KEXTs). When a request is made to load a KEXT that the user has not yet approved, the load request is denied. Apps or installers that treat a KEXT load failure as a hard error will need to be changed to handle this new case.

To resolve, you must manually approve the KEXT in System Preferences > Security & Privacy.

Here is the Technical Note from Apple:

https://developer.apple.com/library/content/technotes/tn2459/_index.html

3
  • A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.
    – Paul Roub
    Oct 30, 2017 at 16:40
  • This answer is very useful.
    – BigDataKid
    Feb 5, 2018 at 4:28
  • My vagrant crashed and had this above error and it was fixed by this and running sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart after this step :) Thank you Oct 10, 2018 at 4:24
4

I was stuck on this for a while. I kept seeing 'command not found' when trying to run the sudo: /Library.. command.

However, this did work for me:

sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart
1
  • 1
    This worked for me on macOS Big Sur, only after I went to System Preferences > Security & Privacy and clicked on "Details" next to "Some system software requires your attention before it can be used", then gave permissions and rebooted.
    – TanguyP
    May 25, 2021 at 9:40
1

RUN

$ sudo modprobe vboxdrv
$ sudo modprobe vboxnetadp
$ sudo vboxreload
2
  • 4
    Why? Please don't add command-only replies. Context is needed.
    – Christian
    Nov 12, 2019 at 1:57
  • Yeap I should love why I should provide theese commands and what these commands do even though on GNU/Linuc Machine work. Feb 3, 2020 at 8:22
1

Thank forks, it worked for me.

  1. Grant permission to VirtualBox under System Preferences > Security & Privacy > General
  2. Throw away /Applications/VirtualBox into the trash
  3. Re-install VirtualBox from your .dmg file
2
  • How to install it via the command-line? I'm trying to setup docker in a GItlab MacOS Beta host Oct 1, 2021 at 14:47
  • 1
    Thank you! None of the other workarounds here worked for me after upgrading to Monterey. I needed to hit the Security & Privacy tab first, then uninstall and reinstall to get it working again. Jan 25, 2022 at 21:44
0

When I get the error...

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

The following works for me and returns no errors, I am then able to bring vagrant up successfully

sudo /Library/StartupItems/VirtualBox/VirtualBox restart
2
  • I don't have this "sudo /Library/StartupItems/VirtualBox/VirtualBox" my StartupItems is empty. :(
    – Kadiyski
    Sep 2, 2020 at 11:29
  • Try /Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh @Kadiyski
    – Vini.g.fer
    Jan 17, 2021 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.