Skip to content

Commit 8c9ebb0

Browse files
docs: update README with installer and vz run quick start
- Lead install section with one-line curl installer - Quick start now shows vz init → vz run → vz run -i flow - Added vz.json example with setup, env, resources - Added dev environment command group (init, run, stop, status, logs) - Renumbered advanced sections (Compose, macOS VMs, patches) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 033c456 commit 8c9ebb0

1 file changed

Lines changed: 53 additions & 80 deletions

File tree

README.md

Lines changed: 53 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -22,114 +22,83 @@ Typical use cases:
2222

2323
## Install
2424

25-
### Install from source (recommended)
26-
27-
```bash
28-
# Requires Rust 1.85+ and macOS on Apple Silicon
29-
cargo install --git https://github.com/gpu-cli/vz.git vz-cli
30-
31-
# Sign the binary with required Virtualization.framework entitlements
32-
vz self-sign
33-
```
34-
35-
### Clone and build
36-
3725
```bash
38-
git clone https://github.com/gpu-cli/vz.git
39-
cd vz/crates
40-
cargo build --workspace --release
41-
42-
# Sign the built binaries
43-
../scripts/sign-dev.sh
26+
curl -sSf https://raw.githubusercontent.com/gpu-cli/vz/main/scripts/install.sh | sh
4427
```
4528

46-
The built binaries are in `crates/target/release/vz` and `crates/target/release/vz-guest-agent`.
29+
This installs pre-built binaries (signed + notarized) and the Linux kernel to `~/.vz/bin/`.
30+
Requires macOS on Apple Silicon.
4731

48-
### Build the Linux kernel and initramfs
32+
Options:
33+
- `VZ_VERSION=0.3.0` — pin a specific version
34+
- `VZ_NO_LINUX=1` — skip Linux kernel download
4935

50-
VM commands (`vz vm linux run`, sandboxes) require a Linux kernel and initramfs.
51-
These are built via Docker (handles cross-compilation and build dependencies):
36+
### Install from source
5237

5338
```bash
54-
# Requires Docker — builds kernel 6.12, busybox, guest agent, and youki
55-
cd linux && make docker-build
56-
```
57-
58-
Output goes to `linux/out/` (`vmlinux`, `initramfs.img`, `youki`, `version.json`).
59-
60-
Install the artifacts to the default location:
61-
62-
```bash
63-
mkdir -p ~/.vz/linux
64-
cp linux/out/{vmlinux,initramfs.img,youki,version.json} ~/.vz/linux/
39+
# Requires Rust 1.85+
40+
cargo install --git https://github.com/gpu-cli/vz.git vz-cli
41+
vz self-sign # apply Virtualization.framework entitlements
6542
```
6643

67-
Then initialize a Linux VM image:
44+
### Build the Linux kernel (for source installs)
6845

6946
```bash
70-
vz vm linux init --name my-vm
47+
cd linux && make docker-build # requires Docker
48+
mkdir -p ~/.vz/linux && cp linux/out/{vmlinux,initramfs.img,youki,version.json} ~/.vz/linux/
7149
```
7250

73-
### macOS code signing
74-
75-
All VM commands require the `com.apple.security.virtualization` entitlement.
76-
`vz self-sign` applies an ad-hoc signature that works on the local machine.
77-
Pre-built releases (when available) ship with Developer ID signatures and Apple notarization.
78-
7951
## Platform support
8052

8153
- **Linux:** container + stack commands
8254
- **macOS (Apple Silicon):** container + stack commands, plus `vz vm ...`
8355

8456
## Quick start
8557

86-
### 1. Boot an instant sandbox
58+
### 1. Run commands in a Linux VM
8759

8860
```bash
89-
# Create a required checked-in space definition
90-
cat > vz.json <<'JSON'
91-
{
92-
"name": "my-workspace"
93-
}
94-
JSON
61+
cd your-project
9562

96-
# Create + attach a new sandbox for the current directory
97-
vz --name my-workspace --cpus 4 --memory 4096 \
98-
--base-image debian:bookworm \
99-
--main-container workspace-main
63+
# Generate a vz.json config (auto-detects Rust, Node, Python, Go)
64+
vz init
10065

101-
# Inspect persisted startup selection
102-
vz inspect my-workspace
103-
```
66+
# Run any command inside the Linux VM
67+
vz run echo "hello from Linux"
10468

105-
`--base-image` and `--main-container` apply when creating a new sandbox (`vz` with no `-c/-r`).
106-
Spaces mode requires `vz.json` and Linux btrfs-backed workspace storage.
107-
`vz.json` must not embed raw secrets; use external env references under `secrets` instead:
69+
# Compile and run a Rust project
70+
vz run cargo build
71+
vz run cargo test
10872

109-
```json
110-
{
111-
"secrets": {
112-
"db_password": { "env": "DB_PASSWORD" }
113-
}
114-
}
115-
```
73+
# Open an interactive shell
74+
vz run -i bash
11675

117-
### 2. Manage sandboxes
76+
# Check VM status
77+
vz status
11878

119-
```bash
120-
# Continue or resume
121-
vz -c
122-
vz -r my-workspace
79+
# Stop the VM when done
80+
vz stop
81+
```
82+
83+
The first `vz run` boots a Linux VM (~3s), pulls the base image, and runs setup commands from `vz.json`. Subsequent runs reuse the VM and skip setup (cached by hash).
12384

124-
# List and inspect
125-
vz ls
126-
vz inspect my-workspace
85+
#### vz.json
12786

128-
# Remove a sandbox
129-
vz rm my-workspace
87+
```json
88+
{
89+
"image": "ubuntu:24.04",
90+
"workspace": "/workspace",
91+
"mounts": [{ "source": ".", "target": "/workspace" }],
92+
"setup": [
93+
"apt-get update",
94+
"apt-get install -y build-essential curl"
95+
],
96+
"env": { "PATH": "/root/.cargo/bin:/usr/local/bin:/usr/bin:/bin" },
97+
"resources": { "cpus": 4, "memory": "8G" }
98+
}
13099
```
131100

132-
### 3. Run a Compose stack
101+
### 2. Run a Compose stack
133102

134103
```bash
135104
# Start services
@@ -147,7 +116,7 @@ Stack networking defaults to service identity inside the stack network.
147116
Host-facing port publishing is explicit opt-in via Compose host bindings
148117
(`HOST:CONTAINER`); container-only ports remain internal.
149118

150-
### 4. Manage macOS VMs (macOS only)
119+
### 3. Manage macOS VMs (macOS only)
151120

152121
```bash
153122
# Create a pinned base image from the stable channel
@@ -175,7 +144,7 @@ vz vm save dev --stop
175144
vz vm run --image ~/.vz/images/base.img --name dev --restore ~/.vz/state/dev.vzsave --headless &
176145
```
177146

178-
### 5. Pinned-base automation policy (macOS VM flows)
147+
### 4. Pinned-base automation policy (macOS VM flows)
179148

180149
- `vz vm init --base <selector>`, `vz vm provision --base-id <selector>`, and `vz vm base verify --base-id <selector>` accept immutable base IDs plus channel aliases (`stable`, `previous`).
181150
- Base descriptors include support lifecycle metadata (`active` or `retired`); selecting a retired or unknown base fails with explicit fallback guidance.
@@ -191,7 +160,7 @@ vz vm init --allow-unpinned --ipsw ~/Downloads/restore.ipsw
191160
sudo vz vm provision --image ~/.vz/images/base.img --allow-unpinned
192161
```
193162

194-
### 6. Create signed patch bundles
163+
### 5. Create signed patch bundles
195164

196165
```bash
197166
# Generate an Ed25519 signing key (PKCS#8 PEM)
@@ -214,7 +183,7 @@ sudo vz vm patch apply --bundle /tmp/patch-1.vzpatch --image ~/.vz/images/base.i
214183

215184
For advanced CI workflows, `vz vm patch create` also supports `--operations <json>` + `--payload-dir <dir>`.
216185

217-
### 7. Primary image-delta patch flow (sudo once, then sudoless apply)
186+
### 6. Primary image-delta patch flow (sudo once, then sudoless apply)
218187

219188
```bash
220189
# 1) Create a binary image delta from a signed bundle (runs bundle apply on a temp image copy)
@@ -235,6 +204,10 @@ vz vm run --image ~/.vz/images/base-patched.img --name delta-test --headless
235204

236205
## Command groups
237206

207+
### Dev environments
208+
209+
`init`, `run`, `run -i`, `stop`, `status`, `logs`
210+
238211
### Containers
239212

240213
`pull`, `run`, `create`, `exec`, `images`, `prune`, `ps`, `stop`, `rm`, `logs`

0 commit comments

Comments
 (0)