Fixing ‘vagrant up’ Errors
When I'm working on MDN's source, kuma, I use a technology called Vagrant to do so. Vagrant helps to create an manage a virtual machine that hosts MDN locally. Occasionally, however, I get errors which prevent me from starting the machine, which halts work all together. Here is one such example:
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
Of course that error doesn't mean much to me -- I simply want my machine to work. After searching high and low, I found that the following command remedies the issue:
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
That command restarts VirtualBox, the app which runs the Vagrant box. The next `vagrant up` try works and I'm up and working again!
I had this when upgrading to Mac OS Mavericks :-)
You sir, are a gentleman and a scholar. Exactly what I needed to do after installing OSX Mavericks (as Phil already stated).
All is well. Thanks again for sharing!
It wasn’t working for me initially.
Unloading VBoxDrv.kext
(kernel) Can’t remove kext org.virtualbox.kext.VBoxDrv; services failed to terminate – 0xe00002c7.
Failed to unload org.virtualbox.kext.VBoxDrv – (iokit/common) unsupported function.
-v Error: Failed to unload VBoxDrv.kext
-f VirtualBox
I have to open Activity Monitor app, kill the VBoxHeadless process, and then run your command again.
All working now! :)
Oliver
You legend! Thanks heaps!
Awesome, just what I needed after upgrading to Mavericks! Thank you very much!
Thanks! This solved my issue with vagrant after upgrading to Mac OS Mavericks!
Sharing is caring..thanks a lot, you really took care of me good sir.
This is awesome! Thanks so much! I just upgraded to Mavericks and of course that halted my vagrant development as well. This trick fixed it though.
I cant open a second vagrant using this fix, only one at a time. (But thanks — it did help me out tremendously after upgrading to Tom Cruise)
UPDATE: If you try to run two vagrants at once (on Mavericks) with hostonly IP addresses that are on the same subnet, you will get [“hostonlyif”, “create”]
Make sure your vagrants are on separate subnets, e.g. 192.168.33.10 and 192.168.34.10 (Vagrant will default to subnet mask 255.255.255.0)
Amazing. Like some said above, this fixed the issue after upgrading to Mavericks.
thanks for the info!
/Library/StartupItems/VirtualBox/VirtualBox didn’t exist.
So I had to run:
sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist
Since the latest Virtualbox this indeed did fix the problem for me! The StartupItems method is deprecated.
Hi Martin
Tnx for the tip. Fixed my issue today. Cheer
Hi martin
no need to run /Library/StartupItems/VirtualBox/VirtualBox this
u can just use :–
1. config.vm.box = “coreos-stable”
2. config.vm.box = “ubuntu/trusty64” second line in Vagrant file then after completed use first one in vagrant file.
It will work fine.
thanks for this… the update screwed up vagrant on my work iMac and this is a super useful tip.
Awesome, thanks! :)
Thanks, David! Ran into this after upgrading to Mavericks. Now it’s working again.
Thx for the tip. :)
Thank you so much, you saved my week (cause it is the first monday after the upgrade to Mavericks)!
:)
Is it just me who has to run the command after every reboot?
Yeah Robert. I have to re-run this command after every reboot as well. Everyone seems to be offering this same solution. Virtualbox recently got updated to v4.3, so uninstalling Virtualbox v4.2.xx and then installing v4.3 might help. I haven’t tested this yet, but this issue on Github gave me the idea:
https://github.com/mitchellh/vagrant/issues/2418
@Adam, ok. Yeah, I’ve tried the latest VirtualBox release, but it’s not compatible with Vagrant so had to revert to 4.2.16. If I find any permanent solution I’ll be sure to tell here :)
Installing VirtualBox 4.2.3 fixes this issue **permanently**.
Working fine after reboot with Mac OS X 10.9 Mavericks (13A603), Vagrant 1.3.5 and VirtualBox 4.2.3.
@Casey I think you mean 4.3.2?
Upgrading to VirtualBox v4.3.2 and Vagrant 1.3.5 worked for me. No more vagrant up errors.
@Adam; Upgrading creates more problems for me :-(
[default] Exporting NFS shared folders…
Preparing to edit /etc/exports. Administrator privileges will be required…
[default] Mounting NFS shared folders…
Then it just dies…
Using VirtualBox v4.3.2 and Vagrant 1.3.5 :(
I stand corrected, looks like it’s just one of my environments that has this issue. I’ll make sure the Vagrant file is compatible and rebuild the environment.
Nice ! This is what we need after upgrading to Mavericks
Thanks! No idea what caused the error, but this sorted it out.
Upgrade to Mavericks broke mine. This worked great, thanks!
Thanks, this did the trick and my vm is up and running again.
I had the same problem after upgrading to OSX Mavericks as well. Thanks! :)
Thank you David! You saved the day.
Nice one! Thank you very much.
Always the impatient one, I read far enough to get the path to the command, but didn’t get to the comments to see Martin’s comment with the updated command path.
On my latest-as-of-22-Jan-2014 OS X Mavericks system, the following command ended up working for me:
sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh start
David — thanks for the original article and hosting the comments!
Cheers!
Shane O.
Olivers solution worked for me. I had to open up Acitivity Monitor and kill VBoxHeadless.
Thanks to the both of you :)
Works great thanks for the tip
Thank you!
Does anybody have any idea what actually causes this issue? I feel like that would be much more helpful than a reboot workaround…
What a pain. Thanks!
thanks! you saved my night…
I am working on windows cmd terminal.
I followed this link for edx installation: http://people.csail.mit.edu/ichuang/edx/
i got the following error:
can you tell me how to get rid of this error using windows cmd terminal.
Thank you. You saved my day
Thank you so much, @Shane O.!
<
Thank you Shane O!
sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh start
worked for me.
Thank you, this worked for me
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
What would be the windows alternative for this command?
Found this for windows users fixed my issue I’am on windows 10:-
You don’t need to uninstall or restart anythings. Below is under VirtualBox 5.0 ,
Run VirtualBox(GUI program)
press ALT-F then ALT-G to open the ‘global settings'( I am not sure what the menu text are called in English.)
Network->Host-only Networks
Edit the adapter which has the maximum number with the address match your vagrant settings.
In my machine, the ip of vagrant box is : “192.168.10.10”,(check it in the .yaml file under your box directory), so I fill the #3 adapter’ field with 192.168.10.1 and 255.255.255.0.
close VirtualBox GUI and Run :vagrant up .
I can confirm that what David mentioned doing fixes the issue on Windows 10. Thanks David! Saved me a lot of time.
Thank you sir, Windows 10 issues defeated!
From ‘oracle vm virtual box’ on windows I deleted the vm in particular and its files and that did the trick
Old thread with an apparently unrelated issue to mine but sorted on Win 10 thanks to David’s advice. I had an error with a Laravel Homestead install where the VM would boot and ssh would work but access to the web server timed out.
1. Oracle VM Virtualbox > Preferences > Network > Host-only Networks
2. Edit the last item in the list to: 192.168.10.1 & 255.255.255.0
3. Deleted a duplicate entry
4. Save & close
5. vagrant up
Hi Folks,
I’m facing the same problem in windows 10. But didn’t luck with Oracle VM Virtualbox > Preferences > Network > Host-only Networks… it’s automatically changing to default ones… 192.168.56.1 & 255.255.255.0
Could someone please help me.. this is blocking me like anything..