VBoxManage: error: Failed to create the host-only adapter
Solution 1
I had the same problem today. The reason was that I had another VM running in VirtualBox.
Solution:
- Open VirtualBox and shut down every VM running
- Go to System Preferences > Security & Privacy Then hit the "Allow" button to let Oracle (VirtualBox) load.
- 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)
Solution 2
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
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
This issue appears to be fixed by installing the latest version of Virtual Box.
Solution 5
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
Related videos on Youtube
Comments
-
Adi almost 2 years
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
-
Jeff Sisson over 10 yearsyou're running vagrant from fedora or that's your vagrant box os?
-
Yuan He about 10 yearsI have the same issue and running vagrant on OS X, is that the problem of virtual box?
-
totophe over 7 years@adi could you validate the right answer? Tks
-
-
Steve Bennett about 10 yearsConfirming this works on my Mac. Shutting down other VMs isn't sufficient, but restarting VB works.
-
Erich almost 10 yearsAlso worked for me, VirtualBox UI showed no VMs up, but restarting resolved the problem. Perhaps vagrant halt didn't finish successfully the last time.
-
Ashwin Balamohan almost 10 yearsWorked perfectly! Thanks
-
jamesplease over 9 yearsThis 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.
-
amateur barista over 9 yearsDoes not work, virtualbox by default does not install at this location. I know mine is a default install and is not located in StartupItems. Please see @pazhyn answer below. Thanks!
-
amateur barista over 9 yearsWorks for me, VirtualBox 4.3.18, OS X 10.9.3. Thanks!
-
totophe over 9 years@amateurbarista I've a default installation of VirtualBox and this work, as confirmed before by others, so your assertion is not correct. Although, I've also added the more common pattern, as this solution assumes VB is started with the system.
-
Dr.jacky about 9 years@totophe What about windows?!
-
totophe about 9 years@Mr.Hyde On Windows, you should just restart the virtual machines from VirtualBox and maybe restart VirtualBox itself.
-
DevAnimal over 8 yearsMy case is Vagrant 1.7.4+Virtualbox 5.0+Windows 10 build 10240. Version 5.01 fix the issue.
-
jaguililla over 8 yearsvboxreload does not exist. Neither vbox
-
Tihomir Meščić almost 8 yearsThanks for this. I had the same issue.
-
user1501382 over 7 yearsThanks 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.
-
Rubinum about 7 yearsservice not found :( although virtual box is installed.
-
George D. over 6 yearswould running parallels also be an issue causing this error?
-
totophe about 6 years@GeorgeD. Not to my knowledge
-
Nick DuBois about 6 yearsMy local env just stopped responding. Could not get vagrant up. remove and installed vbox fixed whatever was the issue. Thanks
-
Srdjan Marjanovic over 5 yearsWorked for me! Thanks
-
lsimonetti over 5 yearsIn addition to that upgrade to Virtualbox 5.2, you need Vagrant >= 2.0.1 github.com/hashicorp/vagrant/blob/v2.1.5/…
-
Bahman.A over 5 yearsFor 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!
-
trainoasis over 4 yearsHad to do this and then click "Allow" in System preferences as mentioned by some other answers. Without this, the "Allow" did not appear even.
-
daneczech over 4 years
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! -
Redas Jarušaitis about 4 yearsWorked for me. OS X with VirtualBox 6.0 and Vagrant 2.2.7
-
Dave Hodgkinson about 4 yearsYes. Destorying the previous VM didn't do it for me.
-
wowkalucky almost 4 yearsConfirmed on: - Catalina 10.15.5 (19F101), - Vagrant 2.2.9, Virtualbox v6.0.22
-
muya_ over 3 yearsOn 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. -
Golinmarq about 3 yearsWhere do I set the allow?
-
Mirko about 3 yearsBig Sur, system pref -> security & privacy -> general -> unlock to make changes -> advanced -> approve and reboot
-
Adam almost 3 yearsThe 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.
-
Eliseu Monar dos Santos over 2 yearsYep, just restarting my Mac fixed it, thanks! (from 11.5.1 to 11.5.2)
-
Julesezaar over 2 yearsThe first vagrant up normally provisions itself... And running the provision again can mess everything up. Provisioning is often not written to run twice (not idempotent), so it will execute things again. That is always very dangerous unless you have written everything so well that it can run multiple times
-
monas over 2 yearsThat 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.
-
Pathros over 2 yearsThanks. More about how to solve it here.
-
BZC over 2 yearsThanks. It solved the problem on Monterey.
-
Apollo Grace over 2 yearsThis 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".
-
Samuel Lindblom about 2 yearsI never got the "Approve" button in Security & Privacy settings, despite following all advice. An extra restart solved it. Restart after each fix that you try, to save some headache.