VBoxManage: error: Failed to create the host-only adapter

145

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
virtual-machine
virtualbox
development-environment
vagrant
asked on Stack Overflow Jan 12, 2014 by Adi • edited Mar 23, 2018 by GabrielOshiro

33 Answers

214

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)

answered on Stack Overflow Jan 26, 2014 by totophe • edited Mar 20, 2021 by totophe
63

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
answered on Stack Overflow Jul 1, 2014 by Anatolii Pazhyn
51

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)

answered on Stack Overflow May 29, 2018 by lsimonetti • edited Oct 16, 2019 by lsimonetti
14

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

answered on Stack Overflow Aug 4, 2015 by user1718159 • edited Jul 25, 2016 by jacobappleton
10

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.

answered on Stack Overflow Oct 14, 2015 by espradley
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

answered on Stack Overflow Sep 28, 2018 by Shobi • edited Jun 20, 2020 by Community
7

If you are on Linux, simply run: sudo vboxreload

answered on Stack Overflow Jul 17, 2015 by Nico • edited Oct 19, 2015 by Zaz
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

answered on Stack Overflow Jul 6, 2017 by Jonathan
6

I had to reinstall Virtual Box on my machine.

Here's the downloads page: Downloads Page

Then vagrant up worked for me after.

answered on Stack Overflow Aug 17, 2017 by David Katz
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.

answered on Stack Overflow Jul 12, 2015 by Fahad
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
answered on Stack Overflow Oct 21, 2015 by jaguililla
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

answered on Stack Overflow Nov 15, 2020 by Dave Beauchesne
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.

answered on Stack Overflow Dec 14, 2015 by Srinivasan • edited Dec 14, 2015 by gitsitgo
2

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.

answered on Stack Overflow Jul 5, 2020 by c.sankhala
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.

answered on Stack Overflow Feb 4, 2014 by Adi
1
$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
answered on Stack Overflow Mar 27, 2014 by NateShumate
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

answered on Stack Overflow Feb 19, 2016 by Antonio D
1

If you are on Linux:

sudo service virtualbox restart
answered on Stack Overflow Feb 23, 2017 by Diogo Gomes
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.

answered on Stack Overflow Jun 8, 2018 by John Erhardt
1

For macOS Mojave, this solution worked:

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
answered on Stack Overflow Aug 29, 2019 by Milan Manwar
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!

answered on Stack Overflow Sep 25, 2019 by Ankit Marothi
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

~ ➤
answered on Stack Overflow Mar 8, 2021 by user624441 • edited May 6, 2021 by Giacomo1968
0

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

answered on Stack Overflow Aug 3, 2016 by Cmyker
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.

answered on Stack Overflow Mar 29, 2017 by HenricF
0

My solution:

Make sure you have the following files under System32:

vboxnetadp.sys

vboxnetflt.sys

You can download them from here:

http://www.sysfilesdownload.com/V/VBoxNetFltsys.html

http://www.sysfilesdownload.com/U/VBoxNetAdp.sys.html

answered on Stack Overflow Jun 2, 2017 by aDoN
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.

answered on Stack Overflow Mar 15, 2018 by omikes • edited Mar 15, 2018 by omikes
0

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.

answered on Stack Overflow Aug 22, 2018 by Václav Zeman
0

If you use macOS High Sierra or upper version you can find the bash script at the location:

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

So If you got this kind of error:

/Library/Application Support/VirtualBox/VBoxDrv.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).

You can solve it via System Preferences > Security & Privacy section and Allow the VirtualBox.

answered on Stack Overflow Feb 1, 2019 by Mesuti
0

My solution

System Preferences -> System Security Privacy -> Allow oracle.xxxx; then reinstalling the virtualBox.

answered on Stack Overflow Oct 23, 2019 by jerry xu
0

I want to mention that.

Open VirtualBox and shut down every VM running.

The shut down should be power off.

And if your virtualbox has been added in the Path in linux (Mine is Ubuntu). You can just use command: virtualbox restart

answered on Stack Overflow Dec 4, 2019 by Newt
0

I came here, working with kitchen-CI and having problems with vagrant. After (re-)moving the "~/.kitchen"-directory the kitchen converge was successfull again

answered on Stack Overflow Apr 23, 2020 by eli
0

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.

answered on Stack Overflow Jul 22, 2020 by trustidkid
0

Sometimes this can be fixed by provisioning the box on vagrant up

vagrant up --provision
answered on Stack Overflow Aug 9, 2020 by MrVanilla

User contributions licensed under CC BY-SA 3.0