mirror of
https://github.com/vhaudiquet/ecrou.git
synced 2026-11-12 22:22:44 +00:00
2e6c84b65b2bcaaf28a16e85e08b0ef969379275
Only the guest init can mint a guest code: it reports the payload's code through the control file and the VMM exits the child with it. A signal on the machine child therefore means the VMM or the engine died; mapping it to 128+n masqueraded an OOM-killed VMM as the payload having died by that signal (T3). 125 and 126 keep their two-sided reading: the child bails with 125 on a boot failure and the init refuses with 126 on a failed share or a missing workdir, but a payload may genuinely exit either code — the control file is the arbiter, and a run that never reached the payload is an error naming the cause.
ecrou
a small microVM runtime based on libkrun
Try ecrou in the terminal
Installation
ecrou is available as a strictly confined snap:
sudo snap install ecrou
sudo snap connect ecrou:kvm
Usage
$ ecrou run -it ubuntu
root@ecrou-vm-m2glhl:/#
Embed ecrou into your project
ecrou is both a library and a tiny CLI frontend around it. The library is embeddable into any project, allowing to use microVMs easily.
Rust
ecrou is a Rust library, which can just be called:
use ecrou::vm::RunOptions;
use ecrou::NoProgress;
fn main() -> ecrou::Result<std::process::ExitCode> {
let code = ecrou::vm::run(
&RunOptions {
image: "ubuntu:resolute".into(),
command: vec!["uname".into(), "-a".into()],
..RunOptions::default()
},
&NoProgress,
)?;
Ok(std::process::ExitCode::from(code.clamp(0, 255) as u8))
}
Languages
Rust
99.4%
Ruby
0.6%