> For the complete documentation index, see [llms.txt](https://asafahmadov.gitbook.io/cloud-and-devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/operating-system-usd-linux-basics/introduction-to-virtualization-and-virtual-machines.md).

# Introduction to Virtualization & Virtual Machines

VM is a virtual computer running on top of another host computer

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FkDJJHccxdelfRn0riMjR%2Fimage.png?alt=media\&token=b4587586-b3f6-4035-8003-7936ea66146d)

#### How it works - Virtualization

Virtualization is the process of creating a software-based, or "virtual" version of a computer, with dedicated amounts of CPU, memory, and storage that are "borrowed" from a physical host computer&#x20;

&#x20;   ▪ Makes it possible that any OS can run on top of any other physical host machine

&#x20;   ▪ The VM is partitioned from the rest of the system, meaning it's completely isolated and can't interfere with the host computer's primary OS

#### Hypervisor

The essential component in the virtualization stack is a piece of software called a hypervisor&#x20;

&#x20;   ▪ The hardware resources are shared

&#x20;   ▪ So you can only give resources you actually have

#### Host OS vs Guest OS

&#x20;   ▪ Host OS = runs directly on the hardware&#x20;

&#x20;   ▪ Guest OS = runs on the virtual machine

### Hypervisor Types - 1

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2Fx2Lc8YDbWyGTThFNtURk%2FScreen%20Shot%202022-05-01%20at%2002.14.32.png?alt=media\&token=9c1de141-38f5-4cbe-9d08-9395bc436830)

#### Type 1 - Native or Bare Metal

That runs directly on the host's hardware to control the hardware and monitor the guest OS. The guest OS runs on a separate level above the hypervisor&#x20;

Examples of this classic implementation of VM architecture are Oracle VM, Microsoft Hyper-V, VMware ESXi.

#### Type 2 - Hosted

Designed to run within a traditional OS

A hosted hypervisor adds a distinct software layer on top of the host OS, and the guest OS becomes a third software level above the hardware&#x20;

Examples: Oracle VM VirtualBox, VMware Server, Microsoft Virtual PC, KVM, QEMU and Parallels.

#### Use cases of Type 1 and Type 2

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FBMujgjdU4wrwKTtSW04j%2Fimage.png?alt=media\&token=e3c6aba7-8362-412e-8ba3-40b50b166385)

#### Why do companies adopt Virtualization?

Main benefit: Instead of OS being tightly coupled to the hardware, Virtualization gives an abstraction layer, with the following benefits:

&#x20;   ▪ <mark style="color:green;">**Security**</mark>: Secure very easily

&#x20;   ▪ <mark style="color:green;">**Agility and speed:**</mark> Spinning up a VM is easy and quick, compared to setting up an entire new server

&#x20;   ▪ <mark style="color:green;">**Cost savings:**</mark> Efficient usage of hardware resources

&#x20;   ▪ <mark style="color:green;">**Portable:**</mark> OS as a portable file (VMI - Virtual Machine Image)

&#x20;      **▪ VMI:**

&#x20;       ● Includes OS and all applications on it

&#x20;       ● You can have backups of your entire OS&#x20;

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FXhpR90E4quVOxAbi9NX8%2Fimage.png?alt=media\&token=1ceb62f8-168b-4785-aba4-717481759569)
