Vagrant and Virtualbox problems on Windows 7

For some I’ve been learning all about the PHP Laravel Framework with the help of Jeffrey Way at Laracasts.

I have two main development machines that I work with and both use Windows 7 (64bit).

As Laravel has improved we now utilise Vagrant & Virtualbox to action virtual linux servers for  development and testing.  Cool!

A few days ago on one of my machines this all stopped working!

The Problem

I was restarting a project from scratch and so on my slightly older Windows 7 machine I went to create and new Vagrant box.  I’ll stick with the normal test Vagrant box and highlight what went wrong.

  • VM VirtualBox version 4.3.12 installed
  • I setup a new VM using the normal interface to ensure it actually worked.  I happily set up a Ubuntu box using this ISO.
  • I have Vagrant version 1.6.3 installed
  • I have Git bash for Windows 1.9.4.msysgit.2
  • My GitBash icon is setup to “Run as Administrator”, as I’d encountered Vagrant permission errors in the past.
  • In Gitbash… I created a new folder /c/david/code/vagrant-test.
  • I ran the command “vagrant init hashicorp/precise32” to install the Vagrant file.
  • The ran “vagrant up” to initialise the Vagrant box.

I then get the error:

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object! VBoxManage.exe: error: Code E_NOINTERFACE (0x80004002)

I trawled Google, the VirtualBox forums and Vagrant forums to try and get an answer.  I actioned multiple installs and uninstalls both as admin and not, running icons as admin on and off, all with no success.

I then tried the very same thing on my other Windows 7 machine and it happily worked.  Very weird!

Aha!

So I then compared VMBox log files and saw this difference.  My log files were located in C:\Users\david\.VirtualBox.

Older Machine – Windows 7 (64 bit)

VirtualBox COM Server 4.3.12 r93733 win.amd64 (May 16 2014 13:57:11) release log
00:00:00.083004 main Log opened 2014-10-31T12:07:06.943331300Z
00:00:00.083004 main Build Type: release
00:00:00.083004 main OS Product: Windows Vista Business Edition
00:00:00.083004 main OS Release: 6.0.6002
00:00:00.083004 main OS Service Pack: 2
00:00:00.182010 main DMI Product Name: Latitude E6500
00:00:00.197011 main DMI Product Version:
00:00:00.197011 main Host RAM: 4047MB total, 1667MB available

 

Newer Machine – Windows 7 (64 bit)

VirtualBox GUI VM Selector Window 4.3.12 r93733 win.amd64 (May 16 2014 13:57:11) release log
00:00:01.237070 Log opened 2014-10-31T10:45:03.656004200Z
00:00:01.237070 Build Type: release
00:00:01.237070 OS Product: Windows 7
00:00:01.237070 OS Release: 6.1.7601
00:00:01.237070 OS Service Pack: 1
00:00:01.245071 DMI Product Name: Latitude E6530
00:00:01.249071 DMI Product Version: 01
00:00:01.249071 Host RAM: 8065MB total, 3074MB available
00:00:01.249071 Executable: C:\Program Files\Oracle\VirtualBox\VirtualBox.exe

So it turns out all Windows 7 versions are not the same. Hope this helps someone else in the same predicament.

Solution

That got me thinking about all the compatibility modes that had been mentioned in the forums, so I then setup my GitBash icon to start with Compatibility Mode set to Windows Vista (Service Pack 2) with “Run as Admin” set on both the compatibility page and the General/Advanced page (just in case).

I was then able to successfully run vagrant up!

So it turns out all Windows 7 versions are not the same. Hope this helps someone else in the same predicament.

 

Leave a Comment

Your email address will not be published. Required fields are marked *