
Fabian Tech Tips

Understanding Virtualization Hypervisors and Security Rings
Feb 4
10 min read
0
7
0
Understanding Virtualization Hypervisors and Security Rings
Virtualization has revolutionized computing by allowing multiple operating systems and applications to run concurrently on a single physical machine. This breakthrough enhances resource utilization, reduces costs, and increases flexibility. At the core of this technology lies the hypervisor, a software layer that manages and allocates resources to virtual machines (VMs). This article explores the intricacies of hypervisors, examining the two main types – Type 1 and Type 2 – and their relationship with the security ring concept in operating systems.
Research Methodology
To gather comprehensive information for this article, a meticulous research process was conducted, involving the following steps:
Fundamentals of Hypervisors: We began by exploring the basic concepts of hypervisors and their role in virtualization.
Type 1 Hypervisors: We delved into the architecture and characteristics of Type 1 hypervisors, also known as bare-metal hypervisors, focusing on their direct interaction with hardware.
Type 2 Hypervisors: We investigated Type 2 hypervisors, or hosted hypervisors, examining their architecture and how they differ from Type 1 hypervisors.
Security Rings: We explored the concept of security rings in operating systems, understanding their role in protecting system resources and ensuring security.
Security Implications: We analyzed research papers and articles comparing the security implications of Type 1 and Type 2 hypervisors.
Hypervisors and Security Rings: We investigated how different security rings are utilized by both Type 1 and Type 2 hypervisors.
This multi-faceted research approach ensures that the information presented in this article is accurate, comprehensive, and insightful.
Hypervisors and Their Role in Virtualization
Invented by IBM in the 1960s to partition resources within mainframe computers, hypervisors have evolved into a cornerstone of modern computing1. A hypervisor, also known as a virtual machine monitor (VMM), is software that creates and runs VMs. It acts as an intermediary between the VMs and the underlying physical hardware, managing and allocating resources such as CPU, memory, and storage2. This allows multiple VMs, each with its own operating system and applications, to run concurrently on a single physical machine without interfering with each other3.
Hypervisors are essential for virtualization because they:
Enable efficient resource utilization: By allowing multiple VMs to share a single physical machine, hypervisors maximize the use of hardware resources, reducing costs and energy consumption3. This agility is primarily due to their ability to run multiple VMs using one host computer's resources5.
Provide hardware independence: Hypervisors abstract the underlying hardware from the software, allowing VMs to run on different hardware platforms without modification3.
Increase IT mobility: VMs are independent of the host hardware, making them portable and easy to move between different servers4.
Enhance security: Hypervisors isolate VMs from each other, preventing security breaches in one VM from affecting others1.
Improve disaster recovery: Hypervisors can capture snapshots of VM states, enabling quick restoration in case of failure3.
Furthermore, hypervisors play a crucial role in cloud computing by enabling multi-tenant cloud environments. Cloud hypervisors abstract the physical hardware resources of a cloud provider's data center, allowing organizations to run distributed workloads on the cloud architecture3. This allows individual users or businesses to run workloads or store data in logically independent compartments.
Hypervisors also facilitate desktop virtualization, where employees can use desktop virtualization software to emulate a version of their workstation computing environment on a server3. This allows them to access their work applications and files remotely, increasing flexibility and productivity.
To achieve this, hypervisors create virtual hardware interfaces that provide each VM with a consistent and secure environment to run applications and operating systems as though they were on separate physical machines1. This core functionality ensures that each VM receives the necessary resources without impacting the performance of others.
Type 1 Hypervisors (Bare-Metal)
Type 1 hypervisors, also known as bare-metal hypervisors, run directly on the host's hardware6. They take the place of a host operating system, and VM resources are scheduled directly to the hardware by the hypervisor7. This direct interaction with the hardware provides several advantages:
Enhanced performance: Type 1 hypervisors offer greater performance because they don't need to go through a host operating system layer to access hardware resources5.
Improved security: By eliminating the host operating system layer, Type 1 hypervisors reduce the attack surface and potential vulnerabilities6.
Increased stability: Type 1 hypervisors are less prone to crashes and failures because they are not dependent on the stability of a host operating system5.
Resource Over-allocation: Type 1 hypervisors allow for the assignment of more resources to virtual machines than are physically available. This is possible because VMs typically do not utilize all allocated resources simultaneously6.
However, Type 1 hypervisors also have some drawbacks:
Complex management: Managing Type 1 hypervisors often requires a separate management console and specialized knowledge5.
Limited functionality: Type 1 hypervisors typically offer basic functionalities and may not have advanced management features6.
Higher cost: Type 1 hypervisors can be more expensive than Type 2 hypervisors, especially for enterprise-level solutions6.
In addition to server operating systems, Type 1 hypervisors can also virtualize desktop operating systems. This capability forms the foundation of virtual desktop infrastructure (VDI), which allows users to access desktop environments such as Windows or Linux that are running inside virtual machines on a central server6.
Examples of Type 1 hypervisors include:
VMware ESXi: A popular bare-metal hypervisor for server virtualization in data centers10.
Microsoft Hyper-V: A Type 1 hypervisor included in Windows Server7.
KVM (Kernel-based Virtual Machine): An open-source hypervisor integrated into the Linux kernel7.
Citrix Hypervisor: A bare-metal hypervisor with integrated security features11.
Type 2 Hypervisors (Hosted)
Type 2 hypervisors, also known as hosted hypervisors, run as a software layer on top of an existing operating system6. They work by abstracting guest operating systems from the host operating system7. This means that VM resources are scheduled against the host operating system, which then interacts with the hardware7.
Type 2 hypervisors offer several benefits:
Ease of use: Type 2 hypervisors are generally easier to install and manage than Type 1 hypervisors5. They do not need a separate management console to create and manage the virtual machines12.
Compatibility: They are compatible with a wide range of hardware and software, making them suitable for personal computers and less demanding environments11. This compatibility with existing hardware and software infrastructure makes deploying and integrating them into an established IT environment easier11.
Cost-effective: Type 2 hypervisors are often more affordable than Type 1 hypervisors, with many free options available11.
However, Type 2 hypervisors also have some limitations:
Reduced performance: Type 2 hypervisors have lower performance compared to Type 1 hypervisors because they need to go through the host operating system to access hardware resources8.
Lower security: They are more vulnerable to security risks due to their dependence on the host operating system9.
Limited scalability: Type 2 hypervisors may not be suitable for large-scale deployments or resource-intensive applications8.
Despite the advantages of Type 1 hypervisors, Type 2 hypervisors exist because they offer convenience and user-friendliness, especially for running applications within an existing OS13.
Examples of Type 2 hypervisors include:
VMware Workstation: A popular Type 2 hypervisor for running multiple operating systems on a desktop or laptop10.
Oracle VirtualBox: A free and open-source Type 2 hypervisor known for its user-friendliness11.
Parallels Desktop: A Type 2 hypervisor designed for macOS, allowing users to run Windows and other operating systems on their Macs10.
Security Rings in Operating Systems
The security ring concept in operating systems is a mechanism for protecting data and functionality from faults and malicious behavior14. It divides the system into different levels of privilege, with each level having different access rights to system resources15. This hierarchical structure helps prevent unauthorized access to sensitive data and system resources15.
Most operating systems use a four-ring model:
Ring 0 (Kernel mode): This ring has the highest privilege level and allows direct access to all system resources. The kernel, the core of the operating system, runs in this mode16. It functions in supervisor mode, which does not require any user interaction. Any interaction with this mode could result in security threats and system errors17.
Ring 1 and Ring 2: These rings are typically used for device drivers and have less privilege than Ring 017. For example, Ring 1 might handle interactions with hardware for video streaming, while Ring 2 manages commands for storing, loading, and saving data.
Ring 3 (User mode): This ring has the lowest privilege level and is used for user applications. Applications running in this mode have limited access to system resources and cannot directly interact with the hardware17. If an application needs resources, it must request them from Ring 0.
In addition to the supervisor mode, there is also a hypervisor mode. Modern CPUs offer x86 virtualization instructions for the hypervisor to control Ring 0 hardware access16.
It's important to note that not all operating systems utilize all four rings. Many modern CPU architectures, including Intel x86, support ring protection, but operating systems like Windows NT and Unix-like systems may not fully utilize this feature19. For instance, some Unix-like systems primarily operate in two rings: kernel and user mode.
In most existing systems, switching from user mode to kernel mode has a performance cost. This cost was measured on the basic request getpid to be 1000–1500 cycles on most machines, but it may vary depending on the specific operation and system architecture19.
Hypervisors and Security Rings
The relationship between hypervisors and security rings is crucial for understanding the security implications of virtualization. In a Type 1 hypervisor environment, the hypervisor itself runs in Ring 0, taking complete control of the hardware20. Guest operating systems run in a less privileged ring (typically Ring 1), even though they may have their own internal ring structure13. This ensures that guest operating systems cannot directly access or interfere with the hypervisor or other VMs20.
In a Type 2 hypervisor environment, the hypervisor runs as an application in Ring 3, along with other user applications20. This means that the hypervisor has the same privilege level as user applications and relies on the host operating system for access to hardware resources20. This can potentially compromise the security of the hypervisor and the VMs it manages9.
To further enhance security and isolation, modern CPUs incorporate hardware virtualization extensions, such as Intel VT-x and AMD-V. These extensions provide a new privilege level below Ring 0, enabling the hypervisor to have even greater control over hardware access and manage VMs more effectively21.
In this context, it's important to consider the security implications of negative rings in Intel architecture. These rings, ranging from Ring -1 to Ring -3, represent privilege levels even higher than Ring 020. For example, Ring -1 is typically used for the hypervisor, while Ring -3 represents the Management Engine (ME), which has the highest privilege level. While these negative rings provide enhanced functionality, they also introduce potential security threats if compromised.
The firmware plays a crucial role in initializing and enabling these virtualization features. It enables VMX (Virtual Machine Extensions) and boots the hypervisor, passing control to it20. The hypervisor then boots each guest operating system kernel, and each guest runs in its own virtualized environment. The firmware also enables protected mode, which activates memory protection, memory virtualization, and other hardware-level security features.
Guest operating systems utilize hypercalls to request services from the hypervisor13. Hypercalls are a mechanism for guest operating systems to perform privileged operations by explicitly requesting the hypervisor, leading to a simpler and faster system.
Security Considerations in Virtualization
The different architectures of Type 1 and Type 2 hypervisors have significant security implications:
Isolation: Type 1 hypervisors offer greater isolation between VMs because they run directly on the hardware and don't share a common operating system layer. This makes them more secure and less vulnerable to attacks that exploit vulnerabilities in the host operating system9. This isolation is particularly important in high-security scenarios, such as financial institutions and government agencies, where Type 1 hypervisors are often preferred9.
Attack surface: Type 1 hypervisors have a smaller attack surface because they don't include a host operating system. This reduces the number of potential entry points for attackers8.
Resource control: Type 1 hypervisors have direct control over hardware resources, allowing them to enforce strict resource limits and prevent one VM from monopolizing resources. This can prevent denial-of-service attacks and ensure fair resource allocation22.
Choosing the Right Hypervisor
Selecting the appropriate hypervisor type depends on various factors, including performance requirements, security needs, budget constraints, and the intended use case. Here's a comparison of Type 1 and Type 2 hypervisors to help you make an informed decision:
| Feature | Type 1 Hypervisor | Type 2 Hypervisor |
Works cited
1. What Is a Hypervisor? A Complete Guide to Virtualization - Scale Computing, accessed on February 4, 2025, https://www.scalecomputing.com/resources/what-is-a-hypervisor
2. www.vmware.com, accessed on February 4, 2025, https://www.vmware.com/topics/hypervisor#:~:text=A%20hypervisor%2C%20also%20known%20as,such%20as%20memory%20and%20processing.
3. What is a Hypervisor? - AWS, accessed on February 4, 2025, https://aws.amazon.com/what-is/hypervisor/
4. What is a Hypervisor? - VMware, accessed on February 4, 2025, https://www.vmware.com/topics/hypervisor
5. Type 1 vs. Type 2 Hypervisor: What Is The Difference? - StarWind, accessed on February 4, 2025, https://www.starwindsoftware.com/blog/type-1-vs-type-2-hypervisor-what-is-the-difference/
6. What is a Hypervisor? Types of Hypervisors Explained (1 & 2) - phoenixNAP, accessed on February 4, 2025, https://phoenixnap.com/kb/what-is-hypervisor-type-1-2
7. What is a hypervisor? - Red Hat, accessed on February 4, 2025, https://www.redhat.com/en/topics/virtualization/what-is-a-hypervisor
8. Type 1 vs. Type 2 Hypervisor - Pure Storage Blog, accessed on February 4, 2025, https://blog.purestorage.com/purely-educational/type-1-vs-type-2-hypervisor/
9. blog.purestorage.com, accessed on February 4, 2025, https://blog.purestorage.com/purely-educational/type-1-vs-type-2-hypervisor/#:~:text=Their%20isolation%20from%20potential%20OS,on%20the%20host%20operating%20system.
10. What Are Hypervisors? | IBM, accessed on February 4, 2025, https://www.ibm.com/think/topics/hypervisors
11. What's the difference between type 1 and type 2 hypervisors? - IONOS, accessed on February 4, 2025, https://www.ionos.com/digitalguide/server/know-how/hypervisor-type-1-and-type-2/
12. Type-1 and Type-2 Hypervisors Explained - BDRSuite, accessed on February 4, 2025, https://www.bdrsuite.com/blog/type-1-and-type-2-hypervisor/
13. Virtualisation · Notes, accessed on February 4, 2025, https://jsinkers.github.io/notes/notebooks/comp_sys/15_virtualisation.html
14. en.wikipedia.org, accessed on February 4, 2025, https://en.wikipedia.org/wiki/Protection_ring#:~:text=In%20computer%20science%2C%20hierarchical%20protection,(by%20providing%20computer%20security).
15. Protection ring | CISSP, CISM, and CC training by Thor Pedersen - ThorTeaches.com, accessed on February 4, 2025, https://thorteaches.com/glossary/protection-ring/
16. Protection Ring - GeeksforGeeks, accessed on February 4, 2025, https://www.geeksforgeeks.org/protection-ring/
17. Protection ring - TutorialsPoint, accessed on February 4, 2025, https://www.tutorialspoint.com/protection-ring
18. Ring-based protection schemes - (Cybersecurity and Cryptography) - Vocab, Definition, Explanations | Fiveable, accessed on February 4, 2025, https://fiveable.me/key-terms/cybersecurity-and-cryptography/ring-based-protection-schemes
19. Protection ring - Wikipedia, accessed on February 4, 2025, https://en.wikipedia.org/wiki/Protection_ring
20. Negative Rings in Intel Architecture: The Security Threats That You've Probably Never Heard Of | by RealWorldCyberSecurity - Medium, accessed on February 4, 2025, https://medium.com/swlh/negative-rings-in-intel-architecture-the-security-threats-youve-probably-never-heard-of-d725a4b6f831
21. Embedded Hypervisor | Ultimate Guides | BlackBerry QNX, accessed on February 4, 2025, https://blackberry.qnx.com/en/ultimate-guides/embedded-hypervisor
22. Type 1 vs Type 2 Hypervisors - Difference Between Hypervisor Types - AWS, accessed on February 4, 2025, https://aws.amazon.com/compare/the-difference-between-type-1-and-type-2-hypervisors/