Skip to content

feat: emberd in-VM daemon for structured RPC over vsock#9

Open
jasonhernandez wants to merge 2 commits intoaljoscha:mainfrom
jasonhernandez:feat/emberd
Open

feat: emberd in-VM daemon for structured RPC over vsock#9
jasonhernandez wants to merge 2 commits intoaljoscha:mainfrom
jasonhernandez:feat/emberd

Conversation

@jasonhernandez
Copy link
Copy Markdown
Collaborator

Summary

Add emberd, a lightweight daemon that runs inside Ember VMs and exposes structured RPC over vsock (or UDS for testing). Replaces ad-hoc SSH commands with a proper API.

  • New crate: emberd/ — Rust binary, ~500 lines
  • Protocol: JSON-lines over vsock port 1024 (Linux) or UDS (testing)
  • Operations: ping, exec, read_file, write_file, agent_status
  • Image integration: emberd binary + systemd unit baked into agent VM images
  • Cross-compilation: Docker-based Linux build from macOS (make emberd-image)

Design

  • Thread-per-connection model (simple, appropriate for VM-local traffic)
  • Linux: AF_VSOCK listener via nix crate
  • macOS: UDS-only mode for testing (--uds /path/to/socket)
  • Falls back gracefully — if emberd isn't running, Thermite uses SSH

Files changed

File What
emberd/Cargo.toml New crate
emberd/src/main.rs Daemon implementation
emberd/README.md Protocol docs
images/Dockerfile.ubuntu-dev Install emberd + systemd unit
images/Dockerfile.ubuntu-slim Install emberd + systemd unit
images/emberd.service systemd unit file
Cargo.toml Add emberd to workspace
Makefile make emberd, make emberd-image targets

Independent of the vsock PR (#8) — emberd can be reviewed and merged separately.

Test plan

  • cargo build --workspace clean
  • cargo clippy --workspace clean
  • cargo build -p emberd produces working binary
  • Manual: run emberd --uds /tmp/test.sock, connect, send {"op":"ping"}

🤖 Generated with Claude Code

@jasonhernandez jasonhernandez marked this pull request as ready for review April 15, 2026 00:05
Lightweight daemon that runs inside Ember VMs and exposes structured
RPC over vsock (port 1024) or Unix domain socket (for testing).

Operations: ping, exec, read_file, write_file, agent_status.
Protocol: JSON-lines, matching Thermite's EmberdClient.

Thread-per-connection model. Linux uses AF_VSOCK via nix crate,
macOS supports UDS-only mode for development.
Bake emberd binary + systemd unit into agent VM images so it starts
automatically on boot. Docker-based cross-compilation from macOS
via `make emberd-image`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant