How Linux Manages the Crosvm Virtual Machine Monitor

The crosvm virtual machine monitor, originally developed by Google for ChromeOS and the Android Virtualization Framework, is a user-space hypervisor written in Rust that runs guest operating systems securely. Linux manages crosvm by utilizing the Kernel-based Virtual Machine (KVM) API to handle hardware-accelerated CPU and memory virtualization, while relying on standard Linux scheduling, memory mappings, and sandboxing primitives to control crosvm's execution. By treating crosvm as a standard user-space process divided into strictly isolated threads and subprocesses, the host Linux kernel enforces resource boundaries, routes I/O events, and maintains system integrity.

Hardware Virtualization via the KVM Interface

Crosvm does not execute privileged CPU instructions directly. Instead, Linux exposes hypervisor capabilities to crosvm through the /dev/kvm character device. Crosvm opens this device node and issues a series of ioctl system calls to manage the guest lifecycle:

Memory Allocation and Mapping

Linux manages guest physical memory by treating it as allocated user-space memory inside the crosvm process:

Scheduling and Process Concurrency

To the Linux Completely Fair Scheduler (CFS), crosvm's vCPUs appear as normal POSIX threads. This architectural choice yields several operational behaviors:

Sandboxing and Security Isolation

A primary design goal of crosvm is security, achieved by combining Rust's memory safety guarantees with Linux containment features:

I/O Signaling and Asynchronous Events

Communication between the Linux kernel, crosvm, and the guest relies on lightweight Linux IPC primitives: