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

Virtual MachineVirtualboxDevelopment EnvironmentVagrant

Virtual Machine Problem Overview


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 Solutions


Solution 1 - Virtual Machine

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 https://stackoverflow.com/a/50589920/2867976">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 https://stackoverflow.com/users/3303055/anatolii-pazhyn">@pazhyn</a>;, https://stackoverflow.com/users/3321344/lsimonetti">@lsimonetti</a> & https://stackoverflow.com/users/6146535/dave-beauchesne">@dave-beauchesne</a> for clarifications)

Solution 2 - Virtual Machine

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

Solution 3 - Virtual Machine

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

Solution 4 - Virtual Machine

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

Solution 5 - Virtual Machine

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.

Solution 6 - Virtual Machine

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

Solution 7 - Virtual Machine

If you are on Linux, simply run: sudo vboxreload

Solution 8 - Virtual Machine

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

Solution 9 - Virtual Machine

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.

Solution 10 - Virtual Machine

I had to reinstall Virtual Box on my machine.

Here's the downloads page: Downloads Page

Then vagrant up worked for me after.

Solution 11 - Virtual Machine

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

Solution 12 - Virtual Machine

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.

Solution 13 - Virtual Machine

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

Solution 14 - Virtual Machine

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.

Solution 15 - Virtual Machine

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

Solution 16 - Virtual Machine

$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

Solution 17 - Virtual Machine

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.

Solution 18 - Virtual Machine

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.

Solution 19 - Virtual Machine

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.

Solution 20 - Virtual Machine

  • 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

Solution 21 - Virtual Machine

If you are on Linux:

sudo service virtualbox restart

Solution 22 - Virtual Machine

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.

Solution 23 - Virtual Machine

For macOS Mojave, this solution worked:

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

Solution 24 - Virtual Machine

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!

Solution 25 - Virtual Machine

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.

Solution 26 - Virtual Machine

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

vagrant up --provision

Solution 27 - Virtual Machine

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

~

Solution 28 - Virtual Machine

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

Solution 29 - Virtual Machine

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.

Solution 30 - Virtual Machine

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

Solution 31 - Virtual Machine

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.

Solution 32 - Virtual Machine

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.

Solution 33 - Virtual Machine

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.

Solution 34 - Virtual Machine

My solution

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

Solution 35 - Virtual Machine

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

Solution 36 - Virtual Machine

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

Solution 37 - Virtual Machine

I had this problem on Arch. Here is how I solved it.

I needed all the following packages:

➜  ~ pacman -Ss virtualbox | grep installed
extra/linux-zen 5.12.14.zen1-1 [installed]
community/virtualbox 6.1.22-3 [installed]
community/virtualbox-ext-vnc 6.1.22-3 [installed]
community/virtualbox-guest-iso 6.1.22-1 [installed]
community/virtualbox-guest-utils 6.1.22-3 [installed]
community/virtualbox-host-dkms 6.1.22-3 [installed]
community/virtualbox-sdk 6.1.22-3 [installed]
chaotic-aur/linux-tkg-muqss 5.12.15-178 [installed]
chaotic-aur/virtualbox-ext-oracle 6.1.22-1 [installed]
chaotic-aur/virtualbox-meta 2-1 [installed]

My AMD motherboard (Gigabyte X570 AORUS Master) had AMD Secure Virtual Machine (SVM) set to 'Disabled' by default. I changed it to 'Enabled' in the BIOS.

Rebooting and running:

vagrant up

Finally worked without any issues. Just be sure to obviously have a properly configured Vagrantfile.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAdiView Question on Stackoverflow
Solution 1 - Virtual MachinetotopheView Answer on Stackoverflow
Solution 2 - Virtual MachineAnatolii PazhynView Answer on Stackoverflow
Solution 3 - Virtual MachinelsimonettiView Answer on Stackoverflow
Solution 4 - Virtual Machineuser1718159View Answer on Stackoverflow
Solution 5 - Virtual MachineespradleyView Answer on Stackoverflow
Solution 6 - Virtual MachineShobiView Answer on Stackoverflow
Solution 7 - Virtual MachineNicoView Answer on Stackoverflow
Solution 8 - Virtual MachineJonathanView Answer on Stackoverflow
Solution 9 - Virtual MachineMcRuiView Answer on Stackoverflow
Solution 10 - Virtual MachineDavid KatzView Answer on Stackoverflow
Solution 11 - Virtual MachinetomtomczukView Answer on Stackoverflow
Solution 12 - Virtual MachineFahadView Answer on Stackoverflow
Solution 13 - Virtual MachinejaguilillaView Answer on Stackoverflow
Solution 14 - Virtual Machinec.sankhalaView Answer on Stackoverflow
Solution 15 - Virtual MachineDave BeauchesneView Answer on Stackoverflow
Solution 16 - Virtual MachineNateShumateView Answer on Stackoverflow
Solution 17 - Virtual MachineSrinivasanView Answer on Stackoverflow
Solution 18 - Virtual MachineLevi RoelofsmaView Answer on Stackoverflow
Solution 19 - Virtual MachineAdiView Answer on Stackoverflow
Solution 20 - Virtual MachineAntonio DView Answer on Stackoverflow
Solution 21 - Virtual MachineDiogo GomesView Answer on Stackoverflow
Solution 22 - Virtual MachineJohn ErhardtView Answer on Stackoverflow
Solution 23 - Virtual MachineMilan ManwarView Answer on Stackoverflow
Solution 24 - Virtual MachineAnkit MarothiView Answer on Stackoverflow
Solution 25 - Virtual MachinetrustidkidView Answer on Stackoverflow
Solution 26 - Virtual MachineMrVanillaView Answer on Stackoverflow
Solution 27 - Virtual Machineuser624441View Answer on Stackoverflow
Solution 28 - Virtual MachineCmykerView Answer on Stackoverflow
Solution 29 - Virtual MachineHenricFView Answer on Stackoverflow
Solution 30 - Virtual MachineaDoNView Answer on Stackoverflow
Solution 31 - Virtual MachineomikesView Answer on Stackoverflow
Solution 32 - Virtual MachineVáclav ZemanView Answer on Stackoverflow
Solution 33 - Virtual MachineMesutiView Answer on Stackoverflow
Solution 34 - Virtual Machinejerry xuView Answer on Stackoverflow
Solution 35 - Virtual MachineNewtView Answer on Stackoverflow
Solution 36 - Virtual MachineMacMartinView Answer on Stackoverflow
Solution 37 - Virtual MachinepythonInRelayView Answer on Stackoverflow