HarshiCorp promises that Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the “works on my machine” excuse a relic of the past.

Please note that the Hyper-V provider is compatible with Windows 8.1 and later only. Prior versions of Hyper-V do not include the necessary APIs for Vagrant to work.

If you have Hyper-V installed and SMB enabled, you can skip Step 1.

Step 1: Enable Hyper-V and SMB

Follow the steps below to enable Hyper-V and SMB on your Windows machine.

Search for Control Panel

Hit Windows key and search for “Control Panel“. Launch it when it comes up.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-1-control-panel-1.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="351" src="data:image/svg xml,” width=”691″>

Click on Programs

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-2-click-programs-1.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="425" src="data:image/svg xml,” width=”692″>

Click on “Turn Windows features on or off”

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-3-turn-on-off-features-1.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="378" src="data:image/svg xml,” width=”684″>

Scroll down, look for “Hyper-V” and expand it.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-4-check-hypervall.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="437" src="data:image/svg xml,” width=”472″>

Check both Hyper-V Management Tools and Hyper-V Platform then click “OK” as shown above.

Look for SMB 1.0/CIFS File Sharing Support and check it.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-3-1-turn-on-off-features.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="431" src="data:image/svg xml,” width=”408″>

Restart your computer

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/hyper-v-3-2-turn-on-off-features-restart.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="397" src="data:image/svg xml,” width=”550″>

If you like PowerShell simply run the following commands. Ensure you are running Powershell as Administrator:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
 Enable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol" -All

Step 2: Install Executable File

Navigate to the folder you downloaded your Vagrant executable file and double-click on it to start the installation process.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-1-install-executable.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="331" src="data:image/svg xml,” width=”624″>

Step 3: Follow the Installation Steps

Follow the screenshots below to install Vagrant

If you get a message like below, simply click on “More info

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-1-1-install-warning.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="440" src="data:image/svg xml,” width=”469″>

Then “Run it anyway”

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-1-2-install-anyway.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

That should open an installation wizard as shown below. Simply follow the “Next” steps as you make configurations depending on what you want

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-start-next.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

Accept terms in the License Agreement and click “Next

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-1-accept-terms-next.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

You can choose to install Vagrant in a different location here if it suits your requirements.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-2-next.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

Click “Install” to begin the installation process.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-3-Install.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>
<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-4-Install-progress.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

After everything is done installing, the wizard should end as shown below. Simply click “Finish” to complete this phase of work.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/vagrant-2-5-Finish.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

Step 4: Restart Computer

Once you’ve completed setup steps, restart your computer for the changes to take effect.

Step 5: Adding our First Vagrant Box

Boxes are the package format for Vagrant environments. A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment. The easiest way to use a box is to add a box from the publicly available catalog of Vagrant boxes. You can also add and share your own customized boxes on this website.

Fire up your Powershell as Administrator and enter the commands below:

vagrant box add hashicorp/bionic64
<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/adding-vagrant-box-1.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="400" src="data:image/svg xml,” width=”630″>

That will get us a Standard Ubuntu 18.04 LTS 64-bit box

Confirm later with the command below

vagrant box list
<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/adding-vagrant-box-list-3.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="368" src="data:image/svg xml,” width=”490″>

After the download is done, navigate to a folder you would wish to keep Vagrantfile and run the command below.

vagrant init hashicorp/bionic64
<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/adding-vagrant-box-init-2-1.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="242" src="data:image/svg xml,” width=”708″>

To bring the Virtual Machine up, run the command below in your PowerShell

vagrant up --provider hyperv

You can then connect to your VM using

vagrant ssh
<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/adding-vagrant-up-4.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" src="data:image/svg xml,”>

Our Virtual Machine should now be seen in Hyper-V Manager as shown below

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/02/echo/confirm-vm-in-hypervmanager-1024×421.png" data-ez ezimgfmt="rs rscb4 src ng ngcb4 srcset" height="287" src="data:image/svg xml,” width=”699″>

We have successfully enabled Hyper-V, installed Vagrant and launched our Virtual Machine. We thank you for visiting and following through the guide.

Other related guides are shared below for your consideration in case you would wish to run Vagrant in a different environment.

How To Install Vagrant on CentOS 8 / RHEL 8

How To Use Vagrant with Libvirt on Linux

Run CentOS 8 VM using Vagrant on KVM / VirtualBox / VMWare / Parallels

How To Install Vagrant and VirtualBox on Fedora 31/30/29

How To run Kali Linux on VirtualBox with Vagrant

How To run Kali Linux on VirtualBox with Vagrant