Vagrant, by HashiCorp (https://www.vagrantup.com), is a command-line interface to VirtualBox and numerous other virtual machine managers. There are plugins for talking to AWS, Azure, OpenStack, and many other services.
Vagrant is great for getting a predictable virtual machine set up with a few simple commands in a consistent and quick manner.
If you have VirtualBox installed, setup is easy. Just follow the steps below to try out an Ubuntu 16.04 or CentOS 7 virtual machine.
Install Vagrant on openSUSE:
- Download:
sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.rpm -O vagrant.rpm
- Install:
sudo zypper in vagrant.rpm
Install Vagrant on Debian/Ubuntu:
- Download:
sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.deb -O vagrant.deb
- Install:
sudo dpkg -i vagrant.deb
Install Vagrant on CentOS:
- Download:
sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.rpm -O vagrant.rpm
- Install:
sudo rpm -Uvh vagrant.rpm
Download and start an Ubuntu 16.04 Vagrant box using VirtualBox:
vagrant init ubuntu/trusty64
vagrant up --provider virtualbox
Download and start a CentOS 7 Vagrant box using VirtualBox:
vagrant init centos/7
vagrant up --provider virtualbox
Find more VM boxes to download:
https://atlas.hashicorp.com/boxes/search?order=desc&page=1&sort=downloads
Logging in after you have initialized a box:
Do vagrant ssh
to log in to a running VM. SSH keys are set up automatically.
Cleaning up:
- Delete the VM with
vagrant destroy
. - Remove the Vagrantfile if starting again from scratch using
rm Vagrantfile
.
(Click here to see Gist version of this post.)