OS - Virtualization

Updated: 2019-04-20

VM

2 Types:

  • Type-1: bare metal hypervisor

    • hypervisor runs directly on the host's hardware.
    • e.g. XEN, Hyper-V(used in Windows 10), VMware ESX/ESXi
  • Type-2: hosted hypervisor

    • hypervisor runs on a conventional operating system, a guest operating system runs as a process on the host.
    • e.g. VMware Workstation, VirtualBox, QEMU

KVM, as name suggests, is kernel-based, so can be considered as both Type-1 and Type-2.

VMM

VMM(Virtual Machine Manager) = Hypervisor

QEMU is the default VMM of KVM, but can be replaced.

QEMU is a generic and open source machine emulator and virtualizer. The Android emulator is built on QEMU.

Paravirtualization(PV) vs Hardware Virtual Machine (HVM)

  • Paravirtualization: guest OS knows that it is running on a hypervisor instead of base hardware,recognizes that other virtual machines are running on the same machine
  • Hardware Virtual Machine (HVM): guest OS thinks that it is running directly on the hardware

Xen supports 2 virtualization types; Amazon supports 2 types as it runs on Xen

  • Xen Para-virtualization (PV)
  • Xen Full virtualization (HVM)

PV

  • An OS or Kernel called Hypervisor is installed on the hardware.
  • Dom0 is called the "privileged domain" which can issue commands to the hypervisor.

PRO

  • Stability/Performance is close to the real servers and hardware virtualization.
  • Overhead is very low

CONS

  • Implementation is tough.
  • Both the host & guest kernels has to be patched.
  • Supports Linux only
  • can’t change the OS options during install.
  • Can’t compile and install a custom kernel

HVM

  • Stands for Hardware-assisted virtual machine.
  • Provides complete hardware isolation. The hardware provides support to run independently for each OS

PROS

  • Can run Linux and Windows
  • Complete secure hardware isolation
  • Resembles close to a physical server.
  • Greater stability

CONS

  • Low performance, because of the overheads at the hardware level