DevOps 101: Installing Vagrant on Mac OS High Sierra using Brew

Tomorrow we will be doing Development and Operations (DevOps) course for the boot-camp. Our first task is to set up the environment for the 2 most famous virtualization configuration technology in the IT world (PS: Vagrant and Docker claims that they are more than configuration technology, this definition is just for simplification). This step by step guide will help anyone installing vagrant and set up their first ubuntu 16.04 (xenial).
Install Homebrew
The first step is to install homebrew. Basically, homebrew is for installing thins that Apple didn’t install for you. Cool ain’t it?
Once installed, you can type the command
brew doctor
brew prune #In case you have some unused brew - Optional
brew updateInstall VirtualBox Cask
For using vagrant and docker, you need to put them on top of virtualization, to do this you need to install one of the virtualization stacks. The easiest one, for me is virtual box, because I use that most of the time in my college life. I will review later what is the strength and weakness between all the virtualization stacks. How to install virtualbox using brew, just type.
brew cask install virtualboxInstall Vagrant cask
To install vagrant using cask is very easy, just follow the simple instruction and vagrant will be installed. But there is some setting we need to do before Mac Os can install
Open the Apple Logo on top left → System Preferences → Security & Privacy

Click the lock to make changes, and change the Allow apps downloaded from to App store and identified developers. Click the lock again and do the command.
brew cask install vagrantWait several minutes and congrats! You successfully installed vagrant on your system.
Set up Ubuntu 16.04 for Vagrant
I often make separate folder for my projects, so for vagrant I create a new folder called VagrantProjects
mkdir ~/VagrantProjectsFrom there I create folder where I store my projecs. For example in this case I create Ubuntu/Xenial16.04
mkdir ~/VagrantProjects/Ubuntu/Xenial16.04I come inside the directory and put the command
vagrant initIt creates a Vagrantfile inside the directory. Vagrantfile is a configuration script that will run and create our environment. So, now we need to code the Vagrantfile to create ubuntu/xenial16.04 image. In my case, I just change the config vm.box to ubuntu/xenial64. And added the provision of changing password to ubuntu:ubuntu.
After that, I just run vagrant up.

WARNING!!!
If it is your first time writing vagrant up, expect it to run a little bit longer, because vagrant need to configure the box to virtual box.
Also make sure you have good internet connection. Don't use phone tethering.If it is already finished without error then cool! You are ready to go. Just type vagrant ssh from the folder directory to come inside the terminals

you can do anything with your ubuntu vagrant now.
For more information about vagrant, visit the official docs here
