Vagrant Classroom Series – 19/Oct/2020

Vagrant

  • This is a command line utility for managing virtual machines
  • Usecases:
    • To create developer environments
  • On the laptop we have different options of creating virtual machines by using different hypervisor (vmware, virtual box, hyperv,kvm) Preview
  • vagrant give one command line interface to create virtual machines on different hypervisors

Manual creation of ubuntu instance in Hyper-V

  • Hyper-V can be enabled on Windows 10 (> Home Edition)
  • Ensure Hyper-V is enabled Preview Preview
  • Terms:
    • Host: Where hypervisor is installed
    • Guest: VM created by hypervisor

Vagrant’s way of creating virtual machine

  1. Install Vagrant Refer Here
    1. Install chocolatey Refer Here
    2. Launch Powershell as admin and execute choco install vagrant
  2. Create an empty directory and execute following commands
mkdir ubuntudemo
cd ubuntudemo
vagrant init generic/ubuntu1804
vagrant up --provider hyperv
  1. Once this command finishes execution a virtual machine will be created with ubuntu 18 os Preview
  2. Lets login into the virtual machine. Generally the default credentials will be username: vagrant & password: vagrant
  3. deleting virtual machines is
vagrant destory

How Vagrant does that?

  • For this we need to understand vagrant concepts
    • Box
    • Provider
    • Shared Folders
    • provisioning

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin