174

I am running vagrant 1.4 and virtual box 4.3 on fedora 17 machine. When I do "vagrant up", I get this error:

Bringing machine 'default' up with 'virtualbox' provider...                                                                            


[default] Clearing any previously set forwarded ports...                                                                                                                
[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%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: VBoxNetAdpCtl: ioctl failed for /dev/vboxnetctl: Inappropriate ioctl for devic
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp
4
  • you're running vagrant from fedora or that's your vagrant box os? Jan 16, 2014 at 4:52
  • I have the same issue and running vagrant on OS X, is that the problem of virtual box?
    – Yuan He
    Apr 3, 2014 at 14:33
  • @adi could you validate the right answer? Tks
    – totophe
    Jan 20, 2017 at 9:32
  • You will probably have this issue when you update to MacOS Monterey an etc. The accepted answer was no doubt the main problem but the MacOS upgrade may not copy your Security and Privacy settings, so I added that as well. I do NOT know why this question was not simply moved instead of closed. Jun 5, 2022 at 2:33

37 Answers 37

271

I had the same problem today. The reason was that I had another VM running in VirtualBox.

Solution:

  1. Open VirtualBox and shut down every VM running
  2. Go to System Preferences > Security & Privacy Then hit the "Allow" button to let Oracle (VirtualBox) load.
  3. Restart VirtualBox
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

You should now be able to run vagrant up or vagrant reload and have your new host configured.

As mentioned in this answer, recent versions of macOS can block VirtualBox.

Solution:

Go to System Preferences > Security & Privacy Then hit the "Allow" button to let Oracle (VirtualBox) load.

(thanks to @pazhyn, @lsimonetti & @dave-beauchesne for clarifications)

15
  • 4
    Confirming this works on my Mac. Shutting down other VMs isn't sufficient, but restarting VB works. Feb 10, 2014 at 6:18
  • 1
    Also worked for me, VirtualBox UI showed no VMs up, but restarting resolved the problem. Perhaps vagrant halt didn't finish successfully the last time.
    – Erich
    May 29, 2014 at 20:26
  • 3
    This answer assumes, I guess, that VirtualBox is in your StartupItems. If it isn't, see @pazhyn's answer below, which seems to be more general & worked for me. Aug 18, 2014 at 15:16
  • 2
    Had to do this and then click "Allow" in System preferences as mentioned by some other answers. Without this, the "Allow" did not appear even.
    – trainoasis
    Oct 9, 2019 at 7:48
  • 2
    Big Sur, system pref -> security & privacy -> general -> unlock to make changes -> advanced -> approve and reboot Mar 15, 2021 at 12:57
64

For Mac OS X 10.9.3 and Vagrant 1.6.3 and VirtualBox 4.3.6 this problem was fixed with restarting the VirtualBox

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
5
  • Works for me, VirtualBox 4.3.18, OS X 10.9.3. Thanks! Oct 21, 2014 at 15:37
  • 1
    For any one having the same question on: Mac OS 10.13 + vagrant 2.2.0 + VirtualBox 5.2.20 this worked perfectly for me. Thank you so much!
    – Bahman.A
    Oct 22, 2018 at 20:14
  • Worked for me. OS X with VirtualBox 6.0 and Vagrant 2.2.7 Mar 13, 2020 at 12:37
  • Yes. Destorying the previous VM didn't do it for me. Mar 20, 2020 at 12:00
  • This did not work for me - apparently the various shutdowns didn't work It says things like "Unloading VBoxUSB.kext", but then later it says "Error: VBoxUSB.kext is already loaded". Nov 12, 2021 at 17:20
56

TL;DR MacOS is probably blocking VirtualBox. Go to System Preferences > Security & Privacy Then hit the "Allow".

Solution: Go to System Preferences > Security & Privacy Then hit the "Allow" button to let Oracle (VirtualBox) load.

MacOS by default can block kexts from loading. You must click the "allow" button before executing the VirtualBoxStartup.sh script.

Then run: sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart like the answer above.

(This article provides more clarity to MacOS kernel extension loading)

3
  • 1
    Worked for me! Thanks Sep 12, 2018 at 11:17
  • MacOS by default can block kexts from loading. You must click the "allow" button before executing the VirtualBoxStartup.sh script. That was the issue for me ! Thanks!
    – daneczech
    Oct 16, 2019 at 7:30
  • On macOS BigSur (11.0.1) I had to update Virtualbox to the latest version before getting the prompt on System Preferences > Security & Privacy > General to "Allow". A system restart was also required after allowing.
    – muya_
    Dec 20, 2020 at 9:24
17

This issue appears to be fixed by installing the latest version of Virtual Box.

2
  • 1
    My case is Vagrant 1.7.4+Virtualbox 5.0+Windows 10 build 10240. Version 5.01 fix the issue.
    – DevAnimal
    Aug 4, 2015 at 16:43
  • I get this error also with Virtualbox 7.0, but reinstalling might cause virtualbox to restart, which is resolves the issue. May 10, 2023 at 21:56
12

I had this issue after upgrading to OS X El Captian. Upgrading to the latest version of VB solved the issue for me. Virtual box will give you the latest link if you go to the virtualbox menu at the top of your screen and clicking check for updates.

10

Got the error in Mac after the update to Mojave. Probably you have an older version of virtual box.

Update to a recent version of virtualbox. (5.2 at the time of wrting this post)

Edit: adding @lsimonetti's comment.

In addition to that upgrade to Virtualbox 5.2, you need Vagrant >= 2.0.1

1
8

If you are on Linux, simply run: sudo vboxreload

1
  • 15
    vboxreload does not exist. Neither vbox
    – jaguililla
    Oct 21, 2015 at 21:46
7

I'm running Oracle VM Virtualbox on Ubuntu 16.04 LTS.

The solution that worked was to reinstall virtualbox as mentioned here:

sudo apt remove virtualbox virtualbox-5.0 virtualbox-4.*

sudo apt-get install virtualbox

I couldn't find my VirtualBox installation folder, as such could not issue the command:

$sudo /Library/StartupItems/VirtualBox/VirtualBox restart

1
  • My local env just stopped responding. Could not get vagrant up. remove and installed vbox fixed whatever was the issue. Thanks Apr 19, 2018 at 19:47
7

I had similar problem upgrading to OSX Monterey.

Solution:

  1. Install VirtualBox Extension (download)
  2. Accept VirtualBox Security & Privacy/Privacy/Input Monitoring

enter image description here

VirtualBox can also have and lose permissions for Accessibility, check that as well

enter image description here

2
  • Thanks. More about how to solve it here.
    – Pathros
    Nov 1, 2021 at 3:54
  • Thanks. It solved the problem on Monterey.
    – BZC
    Nov 12, 2021 at 10:59
6

I had to reinstall Virtual Box on my machine.

Here's the downloads page: Downloads Page

Then vagrant up worked for me after.

6

If after performing what is said by @totophe and on macOS it still doesn't work, just restart your mac. Then open the terminal and vagrant up.

This usually happens after each macOS update.

1
  • 2
    Yep, just restarting my Mac fixed it, thanks! (from 11.5.1 to 11.5.2) Aug 12, 2021 at 22:01
4

In my case, I was able to solve this issue by reinstalling virtual box. I was trying to use laravel's homestead and was having this error. Reinstalling helps creating the directories that are needed for virtual box again. Took me an hour to figure out.

3
$sudo /Library/StartupItems/VirtualBox/VirtualBox restart

Worked great for me on Mac. This normally happens when I shut down my computer without running

$vagrant suspend
1
  • On Ubuntu: sudo systemctl restart virtualbox Oct 18, 2023 at 14:12
3

I'm running Debian 8 (Jessie), Vagrant 1.6.5 and Virtual Box 4.3.x with the same problem.

For me it got fixed executing:

sudo /etc/init.d/vboxdrv setup
3

Tried multiple solutions but the below sequence works for me.

Virtual Box: 5.2.34 Vagrant: 2.2.5 Mac OSX: 10.14.6

First Allow access to oracle inc:

Go to System Preferences > Security & Privacy Then hit the "Allow" button to let Oracle (VirtualBox) load.

Then restart VBox by this command:

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

Now try Vagrant up again.

1
  • That Allow access thing won't be shown after the update, only after install I guess. But the command does the job on Big Sur 11.5 and 11.6. One note - after that command I also had to do the restart.
    – monas
    Oct 1, 2021 at 16:00
3

I've just had the same problem after upgrading to mac os Big Sur

Linus solution 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

https://stackoverflow.com/a/47652517/6146535

2

I am using ubuntu 14.04. I have genymotion installed on virtualbox. Every time I start genymotion I had no problem, but suddenly one time it said unable to load virtualbox engine and it didn't open. I went through the log file and found out it could not create a new host only network because it has already created all possible host only networks. And the problem is that it cannot allocate memory for a new network.

Fix: go to your virtual box File --> Preferences --> Network

Click the host-only tab and just delete some of the host-only networks so that you will get some memory freed and next time, a new network can be created easily.

Deletion fixed my problem.

2
  • Thanks for this. I had the same issue. Jul 18, 2016 at 21:09
  • Thanks for this. I was using Virtual Box on windows and had exactly same issue. Your hint of checking preferences of network helped me solve this issue. Dec 12, 2016 at 9:00
2

In my case I had to do the following to solve this error for me:

totophe's answer in combination with (re)installing the latest VM-version (https://www.virtualbox.org/wiki/Downloads) (Thanks to jacobappleton & user1718159)

Steps:

  • First (re)install latest VirtualBox;
  • Run sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart in terminal (not sure if this is needed in order to get the system preferences show up the allow/disallow option);
  • Allow in Security & Privacy
  • Restart your machine
  • Run sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart again.

Ready to run vagrant up again.

1
  • 1
    The main answer is correct, HOWEVER .... this post does say to reinstall VirtualBox which is what helped Apple recognize and re-approve the security preferences for me.
    – Adam
    Jul 21, 2021 at 18:13
1

I fixed this error by installing VirtualBox 4.2 instead of 4.3. I think the latest version of vagrant and VB 4.3 are incompatible on a fedora system.

1
  • CentOS Linux release 7.2.1511 (Core)
  • VirtualBox-5.0

I came across this tread while searching Google for... VBoxManage: error: Failed to create the host-only adapter

I was using VirtualBox-5.0 to test some virtual machines created with Vagrant and setting private networks in my Vagrantfile web.vm.network "private_network", ip: "192.168.10.2"

When evoking the command $ vagrant up I would get the above mentioned error along with /dev/vboxnetcrl does not exist.

It seems that my version of VirtualBox did not have the proper kernel module compiled for my version of Linux and the device, /dev/vboxnetcrl, does not get created.

Since I wanted to test virtual machine and not troubleshoot VirtualBox, my work around (not a solution) was to:

 # yum remove VirtualBox-5.0
 # yum install VirtualBox-4.3 

After that I was able to create the virtual machines with specified host-adapters. And of course, under VirtualBox-4.3, /dev/vboxnetcrl was there.

Now on to testing my VMs. And when I have time, I'll see if I can get it working under VirtualBox 5.0

1

If you are on Linux:

sudo service virtualbox restart
1
  • 2
    service not found :( although virtual box is installed.
    – Rubinum
    May 3, 2017 at 13:22
1

Windows 10 Pro VirtualBox 5.2.12

In my case I had to edit the Host Only Ethernet Adapter in the VirtualBox GUI. Click Global Tools -> Host Network Manager -> Select the ethernet adapter, then click Properties. Mine was set to configure automatically, and the IP address it was trying to use was different than what I was trying to use with drupal-vm and vagrant. I just had to change that to manual and correct the IP address. I hope this helps someone else.

1

I had the same problem just now and it was solved by simply reinstalling to the latest version of VirtualBox.

For those on Mac OS High Sierra - the installation might fail at first but you need to go to System Preferences > Security & Policy and click on the "Allow" button to allow Oracle installing the software.

1

For macOS Mojave, this solution worked:

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

I faced this issue on mac.

I did the following Go to: Launcher->Virtualbox

Click the icon to open Virtualbox

Start Virtualbox with the button that pops up once Virtualbox starts. Wait till the terminal window gives you the prompt,

docker@boot2docker

Then try to open docker. Hope it works!

0
1

If you are sure you have allow Oracle from system preference and the error still persist. It is highly possible you have not started VirtualBox. Ensure it is running and run vagrant up again.

1

Finally worked for me by following Given link.

https://www.mediacurrent.com/blog/drupal-vm-failed-create-host-only-adapter/

  • Tried on : 06 Mar, 2021
  • Mac OS = 11.2.2 (20D80)
  • Oracle Virtual Box = Version 6.1.18 r142142 (Qt5.6.3)
~ ➤ docker-machine create --driver virtualbox Manager1

Running pre-create checks...
Creating machine...
(Manager1) Copying /Users/speedoo/.docker/machine/cache/boot2docker.iso to /Users/speedoo/.docker/machine/machines/Manager1/boot2docker.iso...
(Manager1) Creating VirtualBox VM...
(Manager1) Creating SSH key...
(Manager1) Starting the VM...
(Manager1) Check network to re-create if needed...
(Manager1) Found a new host-only adapter: "vboxnet0"
(Manager1) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env Manager1
~ ➤
~ ➤

~ ➤ docker-machine ls

NAME       ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER      ERRORS

Manager1   -        virtualbox   Running   tcp://192.168.99.100:2376           v19.03.12

~ ➤
0

What helped me on Opensuse 42.1 is to install VirtualBox and Vagrant from the official RPMs instead of from Opensuse repositories.

0

I encountered this problem on Windows 8.1, VirtualBox 5.1.18 and Vagrant 1.9.3.

Deleting the VirtualBox Hosts-only Ethernet Adapter from VirtualBox Preferences (Network --> Hosts-only networks) fixed this for me, and vagrant up could continue and start the VM.

0

I had the same problem while following a tutorial on setting up Laravel Homestead for Windows 10. The tutorial provides an example IP address 192.168.10.10 to use for the server. The problem with their example IP is that if you already have a VirtualBox Host-Only Adapter set up, the IP you use for your vagrant server must have the same first three parts of the IP address of your current adapter.

You can check what your current Virtualbox Host-Only Adapter IP address is by running ipconfig (windows) ifconfig (mac/linux) and looking for VirtualBox Host-Only Adapter's IPv4 address. 192.168.56.1 was mine. Usually if the host IP is 192.168.56.1 then the guest IP will be 192.168.56.101 so instead of using the example IP I used 192.168.56.102. Any IP that is within 192.168.56.* that is not already taken should work.

After this homestead up worked perfectly for me.

TL;DR - If your current VirtualBox Host-Only Adapter IP is 192.168.56.1, make your Vagrant server IP 192.168.56.102.

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