|
2 | 2 | summary: "Nodes: pairing, capabilities, permissions, and CLI helpers for camera/screen/device/notifications/system and the macOS widget panel" |
3 | 3 | read_when: |
4 | 4 | - Pairing iOS/watchOS/Android nodes to a gateway |
| 5 | + - Enabling isolated OpenClaw session hosting on a paired node |
5 | 6 | - Using node camera or screen capture for agent context |
6 | 7 | - Presenting a hosted widget on a Mac |
7 | 8 | - Adding new node commands or CLI helpers |
@@ -559,6 +560,79 @@ failed provider or placement cleanup. |
559 | 560 | See [Anthropic: Claude sessions across computers](/providers/anthropic#claude-sessions-across-computers) |
560 | 561 | for the Control UI behavior and storage sources. |
561 | 562 |
|
| 563 | +#### Isolate hosted worker sessions in containers |
| 564 | + |
| 565 | +By default, hosted OpenClaw worker sessions run directly on the paired node. |
| 566 | +Set `nodeHost.workerRuns.isolation` to `"container"` on that node to run each |
| 567 | +worker inside its own container instead: |
| 568 | + |
| 569 | +```json5 |
| 570 | +{ |
| 571 | + nodeHost: { |
| 572 | + workerRuns: { |
| 573 | + enabled: true, |
| 574 | + isolation: "container", |
| 575 | + // Optional: use a digest-pinned, private-registry, or preloaded image. |
| 576 | + // containerImage: "registry.example.com/openclaw/node:22-slim", |
| 577 | + }, |
| 578 | + }, |
| 579 | +} |
| 580 | +``` |
| 581 | + |
| 582 | +Restart the node host after changing either setting. Isolation defaults to |
| 583 | +`"none"`, preserving the existing direct-process behavior. This setting is |
| 584 | +enforced locally on the node; the Gateway cannot silently disable it or fall |
| 585 | +back to an unisolated worker. |
| 586 | + |
| 587 | +Container isolation is supported on Linux and macOS node hosts; Windows is |
| 588 | +unsupported because native Windows paths cannot be mounted at their original |
| 589 | +paths inside the container. The node must have a working Docker-compatible |
| 590 | +container engine. OpenClaw tries the `docker` CLI first, including Docker-backed |
| 591 | +OrbStack installations, and then `podman`. The selected engine and daemon are |
| 592 | +checked when the node host starts and again before each container is created. |
| 593 | +If the platform is unsupported, neither engine works, or the daemon changes, |
| 594 | +session hosting or the affected launch fails visibly instead of falling back to |
| 595 | +an unisolated worker. Install or start the engine, verify `docker version` or |
| 596 | +`podman version`, and restart the node host. |
| 597 | + |
| 598 | +The default image is `node:22-slim`; the engine pulls it on first use when it |
| 599 | +is not already present. Set `nodeHost.workerRuns.containerImage` to choose a |
| 600 | +digest-pinned image, a private-registry image, or an image already available |
| 601 | +to the engine. The image must provide a working Node.js 22 or newer runtime on |
| 602 | +its standard executable search path. If the image cannot be pulled, is |
| 603 | +inaccessible, or does not provide a suitable Node.js runtime, that session |
| 604 | +launch fails visibly; it never retries as a bare host process. Preload the |
| 605 | +image or configure registry access before hosting sessions on an offline or |
| 606 | +restricted node. |
| 607 | + |
| 608 | +Each worker container receives only two host bind mounts: its verified worker |
| 609 | +bundle root is read-only, and its assigned session workspace is read-write. |
| 610 | +Both are mounted at their original absolute host paths so the sealed bundle |
| 611 | +and workspace descriptor remain valid; the session workspace is also the |
| 612 | +container working directory. OpenClaw passes only the existing frozen, |
| 613 | +non-secret worker environment allowlist and adds no other host mounts. |
| 614 | +Container isolation protects the rest of the host filesystem and separates |
| 615 | +the worker process, but the worker can still modify its assigned workspace |
| 616 | +and connect to the Gateway. |
| 617 | + |
| 618 | +The container uses the engine's normal outbound networking and must be able |
| 619 | +to reach the Gateway worker WebSocket endpoint. A Gateway address such as |
| 620 | +`127.0.0.1` or `localhost` that works on the node host points back into the |
| 621 | +container when used by the worker; configure a Gateway address reachable from |
| 622 | +the container network instead. If a Gateway requires a custom certificate |
| 623 | +authority, `NODE_EXTRA_CA_CERTS` must point to a certificate already inside |
| 624 | +the mounted bundle or session workspace; OpenClaw will not mount another host |
| 625 | +path for it. Browser assignments that require access to host-only browser |
| 626 | +state are not supported in container-isolated sessions. |
| 627 | + |
| 628 | +Cancellation and fencing terminate the container itself rather than only the |
| 629 | +container-engine client. The node host records the container's durable engine |
| 630 | +and container identity, checks that identity during restart reconciliation, |
| 631 | +and removes orphaned worker containers labeled for the same Gateway. If the |
| 632 | +node-host process exits unexpectedly, a running container can survive until |
| 633 | +the next node-host startup; keep the node host under a restarting service if |
| 634 | +that cleanup window must remain short. |
| 635 | + |
562 | 636 | ### OpenCode and Pi sessions |
563 | 637 |
|
564 | 638 | The bundled OpenCode and ACPX plugins also discover read-only native session |
|
0 commit comments