---
title: "Images and Profiles"
seo:
  description: "isolate builds golden images (templates) once and copies them to create VM instances. iso setup builds the template. iso up copies it when creating a project instance."
---
<!--
Derived from trailofbits/coop.
Modified by chr33s: ported/adapted for the Swift implementation.
SPDX-License-Identifier: Apache-2.0
-->


isolate builds **golden images** (templates) once and copies them to create VM instances. `iso setup` builds the template. `iso up` copies it when creating a project instance. Profiles control which development tools go into the template.

## How templates work

A template is a fully provisioned Ubuntu image held by the Apple runtime. The
build process (see [Apple setup](/docs/backends#setup-process) for every step):

1. Renders a build context: a Dockerfile `FROM ubuntu:24.04` pinned by digest and the provisioning script
2. Installs base packages, Docker, GitHub CLI, Claude Code, and Codex
3. Applies requested profiles and devcontainer Features
4. Builds it with Apple `container build`, imports it into the runtime's private image store, and verifies it in a disposable sandbox

isolate records the result under
`~/.iso/backends/apple-container-v1/images/<name>/`. Creating an instance
takes an APFS clone of the image's cached base disk, so it is fast and shares
storage until written. The template disk size (default 8 GiB) is set with
`--template-size`.

## What every template includes

Every template installs these packages regardless of profile selection.

**Base packages:** `openssh-server`, `dbus-user-session`, `curl`, `wget`, `git`, `build-essential`, `ca-certificates`, `gnupg`, `lsb-release`, `sudo`, `iproute2`, `iptables`, `kmod`, `procps`, `util-linux`, `jq`, `rsync`, `unzip`, `zip`, `file`, `gnome-keyring`, `less`, `libsecret-tools`

**Docker:** `docker-ce`, `docker-ce-cli`, `containerd.io`, `docker-buildx-plugin`, `docker-compose-plugin`

**GitHub CLI:** `gh`

**Claude Code CLI:** installed via the native installer during the template build.

**Codex CLI:** installed with OpenAI's native installer as the guest user during
the template build. The full package, including bundled tools, stays under the
user's home directory. `~/.local/bin/codex` is the native launcher;
`/usr/local/bin/codex` is a compatibility link. The guest user can run
`codex update` directly without sudo.
The image also installs `/usr/local/bin/codex-account`, a wrapper used by
`"codex": { "auth": "chatgpt" }` to run Codex with a D-Bus session and guest Linux
Secret Service storage. The wrapper and its three supporting packages
(`dbus-user-session`, `gnome-keyring`, `libsecret-tools`) are installed in every
image, not gated on the `auth` setting: an image is built once and reused across
configs, so gating them would let a later `"auth": "chatgpt"` edit meet an image
that cannot serve it. When that mode is not configured the wrapper simply execs
Codex, so it costs nothing at run time.

Both agents are installed at whatever version was current when the template was built, and that version is not part of the staleness hash — a plain `iso setup` does not refresh them. There are two ways to get newer agents:

- **A live instance:** run `codex update` inside the VM, or `iso agent update [--claude] [--codex]` from the host (see [`agent update`](/docs/commands/agents#agent-update)). Claude Code also auto-updates itself in the background.
- **The golden image:** `iso setup --rebuild` rebuilds the template from a fresh base, so every new instance ships the latest agents.

## Built-in profiles

Profiles layer language-specific toolchains on top of the base install. Pass them to `--profile` during setup:

```bash
iso setup --profile python
iso setup --profile python,node,rust
```

| Profile | Packages and scripts |
|---------|---------------------|
| `python` | `python3`, `python3-pip`, `python3-venv` |
| `node` | `nodejs` (NodeSource repository added via pre-install script) |
| `c` | `clang`, `llvm`, `gdb`, `valgrind`, `cmake`. Lists plugin `clangd-lsp@claude-plugins-official` (not installed; see below) |
| `fuzz` | `clang`, `llvm`, `afl++`, `lcov` |
| `rust` | Rust toolchain via post-install script (not apt). Lists plugin `rust-analyzer-lsp@claude-plugins-official` (not installed; see below) |
| `go` | `golang` |

The Apple backend does not apply a profile's marketplaces and plugins: the image does not include them, and first boot installs only `claude.marketplaces`/`claude.plugins` and `codex.marketplaces`/`codex.plugins` from the configuration. To get a plugin a profile lists, add it and its marketplace (`https://github.com/anthropics/claude-plugins-official`) to the `claude` section.

## Linux desktop images

The built-in `desktop` profile gives instances a display that the host and,
optionally, the guest's agents can see and drive
([design](/docs/design/linux-desktop-virtio-gpu)):

```bash
iso setup --image desktop --profile desktop,python
iso up --image desktop
```

- The image installs Xorg (on the VM's virtio-gpu display, 1920×1200, US
  keyboard layout), openbox and fonts from Ubuntu, Firefox from Mozilla's
  apt repository (its key checked against a pinned fingerprint; apt takes
  only `firefox` from it and never installs its other packages), and
  `iso-cu-mcp`, the guest's computer-use MCP server, from the iso release.
- An instance of it is created with a virtio-gpu display and a USB keyboard
  and pointer, and boots the desktop kernel the release installs beside
  `iso-sandbox` (or `apple_container.desktop_kernel`); `iso setup` fails if
  that kernel is missing or is not one the runtime pins. Other instances are unchanged.
- From a source build, `scripts/build-iso-sandbox.sh` also builds
  `iso-cu-mcp` (it needs the swift.org toolchain and the Swift Static Linux
  SDK, which it installs, pinned; without them it warns and skips `iso-cu-mcp`,
  and setting up a `desktop` image fails until it is built),
  and `scripts/build-desktop-kernel.sh OUT_DIR` builds the kernel for
  `apple_container.desktop_kernel`.
- The host drives the display with `iso-sandbox cu` (frames, actions,
  `wait`, `hold`, the live view `stream`), as for macOS guests.
- With [`computer_use.guest_access`](/docs/configuration/agents#computer_use), the
  guest's agents get the `iso-cu` MCP server, served by
  `/usr/local/bin/iso-cu-mcp` over vsock 7802.
- Apps in the guest use `DISPLAY=:0` (set for login shells).

A configured profile named `desktop` replaces the built-in one, and its
images get no display.

## Custom profiles

Define profiles in the configuration under `profiles`:

```jsonc
{
  "profiles": {
    "ml": {
      "apt_packages": ["python3", "python3-pip", "python3-venv"],
      "pre_install": "add-apt-repository -y ppa:some/repo",
      "post_install": "pip3 install torch numpy pandas",
      "marketplaces": ["https://registry.example.com/plugins"],
      "plugins": ["my-linter@my-marketplace"]
    }
  }
}
```

Five fields per profile:

- **`apt_packages`**: apt packages to install.
- **`pre_install`**: shell script that runs before `apt-get install`. Use this to add package repositories.
- **`post_install`**: shell script that runs after `apt-get install`. Use this for pip installs, binary downloads, or other setup.
- **`marketplaces`**: plugin marketplace sources (URLs or local paths). Accepted and shown by `iso profiles`, but not registered on the Apple backend.
- **`plugins`**: plugins from those marketplaces. Accepted and shown by `iso profiles`, but not installed on the Apple backend; list them under `claude.plugins` instead.

Custom profiles override built-in ones. A custom profile named `python` replaces the built-in `python` profile entirely.

Use them the same way:

```bash
iso setup --profile ml
iso setup --profile ml,node
```

## Build-on-demand from `up`

For profile-only workflows, `iso up --profile <list>` builds the matching
image automatically before starting a new instance. The image name is derived
from the sorted profile list, so these commands all target the same
`node-python` image:

```bash
iso up --profile python,node
iso up --profile node,python
```

isolate runs the same recipe-hash staleness check used by `iso setup`. If the
derived image is missing or stale, it is built or rebuilt first; if it is
current, startup reuses it.

Explicitly named images are not affected by this shorthand. To choose the
image name yourself, build it with `setup` and start a project from that image:

```bash
iso setup --image ml-dev --profile python,node
iso up . --image ml-dev
```

## Extra packages and post-install scripts

`iso setup` still accepts `--extra-packages` and `--post-install`, but the
Apple backend ignores them and prints a warning. Put one-off packages and
setup steps in a [custom profile](#custom-profiles) (`apt_packages`,
`pre_install`, `post_install`) instead; profile changes are part of the
recipe hash and trigger a rebuild.

## Named images

By default, isolate builds an image called `default`. Build multiple images with different configurations using `--image`:

```bash
iso setup --profile python --image py-dev
iso setup --profile python,node,rust --image polyglot

iso up . --image py-dev
iso up . --image polyglot
```

Each named image has its own record under `~/.iso/backends/apple-container-v1/images/<name>/` with independent versioning and staleness tracking.

## Managing images

List all images:

```
$ iso images
default              profiles: python, node              created: 2026-03-20T14:30:00Z     size: 4.2 GiB
polyglot             profiles: python, node, rust        created: 2026-03-22T09:15:00Z     size: 6.1 GiB
```

Output includes the image name, installed profiles, creation timestamp, and disk size (the size is unavailable on the Apple backend, whose images live in the runtime's store).

Delete a named image:

```bash
iso images --delete polyglot
```

`iso images inspect <name>` reports host-recorded provenance (recipe hash,
profiles, guest user, digest when a manifest exists). Unknown fields stay
unknown. `iso images cache status` lists manifests and instance records
without measuring runtime allocation or deleting anything. Prune and edit are
not available.

## Committing an instance to an image

`iso commit` captures a stopped instance's filesystem as a new image, the inverse of the template-to-instance copy `iso up` performs. Like `docker container commit`, it saves files — not live memory.

```bash
iso stop my-project
iso commit my-project --image my-project-baseline
```

The committed image is an ordinary isolate image (an APFS clone of the disk with its SSH host keys and machine-id removed, recorded under `~/.iso/backends/apple-container-v1/images/<name>/`): it carries over the source image's `template-config.json` (profiles, guest user, hashes) with a fresh creation timestamp, so `iso images` lists it and `iso up --image <name>` launches new instances from it. The instance must be stopped first for filesystem consistency. Committing onto an existing image name requires `--force`.

`iso restore` rolls a stopped instance back to an image's filesystem in place:

```bash
iso commit my-project --image safe-point   # checkpoint
# ... a risky run trashes the environment ...
iso stop my-project
iso restore my-project --image safe-point   # back to the checkpoint
iso start my-project
```

Restore keeps the instance's name, index, IP, and workspace association — only the disk is replaced and the instance's recorded image is updated. That makes it the ergonomic choice over `destroy` + `up --image` for the destructive-undo loop, which would allocate a different instance.

The `iso start` in that recipe does not re-sync `/workspace` or reinstall plugins, which is correct for a checkpoint — the restored disk already carries both. Restoring a **base** image is different: nothing on that disk to preserve, so `start` would leave an empty `/workspace` and no plugins. Use `iso restore --reprovision` to reset an instance onto a base image; see [commands.md](/docs/commands/images#--reprovision).

## Template versioning and staleness

isolate records what went into each template in a `template-config.json` file alongside the image. This config contains:

- **Version number**: a monotonic counter that increments when base install logic changes. A newer isolate version triggers a rebuild.
- **Install script hash**: SHA-256 of the composed install recipe (base + profiles + devcontainer Features). Changing profiles changes this hash.
- **Profile list, guest user, and OCI Features**: the exact inputs used to build the template.
- **Marketplaces and plugins**: always empty on the Apple backend, which bakes none; on VM startup isolate installs the configured set.
- **Creation timestamp**: when the template was built.

On every `iso setup`, isolate computes the current recipe hash and compares it to the stored config. If the hashes differ, the template is stale and isolate rebuilds it. A missing config file (orphaned image) also triggers a rebuild.

When you omit `--profile`, `iso setup` reuses the values from the existing template config. Running `iso setup` with no flags only rebuilds if the underlying install logic changed.

## Rebuilding

Force a rebuild regardless of staleness:

```bash
iso setup --rebuild
iso setup --rebuild --image py-dev
```

The build is crash-safe. Every build gets a fresh image tag; a failed build or verification deletes the new image and leaves the previous manifest and image in place. After a successful rebuild, the superseded image is deleted.

## Instance creation from templates

`iso up` creates an instance from a template when no project instance exists:

1. Clones the image's cached base disk (APFS clone) for the instance
2. Sizes the disk from `--disk`, the committed image's size, or `vm.template_size_gib`
3. Creates and boots a sandbox (with no network device under the default `network.transport: "brokered"`, or on its own vmnet network with `"vmnet"`), then passes the isolation gate and pins the guest's SSH host key

See [How instances work](/docs/backends#how-instances-work) for every step.

```bash
iso up .
iso up . --disk 50
iso up . --image py-dev --disk 100
```

Shrinking below the image size is not supported. Each instance gets its own
disk clone. Changes in one instance do not affect the template or other
instances.

## macOS guests

An image can also be macOS. `iso setup --guest macos --ipsw <restore image>`
installs macOS from an Apple restore image (`.ipsw`) that you supply, as a
template of the runtime (`iso-sandbox macos template build`), and records it
under the image name:

```bash
iso setup --guest macos --ipsw ~/Downloads/UniversalMac_27.0.1_Restore.ipsw --image mac
iso up . --image mac --vcpus 4 --mem 8192
```

The build installs macOS, then runs a provisioning script that iso supplies
(it is kept as `images/<name>/macos-provision.sh`). The script gives the
guest the layout iso's guest commands expect on Linux: the guest user `iso`
with passwordless `sudo`, `/workspace` (a link to `/Users/iso/workspace`),
`/home/iso`, a group named `iso`, a `timeout` command, and `AcceptEnv *` for
forwarded variables. It installs the Command Line Tools (for `git`), a
checksum-pinned GitHub CLI, Claude Code and Codex. The build VM reaches the
network through a vmnet network of its own; no project files or host
credentials are given to it. A build takes about half an hour.

Instances made from a macOS image are clones of the template's disk, each
with its own machine identity, SSH host key and network. They take
`vm.vcpu_count` and `vm.mem_size_mib`, which must meet the restore image's
minimum (typically 4 vCPUs and 8192 MiB for current macOS). `up`, `start`,
`stop`, `destroy`, `shell`, `exec`, `status`, `claude` and `codex` work as for
Linux guests. These do not apply to macOS guests and are refused:

- `--profile`, `--guest-user`, `--extra-packages`, `--post-install` and the
  devcontainer options of `iso setup` (they build Linux images)
- `--disk`, `resize`, `commit` and `restore`
- `iso logs` (macOS guests have no serial console; use
  `iso exec <name> -- log show --last 10m`)
- Codex ChatGPT account auth (`"codex": {"auth": "chatgpt"}`), which needs
  the Linux Secret Service

With `egress: "filtered"`, command-line tools in the guest reach approved
hosts through the proxy variables iso forwards, as on Linux. GUI applications
do not read those variables and have no route, so they fail closed.

An image keeps its guest OS: building macOS into a Linux image's name (or
the reverse) needs `--rebuild`. The next `iso setup --guest macos` rebuilds
the image when the restore image or iso's provisioning script has changed.
A replaced template is deleted once no instance uses it (each boot reads
its hardware model); `iso images --delete <name>` deletes the template the
same way. `--template-size` sets the template disk, at least 64 GiB.
