Install Vagrant on openSUSE, Debian, CentOS; Initialize a Box

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:
  1. Download: sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.rpm -O vagrant.rpm
  2. Install: sudo zypper in vagrant.rpm
Install Vagrant on Debian/Ubuntu:
  1. Download: sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.deb -O vagrant.deb
  2. Install: sudo dpkg -i vagrant.deb
Install Vagrant on CentOS:
  1. Download: sudo wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.rpm -O vagrant.rpm
  2. Install: sudo rpm -Uvh vagrant.rpm

Download and start an Ubuntu 16.04 Vagrant box using VirtualBox:
  1. vagrant init ubuntu/trusty64
  2. vagrant up --provider virtualbox
Download and start a CentOS 7 Vagrant box using VirtualBox:
  1. vagrant init centos/7
  2. 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:
  1. Delete the VM with vagrant destroy.
  2. Remove the Vagrantfile if starting again from scratch using rm Vagrantfile.

(Click here to see Gist version of this post.)