Your VM Is Just a Linux Process

A virtual machine looks like a whole computer. Its own kernel, memory, disks, network devices, and CPUs. But on a Linux host, that entire machine is ultimately just a process. Each virtual CPU is a thread, guest RAM is memory mapped into that process, and the real processor runs the guest’s instructions directly. In this video, we look at how Linux KVM actually works: why old software emulation was slow, how Intel VT-x and AMD-V introduced hardware guest modes, what happens during a VM exit, and how userspace controls a VM through /dev/kvm and KVM_RUN. We also look at how Linux schedules and limits virtual machines like ordinary processes, how EPT and NPT translate guest memory, how QEMU emulates devices, and how virtio and vhost avoid expensive trips across the guest-host boundary. The core idea is simple: A VM is a process. A vCPU is a thread. The CPU runs the guest directly. KVM sets the boundary, then gets out of the way. And finally, we look at the dangerous side of that boundary, including VENOM and the KVM “EPYC escape.” Sources • KVM: the Linux Virtual Machine Monitor (Ottawa Linux Symposium, 2007) https://www.kernel.org/doc/ols/2007/o... • Linux Kernel Documentation, KVM API https://docs.kernel.org/virt/kvm/api.... • QEMU Documentation https://www.qemu.org/docs/master/ #linux #kvm #virtualization #systemsprogramming