ydma0q
Last Updated: February 25, 2016
·
23.6K
· clawfire
Img 1751

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
Say Thanks
Respond

19 Responses
Add your response

10040
Mikey2013 closecrop

Thanks, this helped me out a lot!

over 1 year ago ·
10324
664875a2b36e777dd82e62a5c359ad35

Thank you. Works on my new MBP with Mavericks.

over 1 year ago ·
10401
9f06b6fefdb3bcf202cd0f51670be74d

Boom. Exactly what I needed.

over 1 year ago ·
10474

Tkx !!!

over 1 year ago ·
10502
33de789aa3fc0dc60bdc4b7df3a9b0c3

Thanks! Why does this work?

over 1 year ago ·
10510
Img 1751

@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
1619565956 4b00607ecb o normal

Awesome!

over 1 year ago ·
10632
168cdf24e77e80e50c6f0ca9c56ae9ad normal

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

over 1 year ago ·
10633
Img 1751

@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
Img 1751

@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
6e7c502e136ccdfc927f0006f06ed483

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
Mikey2013 closecrop

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

over 1 year ago ·
12259
77a7500d2b03032594daa60de367c8a7

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
611f1d8eb79939e14d943192a2be4b13

Thank's!!

over 1 year ago ·
15107
Ad8e0bd374cf748eeaa0e831194ae8ac

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 ·
Filed Under