What hypervisors are
A hypervisor is a software between the physical hardware and the virtual machines. It manages virtual machines, providing its guests with a shared pool of resources for efficient use and fast methods to create new virtual machines, and migrate or remove existing guests. With hardware abstraction, the hypervisor abstracts the physical resources and provisions them to the virtual machines, presenting only a fraction of the resources to each guest. Hardware limits the hypervisor by its existing physical resources. Hypervisors make guest operating systems believe they are real and have direct access to physical resources when in reality, it is the hypervisor or operating system it resides on that have direct access to hardware resources.
What hypervisors do
Hypervisors handle processing, CPU, and I/O requests for all of their guests, like network and storage. With resource scheduling, hypervisors balance the workloads by providing appropriate handling of requests from their guests. When an application on a virtual machine makes a request, it gets sent to the operating system on the guest. The operating system believes it has direct contact with the physical hardware, but instead, the hypervisor steps in and halts the process on the virtual machine. Then the hypervisor translates the logical request and sends it off to either the appropriate hardware on type-1 hypervisors or the underlying operating system on type-2 hypervisors. The request gets processed and returned to the hypervisor, where it gets translated and sent back to the operating system on the guest, which then can continue the process and return it to the application. Hypervisors keep guest operating systems isolated from the underlying hardware, as it would cause the device system to crash if multiple operating systems tried to schedule processor time simultaneously.
There are two types of hypervisors. Type-1 hypervisors, also called bare-metal, are installed directly on the physical hardware. It is common when virtualizing servers, as no operating system lies between the hypervisor and physical hardware. VMware ESXi is installed directly on hardware with virtual machines running on top, as seen on the model in the middle of figure 1 below. Another bare-metal hypervisor, but with a different architecture than VMware ESXi, is Microsoft Hyper-V. Its architecture, as seen in figure 1 below, consists of a parent partition, called root partition, which creates and manages the hypervisor’s virtual machines; these are called child partitions. I/O requests from virtual machines go to the root partition, which has direct access to physical I/O devices. The parent partition runs an operating system, Windows Server, and handles all system management functions and device drivers. If the parent partition needs to reboot, it will interrupt all the other partitions which are dependent on the root partition for management and processing.
Type-2 hypervisors, also called hosted hypervisors, are more commonly used on personal computers. They are software running on top of an operating system like other applications. Since the underlying operating system has already configured the hardware, network, and storage, installing hosted hypervisor software is often quick and easy. In addition, virtual machines are isolated from each other, running on the hypervisor, making it possible to switch between different operating systems on the same computer without rebooting. A device must have resources for the hypervisor and its guests, but also the underlying operating system and other applications. Oracle VM VirtualBox is an open-source type-2 hypervisor; multiple virtual machines can run on the hypervisor software simultaneously, while native applications run next to VirtualBox as seen in figure 1 below. VMware’s paid version of a hosted hypervisor, with similar abilities as VirtualBox, is Workstation Pro.
Differences between bare-metal vs. hosted hypervisors
Hosted hypervisors have more failure points because of the underlying operating system compared to bare-metal hypervisors, which lie directly on the hardware. Anything that happens to the operating system on a hosted hypervisor will affect both the hypervisor and its guests. The operating system below type-2 hypervisors adds an extra layer in processing requests, making this a less effective hypervisor than bare-metal hypervisors. On hosted hypervisors, requests from guests get picked up by the hypervisor and passed on to the underlying operating system, which handles I/O requests. While on type-1 hypervisors, it is the hypervisor itself that controls the I/O requests.