4

I'm trying to get Vagrant up and running on a 64-bit Windows 7 machine, and I'm continually getting an error that "Vagrant could not detect VirtualBox!" Here's what I've got installed:

  • JRE 6.0.230.25 x64
  • JRuby 1.6.0.0
  • Ruby 1.8.7.330 (Windows)
  • VirtualBox 3.2.12
  • Current version of Vagrant (as of 01/18/11)

I've been getting the same error every single time I try a command such as

vagrant box add eyu package.box

and now I'm kind of at my wits' end. Any suggestions?

(And I only installed the Windows version of Ruby after I had been wrestling with this for a while. I don't know if it could potentially causing some other conflict to have JRuby and Ruby installed on the same machine, but I've been getting this error before and after I installed it.)

Thanks in advance for any help.

Laurent Stanevich
  • 285
  • 1
  • 3
  • 8

5 Answers5

3

Have you put the Virtualbox commands in your path?

set path=%path%;c:/programfiles/oracle/bin or similar?

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
2

In my case this problem was caused by the Java Home variable still pointing to the Java 32-bit version (Program Files(x86)).

Also: when you change the Java Home variable, restart your cmd for it to take effect ;-) (drove me nuts before I figured that one out)

Dieter
  • 1,690
  • 2
  • 15
  • 28
1

It seems that vagrant is looking for "VBoxManage" instead of "VBoxManage.exe".

I changed the file:

<VAGRANT>/embedded/gems/gems/vagrant-1.4.3/plugins/providers/virtualbox/driver/base.rb

at line 26:

- @vboxmanage_path = "VBoxManage"
+ @vboxmanage_path = "VBoxManage.exe"
Kaniabi
  • 530
  • 5
  • 10
  • Thanks, @Kaniabi! It turns out, that Vagrant is very specific about the Env variable format. It seeks the presence of a `"VBOX_INSTALL_PATH"` variable with the value that ends with `"\"`. What a logic! Anyhow, I adjusted the value and the "VBoxManage error" has gone. (Ref. ```HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.2\plugins\providers\virtualbox\driver\base.rb, line 28```, and on..) – Andrevinsky May 21 '14 at 11:32
1

Had this same problem, in the end the solution was to make sure JRuby was using a 64b JRE to execute: see https://groups.google.com/forum/#!topic/vagrant-up/jnksKOR_Qhs.

Note that if you have JAVA_HOME set in your environment, even if you install JRuby with the installer that includes the JRE, it will use the JRE from your JAVA_HOME. You have to manually set JAVA_HOME=c:\jruby-x.y.z\jre.

Ilkka
  • 2,644
  • 1
  • 23
  • 27
0

Similar with Kaniabi I changed the path to the absolute one:

- @vboxmanage_path = "VBoxManage"
+ @vboxmanage_path = "c:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe"

Cheers!

adrianthedev
  • 626
  • 1
  • 11
  • 21