Getting past vagrant/VirtualBox issues on Ubuntu or Windows
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Getting past vagrant/VirtualBox issues on Ubuntu or Windows

by dhalbert on Tue Jan 10, 2017 11:17 pm

I've brought up the vagrant build VM for CircuitPython, but it was not without difficulty. I thought I might record some issues here in case some of you are going down the same paths I did. This is a highly technical post which most people may not care about.

Ubuntu: problems with VirtualBox and Secure Boot

At home, I normally run Ubuntu as a VMware Player guest under Windows 10. Running VIrtualBox inside VMware is possible, but it didn't seem worth the effort, so I made a Windows box be dual boot with Ubuntu 16.04 using an external drive. However, I ran into trouble because VirtualBox would not install properly on Ubuntu: Ubuntu did not like the unsigned kernel modules it wanted to install. Ubuntu complains about this if UEFI Secure Boot is enabled. I could have turned off Secure Boot, but did not want to do that, so I moved on to the next possibility, running VirtualBox and vagrant on Windows 10.

Windows 10: Problem with VirtualBox and vagrant

I downloaded the latest VirtualBox (5.1.12) and vagrant (1.9.1) and installed them. I also git cloned Tony's Vagrant VM for building CircuitPython. However, when I ran vagrant up, I got this error:

Code: Select all | TOGGLE FULL SIZE
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_INVALIDARG
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Assertion failed: [!aInterfaceName.isEmpty()] at 'F:\tinderbox\win-5.1\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (74) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0038).
VBoxManage.exe: error: Please contact the product vendor!
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 71 of file VBoxManageHostonly.cpp

Some websearching turned this up as known problem of vagrant trying to create a host-only network interface but having trouble finding out about its name. There are various workarounds, but the easiest one seemed to be this:

1. Start up VirtualBox.
2. Go to File->Preferences->Network->Host-only Networks.
3. Double-click on one of the "VirtualBox Host-Only Ethernet Adapter" entries there.
4. Copy the IP address listed and the exact name of the virtual network interface (see screenshot below).
5. In the Vagrantfile for the CircuitPython VM, change this line:
Code: Select all | TOGGLE FULL SIZE
  config.vm.network "private_network", ip: ""

to include the info you copied, including both IP address and (now also the) name, for example(your values may be different):
Code: Select all | TOGGLE FULL SIZE
  config.vm.network "private_network", ip: "", name: "VirtualBox Host-Only Ethernet Adapter"

Now you can do "vagrant up", and it should work, because it doesn't need to create a new interface.

(It looks like Tony and Scott may have spared themselves some of these problems by using a Mac.)

virtual-box-network.PNG (65.79 KiB) Viewed 478 times

Posts: 401
Joined: Tue Feb 17, 2015 6:18 pm

Please be positive and constructive with your questions and comments.