Fixing ‘vagrant up’ Errors

By  on  

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!

Recent Features

  • By
    Facebook Open Graph META Tags

    It's no secret that Facebook has become a major traffic driver for all types of websites.  Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly.  And of course there are Facebook "Like" and "Recommend" widgets on every website.  One...

  • By
    5 HTML5 APIs You Didn’t Know Existed

    When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It."  Can you blame us though?  We watched the fundamental APIs stagnate for so long that a basic feature...

Incredible Demos

  • By
    :valid, :invalid, and :required CSS Pseudo Classes

    Let's be honest, form validation with JavaScript can be a real bitch.  On a real basic level, however, it's not that bad.  HTML5 has jumped in to some extent, providing a few attributes to allow us to mark fields as required or only valid if matching...

  • By
    Display Images as Grayscale with CSS Filters

    CSS filters aren't yet widely supported but they are indeed impressive and a modern need for web imagery.  CSS filters allow you to modify the display of images in a variety of ways, one of those ways being displaying images as grayscale. Doing so requires the...

Discussion

  1. I had this when upgrading to Mac OS Mavericks :-)

  2. 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!

  3. 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

  4. Sam Walsh

    You legend! Thanks heaps!

  5. Awesome, just what I needed after upgrading to Mavericks! Thank you very much!

  6. Thanks! This solved my issue with vagrant after upgrading to Mac OS Mavericks!

  7. Salvo

    Sharing is caring..thanks a lot, you really took care of me good sir.

  8. 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.

  9. Andy

    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)

  10. Andy

    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)

  11. Harry

    Amazing. Like some said above, this fixed the issue after upgrading to Mavericks.

  12. dani

    thanks for the info!

  13. Martin

    /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.

    • rix

      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.

  14. thanks for this… the update screwed up vagrant on my work iMac and this is a super useful tip.

  15. Awesome, thanks! :)

  16. Sabrina

    Thanks, David! Ran into this after upgrading to Mavericks. Now it’s working again.

  17. Nicolas Dubois

    Thx for the tip. :)

  18. Ronny

    Thank you so much, you saved my week (cause it is the first monday after the upgrade to Mavericks)!
    :)

  19. Robert

    Is it just me who has to run the command after every reboot?

  20. 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

  21. Robert

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

  22. 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.

  23. Brian

    @Casey I think you mean 4.3.2?

  24. Upgrading to VirtualBox v4.3.2 and Vagrant 1.3.5 worked for me. No more vagrant up errors.

  25. Robert

    @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 :(

  26. Robert

    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.

  27. Nice ! This is what we need after upgrading to Mavericks

  28. Thanks! No idea what caused the error, but this sorted it out.

  29. Upgrade to Mavericks broke mine. This worked great, thanks!

  30. Alex

    Thanks, this did the trick and my vm is up and running again.

  31. I had the same problem after upgrading to OSX Mavericks as well. Thanks! :)

  32. Thank you David! You saved the day.

  33. Sam

    Nice one! Thank you very much.

  34. Shane O.

    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.

  35. Olivers solution worked for me. I had to open up Acitivity Monitor and kill VBoxHeadless.

    Thanks to the both of you :)

  36. Christopher

    Works great thanks for the tip

  37. Ugur

    Thank you!

  38. Does anybody have any idea what actually causes this issue? I feel like that would be much more helpful than a reboot workaround…

  39. Demian Brecht

    What a pain. Thanks!

  40. thanks! you saved my night…

  41. dilpreet

    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:

    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: E_FAIL
    VBoxManage.exe: error: Failed to create the host-only adapter
    VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended in
    fo not available)
    VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,in
    t,int *)" at line 68 of file VBoxManageHostonly.cpp
    
    C:\Users\dilpreet.kaur\mitx-vagrant>sudo /Library/StartupItems/VirtualBox/Virtua
    lBox restart
    'sudo' is not recognized as an internal or external command,
    operable program or batch file.
    

    can you tell me how to get rid of this error using windows cmd terminal.

  42. Thank you. You saved my day

  43. Y-Love

    Thank you so much, @Shane O.!
    <

  44. Y-Love

    Thank you Shane O!

    sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh start

    worked for me.

  45. Aftab

    Thank you, this worked for me

    sudo /Library/StartupItems/VirtualBox/VirtualBox restart

  46. Wahid Kadwaikar

    What would be the windows alternative for this command?

  47. 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 .

  48. Michael

    I can confirm that what David mentioned doing fixes the issue on Windows 10. Thanks David! Saved me a lot of time.

  49. Kopahead

    Thank you sir, Windows 10 issues defeated!

  50. Gordon

    From ‘oracle vm virtual box’ on windows I deleted the vm in particular and its files and that did the trick

  51. Imj

    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

  52. praveenkumar

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

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!