Hi everyone, I would like to share a small open-source project I've been working on, called minivmi.
Repo: https://github.com/ania0-art/minivmi Why I built this: While learning Xen Virtual Machine Introspection (VMI), I identified a gap in the available resources for beginners. Existing production libraries like LibVMI, while powerful, utilize heavy abstraction layers that can obscure the underlying mechanisms. On the other hand, while Xen includes a test utility (xen-access.c) within its source tree, it is tightly coupled with the Xen build system and lacks educational documentation. minivmi extracts these core concepts into a standalone, zero-dependency project based on Xen 4.11 and Ubuntu 20.04. It allows students to build with a single `make` command, serving as the "Hello World" that the ecosystem has been missing. What it is: minivmi is a "bare-metal" style VMI implementation written in pure C (< 500 lines). It intentionally bypasses high-level wrappers and interacts directly with libxc, xenstore, and xenevtchn. It demonstrates the minimal viable path to: 1. Enumerate domains using libxc. 2. Enable vm_event via xc_monitor_enable. 3. Monitor CR3 (Context Switch) events by manually handling the shared ring buffer (req_prod/rsp_prod) and event channels. Current Limitations: Currently, the project focuses strictly on the event interception mechanism (Hypercalls & Ring Buffer). It does not yet implement software page-table walking or memory introspection, keeping the codebase minimal for understanding the control flow first. Goal: This project is strictly educational. It aims to serve as a white-box reference for anyone teaching or learning Xen internals, bridging the gap between theory and implementation. I hope this might be useful for the community's educational resources. Feedback is welcome! Best regards, Junxiao Wang
