Caker

Virtualization platform for macOS

View project on GitHub

Architecture

Components

  • caked command line tool (Sources/caked/): core background daemon
  • cakectl command line tool (Sources/cakectl/): command-line controller
  • CakedLib common library (Sources/cakedlib/): shared library code
  • GRPCLib communication libray (Sources/grpc/): communication contracts and streaming/client interfaces
  • Caker.app (Sources/caker/): GUI source
  • LXD REST API (Sources/caked/REST/): optional LXD-compatible HTTP/HTTPS server built into caked
  • Web UI (webui/): React/Vite frontend served by caked at /ui

High-level flow

  1. cakectl sends commands to caked over gRPC
  2. caked executes lifecycle/resource operations
  3. Responses and streams are transmitted through gRPC back to clients
  4. Logs/status are returned to clients

Optionally, external LXD-compatible tooling communicates with caked through the REST API:

  1. caked starts an HTTP(S) listener alongside the gRPC server when --rest is set
  2. LXD REST clients (e.g. lxc, the web UI, or any HTTP client) call /1.0/... endpoints
  3. caked translates REST requests into the same internal operations used by gRPC

Service responsibilities

caked is responsible for:

  • lifecycle management (build, launch, start/stop/restart/suspend/delete)
  • resource allocation
  • health monitoring
  • logging and diagnostics
  • optional LXD-compatible REST API (instances, networks, images, certificates, identities, operations)
  • optional Web UI hosting

LXD REST API

When started with --rest, caked exposes an LXD-compatible REST API:

Endpoint group Description
/1.0 Server info and capabilities
/1.0/instances VM lifecycle, state, exec, console, logs
/1.0/networks Network management
/1.0/images Image listing and metadata
/1.0/operations Async operation tracking
/1.0/certificates TLS certificate management
/1.0/auth-groups Authorization groups
/1.0/identities Identity management

Default ports: 8443 (HTTPS/mTLS) or 8080 (HTTP). Override with --rest-port.

IMDS

caked also hosts, by default, an AWS-style instance metadata service for Linux VMs (IMDSCoordinator + IMDSServer in Sources/caked/IMDS/), reachable from the guest over HTTP. Reaching it at the AWS-style 169.254.169.254 address relies on a pf address-alias redirect installed automatically by a short-lived root helper, since caked normally runs unprivileged; without it, the IMDS gateway itself stays fully reachable on its own port. See IMDS for full details.

See Command Summary for full service listen flag reference.

Repository Structure

Sources/
├── caked/          # Daemon implementation
│   └── REST/       # LXD REST API server and controllers
├── caker/          # GUI app (macOS SwiftUI)
├── cakectl/        # CLI client
├── cakedlib/       # Shared libraries
└── grpc/           # gRPC definitions and generated code
scripts/            # Some useful scripts to build and other
webui/              # React/Vite web UI