roxxhub

What is Virtualization ? VMs, Hypervisors and their types.

Virtualization, in the context of computing, means creating a virtualized version of an application, operating system or a network above a computer. As its name suggests, it kind of mimics the way any software works, inside a system (a computer basically).

For example, lets take an example of a compiler and an interpreter. We all must have heard that some programming languages like C, needs to be changed into machine code, in order to be executed, which is done by a compiler. And some other programming languages like python, need not to be changed, instead, their interpreter executes them directly. But is that really true that these interpreted language do not change into machine code at all ?

Well the truth is every process that happens in a computer, has to be changed into machine code (0 and 1) at some point, in order to work as specified in this article. Imagine how a software would run when it actually never interacted with the motherboard, or the CPU. In fact, everything you see in a computer has to be somehow pointed out by the hardware. Otherwise, there is no way of their existence.

Doesn’t that contradicts the definition of an interpreter, the statement that says interpreted language never change into machine code ? Well, the answer is, they do. But they don’t get converted into machine code corresponding to your system, instead, interpreters create an environment and use some techniques which changes the code into 0s and 1s without reaching out your hardware. Therefore, it is correct to say that they mimic, or virtualize the way a compiler works. And hence interpreters are an example of virtualization.

Virtual machine

At the start, we took an example of interpreter to understand virtualization. While interpreters are an example of virtualization themselves, but the term virtualization has been more concentrated towards, Operating systems hardware. Hence, generally the things you make out of virtualization are called Virtual Machines (VM).

Hypervisor

A hypervisor is a software, which creates a layer where virtual machines can run. So basically they help in hardware virtualization.

Types of Hypervisors

Hypervisor types | Virtualization

Type 1 Hypervisor

A type 1 hypervisor sits on the top of the hardware itself. This means that there is no operating system or any other software between it and the hardware. And above it, different Operating systems are hosted.

Type 2 Hypervisor

A type 2 hypervisor is sits on the top of an already existing operating system (the host OS). Hence it is like any other applications on the OS. And on the top of this hypervisor, again other Operating systems(guest OSes) are hosted.

Benefits of Virtualization

  • Saves money on hardware and other physical resources.
  • Utilizes full potential of a machine’s hardware (specially in the case of type 1 hypervisor).
  • Reduces physical space / land / area needed to setup.
  • Recovering virtual machines is much easier as things can be managed in the form of files in a computer.
  • Isolation – Now this isn’t a benefit of virtualization, but just a reminder that hosting many VM’s in a single hardware does not risks the data. As many might say now data that should be in different devices, is in a single device, it can more vulnerable. But the thing is, every VM on a hypervisor is completely isolated from other VMs and the actual hardware itself. Even if some had attacked on of them, others won’t be affected. virtualization virtualization virtualization virtualization virtualization

Running different OSes above a computer.

If you have an OS like windows, or any other OS, you can run another kind of OS above it. Like MAC OS, and linux, as many as you want, using some of the type 2 hypervisor. For example – Oracle VitualBox, VMware hypervisor, and Microsoft Virtual Machine.

Now there are hundreds of YouTube videos showing how you can do so, so I’ll not be diving deep into it and try to make the steps short. Here’s how you can download virtual machines in your computer.

  1. Download and install a hypervisor.
  2. Download an .iso file of the operating system you want to run from the internet. .iso files of Linux are easily available. Unlike windows and mac.
  3. Create a new VM the hypervisor interface, you need to tell it where you have the .iso file downloaded, the memory, storage you want this VM, to utilize from your computer and some other stuff.
  4. Launch it !

There are ways you can have a type 1 hypervisor too. But of course that would mean wiping your current OS. Again you can refer to some youtube video for that.

I prefer these two btw.

For type 2

For type 1