Monday, November 5, 2018

Vagrant Environment Installation on Windows

For vagrant, we need virtualbox and vagrant installation files.

We can download the installation files and install manually, or we can use the automatic approach using chocolatey.

Why chocolatey?

Package Managers for installing the required softwares:
For windows: use chocolatey package manager
For linux use the speicifc package managers,
For ubuntu: apt/apt-get
For centos: yum
For mac: homebrew

How to install chocolatey on windows:
using powershell/commandline both are available in the below site:
http://chocolatey.org/install → similar to homebrew for mac.

For installing chocolatey first, open powershell in admin mode and type below command.



Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Or the latest one available in the website.

Once chocolatey is installed,  cinst tool is available.

Using that, install virtualbox and vagrant.

Now, using chocolatey, install virtualbox.
Search for virtualbox as chocolatey virtualbox on google to get the choco commands.
Like “choco virtualbox”
You will get powershell/command line commands.
choco install virtualbox -y


cinst vagrant virtualbox


Similarly, you can install other applications, say git.
search in google "choco git for windows", you will get command like below.
choco install git

Now, to install vagrant:
Search google “choco vagrant”
choco install vagrant

After that, we need cygwin for handling linux like commands and deployments on windows.
choco install is expanded version of cinst.


choco install cyg-get 

cygwin installs to c:\tools\cygwin folder.Where we have setup file used for it also.

To install openssh and other linux utilities using cyg-get on powershell window.

cyg-get openssh
cyg-get rsync
cyg-get ncurses

Launch cygwin terminal directly and check commands lik ssh,rsync,etc working or not.

It opens the tools\cygwin\home\<username> as current directory.

The folder strucutre is followed as frontslash. Like /c/tools/

In OSX, we use Homebrew.
In Ubuntu, we use default package manager.

To check vagrant version use -v switch.Similarly for virtualbox.
Similarly, use vagrant -h for vagrant help.


vagrant -v
vboxmanage -v

No comments:

Post a Comment