This question is one that I will answer in the hope that anyone with the same problem will be able to fix the problem without too much head banging like I did!
I'd just installed VirtualBox (4.3.16) and Vagrant (1.3.5) as per the instructions on their site. All seemed pretty clear and easy until I got to the point of running the command: vagrant up
This immediately returned the error:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
This is an amazing error message... Where am I supposed to find this PATH variable???
You need to run vagrant
from an elevated prompt, i.e. cmd
needs to be "Run as administrator".
Vagrant (or VBoxManage.exe
, for that matter) does not need to be in your PATH
environment variable. The Virtual Box installer automatically sets the VBOX_INSTALL_PATH
or VBOX_MSI_INSTALL_PATH
environment variable which is what Vagrant uses to look it up, but Vagrant cannot run it unless it's elevated.
I found a lot of suggestions on how to fix it but none of them helped until I finally found someone mention that VirtualBox had renamed a variable name, I was yet to find where so after some more digging, this is the solution that finally got things working:
Look for the following file (default install path on Windows 8.1):
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.3.5\plugins\providers\virtualbox\driver\base.rb
Open this file in your favourite text editor and do a search and replace all instances of VBOX_INSTALL_PATH to VBOX_MSI_INSTALL_PATH
Hope this helps someone starting out with Vagrant and VirtualBox!
For Vagrant 1.6.5 and Virtual Box 4.3.18, I believe just restarting the computer after installing virtual box was the trick (I also reinstalled Vagrant)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With