These are the steps to install a dev version of Vagrant on your Windows machine. It does assume you also have normal Vagrant installed on the default location, since it needs the packages binaries of a few libraries to work completely. Normal path would be C:\HashiCorp\Vagrant
.
- Install Ruby 2.2 ( http://rubyinstaller.org/downloads/ ) and let the install add Ruby to the path.
- Download the DevelopmentKit ( http://rubyinstaller.org/downloads/ ) and extract to a directory (eg.
c:\RubyDevKit
) - Open command prompt and run installation scripts ( https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#4-run-installation-scripts )
cd c:\RubyDevKit
ruby dk.rb init
ruby dk.rb install
At the moment the version of Ruby / Bundler used has a bug which results in the following error SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
. See stackoverflow for a solution.
- Easiest fix for now is to create a
.gemrc
file in your%USERPROFILE%
with the following content::ssl_verify_mode: 0
.
Next up, getting Vagrant running from source. Their documentation is mostly correct. ( https://www.vagrantup.com/docs/installation/source.html#install-ruby )
- Clone vagrant
git clone https://github.com/mitchellh/vagrant.git
( for this document i assume the path will bec:\vagrant
) - Check vagrant.gemspec for the specific version of bundler you need. And install that version (currently 1.12.5).
gem install bundler -v '1.12.5'
Now we will install the vagrant bundle
cd vagrant
Enter the directory you cloned Vagrant tobundle install
Install the bundlebundle --binstubs exec
Create an executable file to use vagrant anywhere
In order to run vagrant you need a few directories added to your path. You can either do this globally in system settings, or just use a batch file to set them when you run Vagrant from source.
I use a batch file copies to %USERPROFILE%
(c:\users\[my username]\
) so i can just run the dev version of Vagrant in my console by typing vagrant-dev
.
To load plugins you need to edit the Gemfile
in the root of the vagrant repository. Just add the following code with the correct plugins. After editing the file, run bundle install
and it will install the plugins.
source "https://rubygems.org"
gemspec
if File.exist?(File.expand_path("../../vagrant-spec", __FILE__))
gem 'vagrant-spec', path: "../vagrant-spec"
else
gem 'vagrant-spec', git: "https://github.com/mitchellh/vagrant-spec.git"
end
group :plugins do
gem "vagrant-remove-old-box-versions"
gem "vagrant-reload"
gem "vagrant-triggers"
gem "vagrant-vbguest"
gem "vagrant-hosts-provisioner"
end
Hi brbala, so I'm finally getting around to trying this. I was confused with the bundler install step, because I didn't find any mention of bundler in vagrant.gemspec. Looks like the bundler dependency was removed 12 days ago!
hashicorp/vagrant@1fb4553
So, I think that now you still need bundler installed so that Vagrant can be installed, but you no longer need a specific version since Vagrant is not using it internally for dependency management. That is my take, at least.
Your commands are still correct, and Vagrant is installed/compiled with
bundle install
andbundle --binstubs exec
Also, here is a better, more secure fix for the SSL error:
http://guides.rubygems.org/ssl-certificate-update/