# Cloud Hypervisor — Lightweight Virtual Machine Monitor in Rust > Cloud Hypervisor is a KVM-based virtual machine monitor written in Rust for modern cloud workloads. It provides a minimal attack surface, fast boot times, and support for CPU/memory/device hotplug with a focus on security and simplicity. ## Install Save as a script file and run: # Cloud Hypervisor — Lightweight Virtual Machine Monitor in Rust ## Quick Use ```bash # Build from source git clone https://github.com/cloud-hypervisor/cloud-hypervisor.git cd cloud-hypervisor cargo build --release # Launch a VM ./target/release/cloud-hypervisor --kernel vmlinux --disk path=focal.raw --cpus boot=2 --memory size=1024M --net tap=tap0 ``` ## Introduction Cloud Hypervisor is a virtual machine monitor (VMM) built on the rust-vmm project crates. It runs on Linux KVM and is designed for lightweight, secure VM execution in cloud infrastructure, offering a minimal codebase compared to QEMU while supporting essential cloud features like live migration and hotplug. ## What Cloud Hypervisor Does - Boots Linux and Windows guest VMs on KVM with minimal overhead - Supports CPU, memory, disk, and network device hotplug - Provides live migration for moving running VMs between hosts - Exposes a REST API for programmatic VM lifecycle management - Runs with a minimal device model to reduce attack surface ## Architecture Overview Cloud Hypervisor is built from modular rust-vmm crates: kvm-ioctls for KVM interaction, vm-memory for guest memory management, and virtio devices for I/O. The VMM process runs in user space, communicating with the kernel via KVM ioctls. A built-in HTTP API server allows external orchestrators to manage VM lifecycle. ## Self-Hosting & Configuration - Requires Linux with KVM support (Intel VT-x or AMD-V) - Build with cargo; the binary has no runtime dependencies beyond KVM - Configure VMs via command-line flags or the REST API - Use cloud-init or ignition for guest OS provisioning - Deploy behind orchestrators like Kata Containers or custom cloud platforms ## Key Features - Written in Rust for memory safety and reduced vulnerability surface - Fast VM boot times (under 100ms for microVM workloads) - CPU and memory hotplug for elastic scaling - Live migration support for zero-downtime maintenance - Virtio device model for efficient I/O ## Comparison with Similar Tools - **QEMU** — full-featured with broad hardware emulation; Cloud Hypervisor is leaner and Rust-native - **Firecracker** — microVM focus with minimal device model; Cloud Hypervisor adds hotplug and live migration - **crosvm** — Chrome OS VM monitor; Cloud Hypervisor targets cloud infrastructure - **NEMU** — Intel's stripped QEMU fork; Cloud Hypervisor is a ground-up Rust implementation ## FAQ **Q: Can Cloud Hypervisor run Windows guests?** A: Yes. It supports Windows guests with virtio drivers for disk and network. **Q: How does it compare to Firecracker in performance?** A: Boot times and overhead are similar. Cloud Hypervisor adds features like hotplug and live migration that Firecracker intentionally omits. **Q: Does it support GPU passthrough?** A: VFIO-based PCI device passthrough is supported, enabling GPU and other device passthrough. **Q: Who uses Cloud Hypervisor?** A: It is used in Microsoft Azure and other cloud platforms as a lightweight VMM for container and VM workloads. ## Sources - https://github.com/cloud-hypervisor/cloud-hypervisor - https://www.cloudhypervisor.org/ --- Source: https://tokrepo.com/en/workflows/asset-d3285403 Author: Script Depot