Skip to content

Developer Quick Start

RequirementDetail
macOS 13+ (Ventura)Required for Virtualization.framework
Apple Silicon (arm64)Primary target. Intel Macs are not supported for VM features.
Xcode Command Line ToolsProvides codesign, cc, and system headers. Install: xcode-select --install
Docker or PodmanNeeded for just build-assets (kernel + rootfs builds)
Terminal window
git clone https://github.com/google/capsem.git && cd capsem
sh scripts/bootstrap.sh

The bootstrap script detects your OS (macOS or Linux), checks every required tool, and prints platform-specific install commands for anything missing. On macOS it also verifies Xcode Command Line Tools are installed. Once all tools are present it installs Python and frontend dependencies and runs just doctor to validate the full environment.

The only prerequisite is a POSIX shell. See Life of a Build for what gets built by what and how the tools fit together.

Terminal window
just build-assets

Builds the Linux kernel and rootfs via Docker/Podman (~10 min on first run). Assets are gitignored and must be built locally. See Life of a Build > Container runtime if you need to configure Docker or Podman memory.

Terminal window
just run "echo hello from capsem"

If this prints “hello from capsem” and exits cleanly, you’re set. See Life of a Build for what just run does under the hood.

Terminal window
just run # Build + boot VM interactively (~10s)
just run "CMD" # Boot + run command + exit
just test # Unit tests + cross-compile + frontend check
just dev # Hot-reloading Tauri app (frontend + Rust)
just ui # Frontend-only dev server (mock mode, no VM)

See Just Recipes for the complete reference and dependency chains.

The compiled binary must be codesigned with Apple’s com.apple.security.virtualization entitlement or Virtualization.framework calls crash at runtime. The justfile handles this automatically — every just run re-signs the binary before booting.

Prerequisites:

  • Xcode Command Line Tools (xcode-select --install)
  • entitlements.plist in the repo root (checked into git)

Validation: just doctor runs a four-step codesigning check:

CheckWhat it validatesFix if it fails
Xcode CLToolsxcode-select -p returns a pathxcode-select --install
codesign binaryThe tool exists in PATHInstall Xcode CLTools (see above)
entitlements.plistThe file exists and is readablegit checkout entitlements.plist
Test signCompiles a tiny binary + signs it with entitlementsSee troubleshooting below

No Apple Developer ID certificate is needed for local development — ad-hoc signing (--sign -) is sufficient.

To add packages, AI providers, or change security policy, edit the TOML configs in guest/config/ and rebuild. See Customizing VM Images for the workflow.

Needed for just full-test (integration tests exercise real AI API calls) and interactive AI sessions inside the VM.

Create ~/.capsem/user.toml:

[providers.anthropic]
api_key = "sk-ant-..."
[providers.google]
api_key = "AIza..."

Install missing tools as indicated — every [FAIL] line includes the fix command. Run just _install-tools to auto-install Rust components and cargo tools.

If just run or just doctor reports a codesign failure:

  1. Xcode CLTools missing: xcode-select --install (opens the system installer)
  2. entitlements.plist missing: git checkout entitlements.plist
  3. Test sign fails but tools are present:
    • Try manually: codesign --sign - --entitlements entitlements.plist --force target/debug/capsem
    • Check SIP status: csrutil status (should be “enabled”)
    • Verify cc works: echo 'int main(){return 0;}' | cc -x c -o /tmp/test - — if this fails, reinstall CLTools: sudo rm -rf /Library/Developer/CommandLineTools && xcode-select --install

just build-assets fails with exit code 137

Section titled “just build-assets fails with exit code 137”

The container runtime ran out of memory. See Life of a Build > Container runtime for how to increase memory to 8GB.

just build-assets fails with “Release file not valid yet”

Section titled “just build-assets fails with “Release file not valid yet””

The container VM’s clock has drifted:

  • Podman: podman machine stop && podman machine start
  • Docker: restart Docker Desktop

just run fails with “assets not found”

Section titled “just run fails with “assets not found””

Run just build-assets first. Assets are gitignored and must be built locally.

ld: unknown options: --as-needed -Bstatic ...

The system cc is being used instead of rust-lld. Fix:

Terminal window
rustup component add llvm-tools

Verify .cargo/config.toml sets linker = "rust-lld" for both musl targets.

  • Check codesigning: codesign -dvv target/debug/capsem 2>&1 | grep entitlements
  • Check assets exist: ls assets/arm64/vmlinuz assets/arm64/rootfs.squashfs
  • Debug logs: RUST_LOG=capsem=debug just run