I learned some interesting things today about running Vagrant on a Windows machine. Vagrant is an amazing tool for running a VM on your local dev box with a target platform (e.g., Linux) provisioned by code (e.g., Chef/Puppet/shell scripts).
Spaces in Paths
A hard lesson about Vagrant on Windows was Vagrant uses Ruby heavily, and Ruby on Windows really, really doesn’t like spaces in paths.
The Vagrant installer can’t comply with the Windows Installer and Logo requirement to
%ProgramFiles% folder due to Ruby’s known issues with spaces in paths like C:\Program Files.
I was able to work around this with a symlink:
I then ran the VirtualBox-4.3.8-92456-Win.exe installer using all defaults except for the USB support and Python scripting.
TIP: do not install VirtualBox’s USB drivers if you have an enterprise USB device blocker/filter
I then followed with installing Vagrant_1.4.3.msi to
TIP: the Vagrant v1.5.0 installer is broken for Windows; use v1.4.3 until v1.5.1 is released.
VirtualBox in XP SP3 compatability mode
I needed to configure a few VirtualBox binaries to run in XP SP3 compatability mode for my Windows 7 SP1 Enterprise laptop. YMMV.
1 2 3 4 5 6 7 8 9 10 11 12 13
Spaces in your home folder path
If your Windows username (or
%USERPROFILE% path) include spaces, you will need to set an environmental variable
%VAGRANT_HOME% to a path that
does not use spaces. This caused many non-obvious errors with
vagrant plugin install berkshelf and
vagrant plugin install omnibus.
A simple fix was setting
%VAGRANT_HOME% to “C:\VagrantHome”
Example running a simple 32-bit Ubuntu LTS box on 32-bit Windows 7 SP1
I don’t really need the omnibus plugin here, but, this proves it can install a plugin that would
otherwise fail with spaces in the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18