Saturday, September 21, 2024
Google search engine
HomeGuest BlogsEnable Hyper-V and Install Vagrant on Windows 10|11

Enable Hyper-V and Install Vagrant on Windows 10|11

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

Introduction

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. In this guide you will learn to install Vagrant on Windows 10.

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.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

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.

hyper v 1 control panel 1

Click on Programs

hyper v 2 click programs 1

Click on “Turn Windows features on or off”

hyper v 3 turn on off features 1

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

hyper v 4 check hypervall

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.

hyper v 3 1 turn on off features

Restart your computer

hyper v 3 2 turn on off features restart

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.

vagrant 1 install

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

vagrant 1 1 install warning

Then “Run it anyway”

vagrant 1 2 install anyway

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

vagrant 2 start

Accept terms in the License Agreement and click “Next

vagrant 2 1 accept terms

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

vagrant 2 2

Click “Install” to begin the installation process.

vagrant 2 3 Install
vagrant 2 4 Install progress

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

vagrant 2 5 Finish

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
adding vagrant box 1

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

Confirm later with the command below

vagrant box list
adding vagrant box list 3

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

vagrant init hashicorp/bionic64
adding vagrant box init 2 1

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
adding vagrant up 4

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

confirm vm in hypervmanager

Conclusion

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

How To run Kali Linux on VirtualBox with Vagrant

How To run Kali Linux on VirtualBox with Vagrant

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments