|
| 1 | +<p align="center"> |
| 2 | + <img src="./icon.png" alt="revm logo" width="520" /> |
| 3 | +</p> |
1 | 4 | <h1 align="center"><b>revm</b></h1> |
2 | 5 | <p align="center">revm helps you quickly launch Linux VMs / Containers</p> |
3 | 6 |
|
@@ -26,6 +29,54 @@ xattr -d com.apple.quarantine revm-Darwin-arm64.tar.zst |
26 | 29 | tar -xvf revm-Darwin-arm64.tar.zst |
27 | 30 | ``` |
28 | 31 |
|
| 32 | +## Command Overview |
| 33 | + |
| 34 | +`cmd/revm` exposes three user-facing subcommands: |
| 35 | + |
| 36 | +| Command | Alias | What it does | |
| 37 | +|---------|-------|--------------| |
| 38 | +| `revm chroot` | `run` | Boot a Linux microVM from a custom or built-in rootfs, then run a command inside it | |
| 39 | +| `revm dockerd` | `start` | Boot the built-in container VM and expose a Podman-compatible API socket on the host | |
| 40 | +| `revm attach` | — | Reconnect to an existing session over SSH, either as an interactive shell (`--pty`) or a one-off command | |
| 41 | + |
| 42 | +Inside the guest, `cmd/guest-agent` finishes the boot sequence: it mounts pseudo filesystems and shared disks, |
| 43 | +configures networking (`gvisor` or `tsi`), starts SSH and optional Podman services, runs the requested command in |
| 44 | +`chroot` mode, and reports readiness back to the host. |
| 45 | + |
| 46 | +## Quick Start |
| 47 | + |
| 48 | +```bash |
| 49 | +# Run a command inside a rootfs-backed VM |
| 50 | +revm chroot --id build --rootfs ~/ubuntu-rootfs -- bash -lc 'uname -a' |
| 51 | + |
| 52 | +# Re-enter the same VM from another terminal |
| 53 | +revm attach --pty build |
| 54 | + |
| 55 | +# Start the built-in container engine |
| 56 | +revm dockerd --id engine |
| 57 | +export CONTAINER_HOST=unix:///tmp/engine/socks/podman-api.sock |
| 58 | +podman run --rm alpine uname -a |
| 59 | +``` |
| 60 | + |
| 61 | +## Key Flags |
| 62 | + |
| 63 | +These flags come from `cmd/revm/flags.go` and are shared by `chroot` / `dockerd` unless noted otherwise. |
| 64 | + |
| 65 | +| Flag | Applies to | Description | |
| 66 | +|------|------------|-------------| |
| 67 | +| `--id` | both | Session name; workspace defaults to `/tmp/<id>` and the same ID cannot be started twice at once | |
| 68 | +| `--cpus`, `--memory` | both | VM CPU and memory sizing | |
| 69 | +| `--mount` | both | Share a host directory into the guest through VirtIO-FS | |
| 70 | +| `--raw-disk` | both | Attach an ext4 raw disk image; missing images are auto-created | |
| 71 | +| `--network` | both | Choose `gvisor` (virtual NIC, NAT, DNS, port forwarding support) or `tsi` (transparent socket interception) | |
| 72 | +| `--system-proxy` | both | Read the macOS system proxy and forward it into the guest | |
| 73 | +| `--manage-api` | both | Custom Unix socket path for the host-side VM management API | |
| 74 | +| `--ssh-key` | both | Symlink the generated SSH private key to a user-chosen path | |
| 75 | +| `--report-events` | both | Send lifecycle events to an HTTP endpoint | |
| 76 | +| `--log-level`, `--log-to` | both | Control host-side logging verbosity and destination | |
| 77 | +| `--rootfs`, `--workdir`, `--envs` | `chroot` | Select the guest rootfs and the execution context for the launched command | |
| 78 | +| `--container-disk`, `--podman-api` | `dockerd` | Control persistent container storage and the exported Podman-compatible socket path | |
| 79 | + |
29 | 80 | --- |
30 | 81 |
|
31 | 82 | ## Documentation |
|
0 commit comments