Virtualization

Hypervisors Explained: Type 1 Versus Type 2

By NeatVirtual Editorial Team · · 5 min read

A single physical computer can pretend to be many. It can host a Windows machine, a Linux server and a test environment all at once, each one believing it has its own hardware. The software that makes this possible is called a hypervisor, also known as a virtual machine monitor.

Hypervisors are the foundation of modern data centers and cloud platforms, and they are equally handy on a laptop for testing or learning. They come in two broad designs, called Type 1 and Type 2, which differ in where they sit relative to the hardware.

What a hypervisor does

A hypervisor creates and manages virtual machines (VMs). Each VM has virtual processors, memory, storage and network adapters, carved out of the real hardware. The machine running the hypervisor is the host, and each virtual machine is a guest with its own operating system.

The hypervisor has three main jobs:

  • Resource allocation. It divides CPU time, memory and storage between guests.
  • Isolation. It keeps guests separated, so a crash or a compromise in one does not directly affect the others.
  • Translation. It presents each guest with virtual devices and passes the actual work to the real hardware.

Modern processors include built-in features for virtualization, such as Intel VT-x and AMD-V, which let guests run code at nearly full speed.

Type 1: bare-metal hypervisors

A Type 1 hypervisor installs directly on the physical hardware, with no general-purpose operating system underneath. It is the operating system for the machine, in the sense that its only purpose is to run virtual machines.

Well-known examples include the open-source Xen and KVM (which turns the Linux kernel into a hypervisor), along with several commercial server products.

Advantages:

  • Performance. With fewer layers between the guests and the hardware, overhead is low.
  • Stability and scale. Designed for servers, Type 1 hypervisors can manage many VMs and large amounts of memory.
  • Smaller attack surface. There is no full desktop operating system to patch or exploit beneath the VMs, although the hypervisor itself must be kept updated.
  • Management features. Clustering, live migration and high availability are common.

Drawbacks:

  • Requires a dedicated machine and some setup knowledge.
  • Hardware compatibility can be more limited.
  • Less convenient for casual desktop use.

Type 2: hosted hypervisors

A Type 2 hypervisor runs as an application on top of a normal operating system, such as Windows, macOS or Linux. The host operating system manages the hardware, and the hypervisor asks it for resources, much as any other program does.

Examples include VirtualBox and the desktop products offered by various vendors.

Advantages:

  • Easy to install. You add it like any other application.
  • Convenient for desktops. You keep your usual operating system and run guests in windows, with features like shared folders and copy-and-paste.
  • Good for learning and testing. Snapshots let you try something risky and roll back.

Drawbacks:

  • Extra overhead. Requests pass through both the hypervisor and the host operating system, so performance is typically lower than Type 1.
  • Dependent on the host. If the host operating system crashes or is compromised, every guest is affected.
  • Less suited to production. It lacks the scale and reliability features of server-grade platforms.

Side-by-side summary

  • Installation: Type 1 goes onto the hardware directly, and Type 2 goes onto an existing operating system.
  • Performance: Type 1 is generally better, and Type 2 carries more overhead.
  • Typical use: Type 1 serves data centers and cloud platforms, and Type 2 serves desktops, developers and labs.
  • Management: Type 1 offers cluster tools, and Type 2 focuses on simplicity.

A note on the blurry boundary

The line between the types is not always clean. KVM is a good example: it is a module within the Linux kernel, and Linux is also a general-purpose operating system. Because the kernel itself becomes the hypervisor, KVM is usually classified as Type 1, yet it feels like a hosted setup to anyone who logs into the host. What matters in practice is the architecture and how well the platform suits your goals, not the label.

Hypervisors compared with containers

Containers, such as those created by Docker, are a different form of isolation. They share the host's kernel and package only an application and its dependencies, so they start quickly and use fewer resources. Virtual machines each carry a full operating system, which provides stronger isolation and the ability to run different operating systems side by side. Many environments use both, running containers inside virtual machines to combine speed with separation.

Choosing between them

  1. Running production servers or a private cloud? Choose a Type 1 hypervisor on suitable server hardware.
  2. Learning, testing software or trying another operating system on your own computer? A Type 2 hypervisor is simple and sufficient.
  3. Need to run a Windows application on a Linux or macOS workstation? A Type 2 setup is a natural fit.
  4. Concerned about isolation of sensitive workloads? Look at Type 1 platforms with strong security features and consider dedicated hosts for critical systems.

Security considerations

  • Keep the hypervisor and host patched. A flaw that lets a guest break out affects every other guest.
  • Limit who can manage the hypervisor, because administrative access to it means control over all VMs.
  • Disable unused virtual hardware, such as shared clipboards or folders, on sensitive guests.
  • Use separate networks for management traffic and guest traffic.
  • Encrypt VM disk images, and protect snapshots, which can contain secrets stored in memory.

Frequently Asked Questions

Can I run a hypervisor on any computer?

Most modern processors support hardware virtualization, but it sometimes has to be enabled in the firmware settings. Check your processor's specifications and your BIOS or UEFI menu. You also need enough memory and storage to share between the host and the guests.

Is a Type 1 hypervisor always better than Type 2?

Not always. Type 1 offers better performance and scale for servers, but a Type 2 hypervisor is easier to install and perfectly adequate for testing, development and learning. The right choice depends on the job, not on a general ranking.

What is a snapshot?

A snapshot records the state of a virtual machine at a moment in time, including its disk and often its memory. You can return to it later, which is useful before updates or experiments. Snapshots are not a replacement for backups, because they usually live alongside the VM they describe.

Related reading

  • VPNs

    How Virtual Private Networks Work

    A VPN wraps your traffic in an encrypted tunnel to another network. Learn how tunnels, protocols and routing work, and what a VPN does and does not protect.

    · 5 min read