Problems with VirtualBox + Vagrant on Windows 10

Problems with VirtualBox + Vagrant on Windows 10

by | 2 min read
Published:
Updated:

I am a big fan of Vagrant. I first discovered Vagrant when I was looking for ways of creating a development environment that I could transfer between various computers (I had a desktop and laptop I regularly worked on). I even toyed with the idea of installing a Linux distro on a fast USB 3 stick to carry around. It was then, while in my search for the perfect development environment that I discovered Vagrant. However, I haven’t got Vagrant on Windows 10 working until now.

Vagrant was working fine the last time I used it, mainly for WordPress theme development. I haven’t touched it for about 6 months now but after typing vagrant up and waiting I was soon greeted with this:

VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,int,int *)" at line 66 of file VBoxManageHostonly.cpp

Not really what you want to see when you are just starting to get back into something. Naturally, I did what every respectable software developer does when they get an error they haven’t seen before 🙂. It turns out the cause seems to be Windows 10 and a problem with VirtualBox.

First, I upgraded both VirtualBox and Vagrant, so I am now running VirtualBox 5.0.10 r104061 and Vagrant 1.7.4. I did a Vagrant up and got the same error.

I found the following ticket on VirtualBox’s website and downloaded the workaround app VBox-Win10-fix-14040.exe. This has to be run as Administrator and left running while your VM is being set up.

Doing this gave me a slightly different error:

Command: ["hostonlyif", "ipconfig", "VirtualBox Host-Only Ethernet Adapter #7", "--ip", "192.168.56.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage.exe: error: The host network interface with the given name could not be found
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component Host, interface IHost, callee IUnknown
VBoxManage.exe: error: Context: "FindHostNetworkInterfaceByName(name.raw(), hif.asOutParam())" at line 218 of file VBoxManageHostonly.cpp
VBoxManage.exe: error: Could not find interface 'VirtualBox Host-Only Ethernet Adapter #7'

Thinking it could be a permission issue I then set vagrant to run as an administrator in the compatibility settings for the executable and ran the vagrant up in an admin console, in addition to having the above workaround exe running and that did the trick.

If you are interested I use a slightly modified version of vagrantpress with nodejs added. You can find it on my GitHub page.

Update: This has been fixed in the latest VirtualBox test build which can be downloaded from here. I am currently using VirtualBox 5.0.11.104704 but any build later than that should work. You also don’t need to run as an administrator unless you are running something like vagrant hostupdater that needs admin access to write to the host file.


🙏 Was this helpful? If you want to say thanks, I love coffee ☕️ , any support is appreciated.


ALSO ON ALEXHYETT.COM

What is Event Driven Architecture?

What is Event Driven Architecture?

  • 14 April 2023
One of the leading architecture patterns used with microservices is event-driven architecture. Event-driven architecture has many benefits…
Hosting n8n for Free with Railway

Hosting n8n for Free with Railway

  • 30 January 2023
I have been using n8n for a couple of months now, and it has allowed me to automate so much of my daily workflow. These are some of the…
Using GitHub Actions to Deploy to S3

Using GitHub Actions to Deploy to S3

  • 26 March 2021
Recently I went through the process of setting up Drone CI on my Raspberry Pi. The plan was to use my Raspberry Pi as a build server for…
Getting Started with AWS Step Functions

Getting Started with AWS Step Functions

  • 12 March 2021
I have recently been looking into AWS Step Functions. For those not familiar with them, Step Functions are Amazon’s way of providing a state…
Useful Docker Commands Worth Saving

Useful Docker Commands Worth Saving

  • 12 February 2021
I use docker every day. All the applications I write at work or at home end up in docker containers. Most of the time though, I am only…
Grafana Monitoring on a Raspberry Pi

Grafana Monitoring on a Raspberry Pi

  • 28 January 2021
As you might have seen from my last few posts I have quite a lot running on my Raspberry Pi. I am currently using a Raspberry Pi 2 B which…
How to set up Drone CI on Raspberry Pi (and why you shouldn't)

How to set up Drone CI on Raspberry Pi (and why you shouldn't)

  • 27 January 2021
I wanted to put together my home build server using my Raspberry Pi. After looking at the options I picked Drone CI, it has a nice interface…
Traefik vs Nginx for Reverse Proxy with Docker on a Raspberry Pi

Traefik vs Nginx for Reverse Proxy with Docker on a Raspberry Pi

  • 20 January 2021
I use my Raspberry Pi as my own personal home server. Up until recently, I have been using nginx as a reverse proxy for my docker containers…