Virtualization 101 : A simple view of the Paravirtualization and the Full virtualization - KVM, QEMU -



Among the types of virtualizations, we could find the below schemes.
 
Full virtualization:

Full virtualization is when the guest OS is unaware that it is running in a virtualized environment. 
We could use the "regular" version of an operating system without any changes.

Paravirtualization:

Paravirtualization is when the guest operating system "knowns" that it is running in a virtualized environment.

This is done by slightly modifying the guest operating system and  introducing a set of special drivers that take care of the communication between the guest OS and the host.

The below diagram shows the difference between the paravirtualization and the Full virtualization:


The drivers of the guest operating system use the Virtio standard/drivers.

The host - hypervisor - and the guest OS drivers know that they "live" in a virtual environment.

The host - hypervisor - drivers use QEMU, which is a piece of software that emulates various devices.

Linux uses the hypervisor functionalities by running the QEMU software in the user space in conjunction with a kernel module called the KVM.

KVM is the software that turns Linux into a hypervisor.

To work properly, the KVM needs the Intel vt-x extension of the CPU that is used to compartmentalize the hardware resources and isolate them from each other.

the Intel vt-x also offloads the translation of the virtual CPU instruction from the virtual machine making it run faster.

The Intel vt-x extension could be activated in the machine's Bios.

QEMU uses the vt-x extensions to offer an isolated environment for the guest OS, where the guest has its own RAM and CPU.

Using the vt-x extensions, the vCPUs get directly scheduled on the hardware CPUs.

Remark:

The vCPUs are considered physical CPUs by the virtual machine.

The below diagram shows us a difference between a QEMU process and a regular Linux process:




Comments

Leave as a comment:

Archive