Vagrant installation

 Vagrant Installation

Warning!

The new versions of Vagrant delete the contents of the /opt/vagrant directory. If you want to keep old versions of Vagrant, first move them out of the /opt directory.

  • Download Vagrant from https://www.vagrantup.com/ and follow the instructions to install it.
  • Select DOWNLOAD…
  • Select the operating system of your workstation. For
    • Ubuntu: Debian
    • RedHat: Centos

 

Keep multiple versions on your workstation

Vagrant has an installer, that places the bin and embedded folders to “/opt/vagrant”. To be able to keep multiple versions of Vagrant execute the following:

cd /opt/vagrant
mkdir vagrant_MY_VERSION                                  # Create a subfolder for the new version
sudo chown -R YOUR_USER_NAME:wheel bin                    # Set the owner, so you can move the folder
sudo chown -R YOUR_USER_NAME:wheel embedded               # Set the owner, so you can move the folder
mv bin vagrant_MY_VERSION                                 # Move the folder to the version specific location
mv embedded vagrant_MY_VERSION                            # Move the folder to the version specific location
rm vagrant                                                # Delete the old version of the symbolic link
ln -s /opt/vagrant/vagrant_MY_VERSION/bin/vagrant vagrant # Create the symbolic link for the new version

Important

The default credentials of a Vagrant machine are:

  • UserName: vagrant
  • Password: vagrant

Windows in Vagrant

To test your cookbook on a Windows virtual machine locally, create one for Vagrant. See Launch Windows instances locally with Chef Test Kitchen for the details.

Leave a Reply