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

110

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

26 Answers

136

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. 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 for clarifications)

answered on Stack Overflow Jan 26, 2014 by totophe • edited Oct 24, 2019 by totophe
52

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
38

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 Oct 25, 2018 by Shobi
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
3

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 jamming
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
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
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

User contributions licensed under CC BY-SA 3.0