https://github.com/keiichiw/kvm-sample-rust
Minimal KVM API example in Rust
https://github.com/keiichiw/kvm-sample-rust
Last synced: about 2 months ago
JSON representation
Minimal KVM API example in Rust
- Host: GitHub
- URL: https://github.com/keiichiw/kvm-sample-rust
- Owner: keiichiw
- License: mit
- Created: 2023-05-04T17:19:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-06T15:02:18.000Z (over 2 years ago)
- Last Synced: 2025-04-21T02:54:14.503Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kvm-sample-rust
Minimal KVM API sample in Rust. This is inspired by [kvmsample](https://github.com/soulxu/kvmsample), which is written in C.
Abstraction layers such as safe structs are intentionally avoided in this project. Instead, it calls KVM API directly to make it easier to understand how each KVM ioctls should be called.
If you want safe wrappers of KVM APIs, other projects in [the section below](#learning-resources) would be helpful.## Usage
```sh
# Create countdown.bin to run as a guest program
$ make
# Run countdown.bin as a KVM guest
$ cargo run -- ./countdown.bin
```## Learning Resources
- [KVM API Documentation](https://docs.kernel.org/virt/kvm/api.html)
- [Using the KVM API - LWN](https://lwn.net/Articles/658511/)
- [rust-vmm/kvm_ioctls's example](https://docs.rs/kvm-ioctls/0.13.0/kvm_ioctls/#example---running-a-vm-on-x86_64)
- Existing VMMs written in Rust
- [crosvm](https://crosvm.dev/book/)
- [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor)
- [firecracker](https://github.com/firecracker-microvm/firecracker)