ydma0q
Last Updated: November 22, 2018
·
27.22K
· clawfire

Resolve a hostonlyif create error with vagrant

On my freshly installed vagrant + virtualBox macbook, I got this error on my first vagrant up :

Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'Cupcake'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[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: failed to open /dev/vboxnetctl: No such file or directory

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 68 of file VBoxManageHostonly.cpp

The solution is pretty ease :

OSX

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

Linux

sudo modprobe vboxnetadp

19 Responses
Add your response

10040

Thanks, this helped me out a lot!

over 1 year ago ·
10324

Thank you. Works on my new MBP with Mavericks.

over 1 year ago ·
10401

Boom. Exactly what I needed.

over 1 year ago ·
10474

Tkx !!!

over 1 year ago ·
10502

Thanks! Why does this work?

over 1 year ago ·
10510

@mintindeed : Mainly the problem for some reasons virtualbox stop letting vagrant manipulate the network interface. Restarting the virtual box process in osx and just the network manager in linux let vagrant use the command again .

over 1 year ago ·
10538

Awesome!

over 1 year ago ·
10632

I have to do this command after every reboot of mavericks? Is there any solution?

over 1 year ago ·
10633

@ronn235 : I'm afraid not 😃 you just have to run it once, the error should stop occurred after that .

over 1 year ago ·
10894

There should be a way to have this as a permanent fix...

over 1 year ago ·
10897

@mendrinos : As I said to @ronn235, it still working for me without having to use the command again. I think it's just in case there's a little mess up in the installation / upgrading process regarding network interfaces and not supposed to happened

over 1 year ago ·
11160

Thanks. Though worth noting - this only worked after opening Virtualbox.app and deleting/removing some bugged/errant/old VMs. (OS X 10.9)

over 1 year ago ·
11669

I'm running this after every reboot as well unfortunately. Mavericks as well.

over 1 year ago ·
12259

Try this instead:
sudo chmod +x /Library/StartupItems/VirtualBox/StartupParameters.plist

I noticed that the plist didn't have execute permissions, which explains why it isn't run on startup.

Haven't tried it yet, but I'm guessing it works.
I restart my mac once a blue moon.

Good luck!

over 1 year ago ·
12851

For those of you that get "command not found", try:

sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist

over 1 year ago ·
13149

Thanks! Had this problem right now. Solved! =)

over 1 year ago ·
14377

Thank's!!

over 1 year ago ·
15107

OS X 10.9.3 (13D65)
Darwin Kernel Version 13.2.0
Vagrant 1.6.3

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

Will do.

over 1 year ago ·
15675

Running Arch, works awesome

over 1 year ago ·