Virtual Machines 101
Published: 2022-05-07 16:10:39

## Introduction

Alex  : Hey Garry! Can you spin up a VM and test this application?
Garry : Sure, I'll do that right away.

How often do you hear that idiom **"spin up a VM"** while conversing in IT? It's quite common right? But for anyone who's just starting his career in cloud, it can be quite overwhelming.

So... what the heck are VMs? What technology does it use and what are hypervisors? 

Read on to know more👇
<br></br>
## What is Virtualization🤔?

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/al7b5umppb1o77juc0ks.jpg)

As per Wikipedia,
> _**Virtualization** is the act of creating a virtual (rather than actual) version of something, including virtual computer hardware platforms, storage devices, and computer network resources._

Or to put it simply, **Virtualization** means **splitting physical resource** like memory, CPU and storage into multiple virtual resources. 

It's a **technology** that allows us to utilize a machine's full capacity by distributing it's resources among multiple environments each isolated from one another.
<br></br>

## Virtual Machine🔖


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ff8fflkf31shv9w2vh62.jpg)

A **"Virtual Machine"** or **"VM"** is a `virtual instance` of a computer. Just like other computers it has a CPU, memory and storage. 

These virtual machines run on a physical computer and a software called **"Hypervisor"** manages their allocation and access to the computing resources. 
<br></br>

## Hypervisor🔖

`Hypervisor` or `Virtual Machine Monitor` is a virtualization software which allows one to build and run different VMs. It lets one host computer support multiple guest VMs by sharing its resources like memory and CPU.

Hypervisors are of two types:
1. Type-1 Hypervisor
2. Type-2 Hypervisor
<br></br>

## Type-1 Hypervisor🔖

`Type-1 Hypervisor` or `Native Hypervisor` runs directly on host's hardware and replaces the Host operating system. 
As it sits directly on the hardware, it is also called `Bare-Metal Hypervisor`.

![Type-1 Hypervisor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2twdpgisknwm2ti2r9o.png)

### Usage: 
* It is very commonly used in data centers and other server-based environments due to its high performance.

### Advantages: 
* `Higher performance` (as it has direct access to the hardware)
* `More Secure`
* `No Single point-of-failure`
* `Better Scalability`

### Disadvantages:
* `Needs a dedicated machine to administer different VMs and control hardware.`

<br></br>

> Few of the mostly widely used Type-1 Hypervisors are **VMware ESXi**, **Microsoft Hyper-V** and **KVM**.

<br></br>










## Type-2 Hypervisor🔖

`Type-2 Hypervisor`  or `Hosted Hypervisor` runs as an **application** on the top of the Host operating system. 


![Type-2 Hypervisor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u58cv1yhacg0jpum4iae.png)

### Usage:
* It is commonly used by people who want to **try** out different operating systems or want to **test** their application for compatibility.

### Advantages:

* `Cost efficient`
* `Simplified Management`
* `Threat isolation`

### Disadvantages:

* `Compromised performance`
* `Single point of failure`

> Few of the most widely used Type-2 hypervisors are **VirtualBox**, **VMware Workstation** and **Parallel Desktop**.