VirtualBox & Vagrant Install
The VirtualBox package will be installed on an existing host OS (e.g. Linux, Mac OS X, Windows 7, Windows 8) as an application. This VirtualBox application allows additional Guest OS, to load and run, each with its own virtual environment.
As mentioned already we will be using VirtualBox as our provider for this tutorial, please install that as well.
Add the package to our /etc/apt/sources.list:
$ echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | sudo tee --append /etc/apt/sources.list
We need to have the Oracle public key for apt-secure:
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - $ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
To install VirtualBox, do
$ sudo apt-get update $ sudo apt-get install virtualbox
Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade.
$ sudo apt-get install dkms
To view the current VirtualBox version we should use below command:
$ vboxmanage --version 5.0.32_Ubuntur112930
Get the appropriate installer or package from https://www.vagrantup.com/downloads.html:
$ wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
Once the package is downloaded, the next step is installing it, making sure we have the right package name:
$ sudo dpkg -i vagrant_1.9.1_x86_64.deb $ vagrant -v Vagrant 1.9.1
This will put vagrant to our system path so that it is available in terminals.
$ which vagrant /usr/bin/vagrant
Just issue vagrant:
$ vagrant Usage: vagrant [options]
[ ] -v, --version Print the version and exit. -h, --help Print this help. Common commands: box manages boxes: installation, removal, etc. connect connect to a remotely shared Vagrant environment destroy stops and deletes all traces of the vagrant machine global-status outputs status Vagrant environments for this user halt stops the vagrant machine help shows the help for a subcommand init initializes a new Vagrant environment by creating a Vagrantfile login log in to HashiCorp's Atlas package packages a running vagrant environment into a box plugin manages plugins: install, uninstall, update, etc. provision provisions the vagrant machine push deploys code in this environment to a configured destination rdp connects to machine via RDP reload restarts vagrant machine, loads new Vagrantfile configuration resume resume a suspended vagrant machine share share your Vagrant environment with anyone in the world ssh connects to machine via SSH ssh-config outputs OpenSSH valid configuration to connect to the machine status outputs status of the vagrant machine suspend suspends the machine up starts and provisions the vagrant environment version prints current and latest Vagrant version For help on any individual command run `vagrant COMMAND -h` Additional subcommands are available, but are either more advanced or not commonly used. To see all subcommands, run the command `vagrant list-commands`.
Now, we installed virtualbox and vagrant. Let's move on, and see how to use vagrant in subsequent chapters.
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization