Problems with VirtualBox + Vagrant on Windows 10

Published | 2 min read

I am 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 round. 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 getting 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 off 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 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.

ALSO ON ALEXHYETT.COM

Stack vs Heap Memory - What are the differences?

Stack vs Heap Memory - What are the differences?

  • 30 November 2022
In modern programming languages such as C# or Java, we tend to take memory management for granted. Gone are the days when we need to call malloc to request enough memory for our variables. Luckily a lot of that is done for us by the runtimes so we do...
Code Katas: Can They Make You A Better Developer?

Code Katas: Can They Make You A Better Developer?

  • 21 November 2022
They say “practice makes perfect”, although I much prefer “practice makes improvement”. Either way, how do you practice being a programmer? If you are already working as a software developer then you will be getting some practice from working on larg...
Git Flow vs GitHub Flow

Git Flow vs GitHub Flow

  • 10 November 2022
Losing code that you have spent hours writing can be painful, which is why we use version control (or source control) to store our code and manage changes. Version control is even more important if you are working in a team, without it code, changes ...
I Posted on YouTube Consistently for 1 Month. This is What Happened!

I Posted on YouTube Consistently for 1 Month. This is What Happened!

  • 02 November 2022
As part of my creative sabbatical, I have been posting a new software development video on my YouTube channel every Monday and Friday. It takes a long time to grow on YouTube, and I knew this going in but I have been pleasantly surprised with my grow...
Bitwise Operators and WHY we use them

Bitwise Operators and WHY we use them

  • 26 October 2022
Bitwise operators are one of those concepts that a lot of programmers don’t understand. These are not used a great deal anymore so you can get away with not knowing them but they can still come in handy for a number of different scenarios. If you end...
8 Data Structures you NEED to Know

8 Data Structures you NEED to Know

  • 26 October 2022
You can get pretty far in programming without understanding Data Structures, but eventually, you are going to need to know them, understand how they work and when to use them. https://www.youtube.com/watch?v=SCkbQSPH--A What is a data structure? A da...
Binary Numbers Explained for Programmers

Binary Numbers Explained for Programmers

  • 21 October 2022
Everyone knows that computers run on ones and zeros. This is because CPUs are made up of billions of transistors, which are basically just on-off switches. Any code you write needs to be processed by a computer and therefore has to be converted to b...
Beginners Guide to Programming

Beginners Guide to Programming

  • 12 October 2022
A lot of my articles are aimed at intermediate to advanced developers, but as part of my creative sabbatical, I am working on creating content for those just starting out. So in this post I will be covering some of the many questions that beginner pr...