Why I'm building a hypervisor from scratch and what a hypervisor actually is?
Every time you use AWS, Google Cloud, or any cloud service, your code runs inside a virtual machine managed by a hypervisor. I wanted to understand exactly how that works at the lowest level. So I'm building one from scratch
What is a hypervisor?
A hypervisor is software or firmware that creates and manages virtual machines (VMs). It allows multiple operating systems to run on a single physical computer by sharing the hardware resources (CPU, memory, storage, and network). Think of a hypervisor as a manager between the physical hardware and the virtual machines.
Virtual Machine 1
Windows
Virtual Machine 2
Linux
Virtual Machine 3
Fedora
Hypervisor
Physical Hardware
CPU, RAM, Disk, Network
▲
The hypervisor:
Allocates CPU, memory, storage, and network resources to each VM.
Keeps VMs isolated from one another.
Allows multiple operating systems to run simultaneously on the same hardware.
Type 1 vs Type 2 Hypervisor
Type 1 Hypervisor (Bare-Metal)
A Type 1 hypervisor is installed directly on the computer's hardware. There is no regular operating system (like Windows or Linux) underneath it.
Structure:
Virtual Machines ↓ Type 1 Hypervisor ↓ Hardware
Type 2 Hypervisor (Hosted)
A Type 2 hypervisor is installed like a normal application on an existing operating system such as Windows or macOS.
Structure:
Virtual Machines ↓ Type 2 Hypervisor ↓ Host Operating System ↓ Hardware
Why I'm interested?
I started with a simple question, how does an operating system actually work? That question led me to build a basic x86_64 kernel from scratch by implementing a bootloader, memory management, and a basic shell in C and assembly. After that, a new question emerged: if I can build an OS, can I build something that manages multiple operating systems simultaneously? That's a hypervisor. And that's what I'm building next. I have also worked on Multinet Analyzer, a LAN packet capture tool which gave me deep understanding of networking at the protocol level. Virtualization and networking intersect deeply in modern cloud infrastructure, and I want to understand both from first principles
What I'm planning to build?
I am planning to build a simple educational Type 1 hypervisor that can create and manage virtual machines. The hypervisor will initialize the virtualization hardware, launch a guest operating system, manage CPU and memory resources, and handle VM exits. The goal is not to build a production ready hypervisor, but to understand the core concepts of virtualization and gain more experience with low-level systems programming.
What you'll find on this website
This website contains articles and learning resources about hypervisors and virtualization. It also includes code examples, with detailed explanations of how they work, especially the main concepts and core parts of virtualization.
You can follow the github links here:
Kernel
MNA
Back