The guest agent runs inside the VM to provide enhanced integration features (clipboard, window enumeration, metrics, snapshots quiesce, etc.).
- Language: Rust
- Runtime: Minimal dependencies; async (tokio) optional later.
- Build: Cross-compile for aarch64-unknown-linux-gnu and Windows ARM (future).
- HELLO handshake + capabilities list.
- HEARTBEAT every 5s with minimal metrics (uptime, load if available).
- Clipboard request/offer pipeline (text/plain only first).
- Window enumeration (Phase B of coherence) — Linux/X11 prototype.
agent/
Cargo.toml (to be added)
src/
main.rs (entry point)
protocol.rs (frame encode/decode mirroring host)
clipboard.rs (feature module)
windows/ (window enumeration backends)
x11.rs
wayland.rs
metrics.rs
fn main() -> anyhow::Result<()> {
let mut conn = VsockConnection::connect(3, 7000)?; // cid=host, port=7000 example
conn.send_hello()?;
loop {
conn.poll()?; // read frames
// schedule heartbeat
}
}- Will require Rust stable toolchain.
- Cross target add:
rustup target add aarch64-unknown-linux-gnu. - Static linking optional (musl) if minimal footprint desired.
- Validate all host-originated messages & enforce size constraints.
- No arbitrary file system access beyond required shared folder paths.
This is a placeholder; implementation to follow in future iteration.