Skip to content

Preparing the host machine

sutch edited this page Nov 21, 2014 · 11 revisions

The host machine requires the appropriate software and configuration to support the building of images. These steps prepare the host machine for building of virtual machine images.

Step 1: Download and install VirtualBox

VirtualBox is used to build (and run) virtual machine images.

Download the appropriate installer from https://www.virtualbox.org/wiki/Downloads and install.

Windows 7 note: Use VirtualBox test build r96191 (4.3.17) [https://www.virtualbox.org/download/testcase/VirtualBox-4.3.17-96191-Win.exe] -- several earlier builds fail to start virtual machines on this version of windows

Windows 7 note: 4.3.20 now available for Windows. Intend to test on Windows 7 (11/21/2014).

Windows 7: adding directory to the PATH environment variable
To allow VirtualBox's commands to be executed from the Windows Command Prompt, add VirtualBox's directory (for example, C:\Program Files\Oracle\VirtualBox) to the PATH environment variable for ether the System or the User.

Step 2: Download and install Packer

Packer is used to manage the building of virtual machine images.

OS X instructions

Note: Brew will not install the latest version of Packer. Use the instructions below to install the latest version of Packer.

  1. Download the appropriate package from http://www.packer.io/downloads.html.

  2. Extract the Packer package to the /usr/local/packer directory.

  3. Update the file ~/.bash_profile to include the line export PATH=$PATH:/usr/local/packer.

  4. To force the current shell session to use the new PATH, source the .bash_profile file by executing the command

    . ~/.bash_profile
Windows 7
  1. Download the appropriate package from http://www.packer.io/downloads.html.
  2. Extract the Packer package to the %UserProfile%\Programs\Packer directory.
  3. Edit the Path environment variable (Control Panel > User Accounts > Change my environment variables) for the current user to include the above directory, adding a semicolon to separate it from any existing folder.
Additional information

Additional installation instructions are available at http://www.packer.io/intro/getting-started/setup.html.

Step 3: Download and install Puppet and Facter

Puppet (with Facter) are used to manage the software and configuration of an image.

OS X

Download both Puppet and Facter from http://puppetlabs.com/misc/download-options and install.

Windows 7

Download a single MSI installer containing both Puppet and Facter and install. Use default options when installing.

Step 4: Download and install Vagrant

Vagrant is used to manage individual VirtualBox machine images.

Download Vagrant from https://www.vagrantup.com/downloads.html and install. (Windows 7: Use the default options when installing.)

Step 5: Install Vagrant Host Manager plugin

Vagrant Host Manager is used to update the hosts file on the host and guest systems so that hostnames can refer to virtual machines.

To install, execute the command:

vagrant plugin install vagrant-hostmanager

Note: See https://github.com/smdahlen/vagrant-hostmanager#passwordless-sudo for instructions on how to allow hostmanager to make changes without asking for the password.

For additional information see https://github.com/smdahlen/vagrant-hostmanager.

Option 1: Install Vagrant Cachier plugin

Note: Configuration for using Vagrant Cachier has been removed due to an issue on Windows host systems.

The Vagrant Cachier plugin can be used to manage a common package cache. See https://github.com/fgrehm/vagrant-cachier for more information.

vagrant plugin install vagrant-cachier

Option 2: Windows only: Install ANSICON

To allow command line programs to display text using ANSI colors, install ANSICON. See https://github.com/adoxa/ansicon

Option 3: Windows only: Configure vagrant to use PuTTY

To SSH to a machine from Windows using PuTTY, install vagrant-multi-putty. See https://github.com/nickryand/vagrant-multi-putty

Installation notes:

  • Ensure that PATH includes the directory containing PuTTY's executable.
  • Step 5 of instructions--save the converted .ppk private key file to the ~/.vagrant.d folder using the name provided.

After completing installation:

vagrant putty