Skip to content

ania0-art/minivmi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minivmi

Language Platform Size License

A "Minimal Viable" Xen VMI learning project (Pure C).

Designed for education, minivmi demonstrates the raw interaction with Xen hypercalls (libxc, vm_event) without the complexity of heavy abstraction libraries. It aims to be the "Hello World" for Xen Virtual Machine Introspection.

It performs three simple tasks to illustrate the VMI lifecycle:

  1. List Domains: Enumerate active domains (list_domains).
  2. Attach: Map the guest memory and prepare for introspection (UUID based).
  3. Monitor: Enable vm_event to trap CR3 (Context Switch) events and print them (cr3trace_uuid).

Prerequisites

The project uses pkg-config to automatically handle compiler flags for:

  • xencontrol (libxc)
  • xenstore
  • xenevtchn

中文说明 (Chinese Readme)

一个“最小可用”的 Xen VMI 学习项目(纯 C),只做三件事:

  • 第1步:列出 domain(list_domains
  • 第2步:按 UUID attach 到某个 HVM guest(cr3trace_uuid 的准备阶段)
  • 第3步:开启 vm_event 的 CR3 写入监控并打印事件(cr3trace_uuid

构建

所有生成物都在 _build/(已在 .gitignore 忽略)。

make

如果系统有 pkg-config,Makefile 会用这些包名自动取编译/链接参数:

  • xencontrol(libxc)
  • xenstore
  • xenevtchn

运行(需要在 dom0,以 root)

  1. 列出当前 domain:
sudo _build/bin/list_domains
  1. 监控某个 guest 的 CR3 写入(推荐用 UUID):
sudo _build/bin/cr3trace_uuid --uuid <guest-uuid>

Ctrl+C 退出。

About

Learn how to talk to the Hypervisor in 300 lines of C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors