Open the desktop live view
The default image includes an xfce desktop with Chromium. You can watch it and use it from your browser, while an agent drives it through screenshots and input.
Before you begin:
- Install kumoba and start
kumobad. - Make sure port 7789 on your machine is free. kumobad serves browser links there.
Open the live view
-
Create and start a sandbox from the
defaultimage:id=$(kumoba create --image default -q) kumoba start "$id" -
Start the desktop and open it in your browser:
kumoba desktop "$id" --user kumoba --openThe desktop appears with keyboard and mouse working. Applications → Terminal Emulator gives you a shell inside the sandbox.
The link expires after one hour. Run the same command again for a new one. Without --open, the command prints the link as url.
A macOS sandbox has a live view too, opened with the same command. See the screen lists what differs there.
What the live view does
The live view is kumoba's own viewer. It sends the desktop to your browser only when the screen changes, so a still desktop uses no bandwidth and almost no CPU.
- Text and windows are exact. Every pixel matches the desktop. Scrolling and dragging a window send only the newly shown part.
- Video and animations are compressed. A region that keeps changing, such as a playing video, is sent at lower quality so it stays smooth. It becomes exact again about a second after it stops.
- Slow connections get a lower rate. The viewer measures the connection and lowers the quality of moving regions before it lowers the frame rate.
- The pointer follows whoever drives. While an agent moves the pointer, you see it move. While you move it, the page shows the desktop's pointer shape under your own pointer.
A tab in the background receives nothing until you return to it.
If the desktop changes size, the live view follows.
Type, paste and copy
- Typing. The keyboard sends the characters you type, so it works with any keyboard layout on your side. Text from an input method editor, such as Japanese, arrives when you confirm it. A character that the sandbox's own keyboard layout lacks takes a moment longer the first time.
- Paste. Press Ctrl+V, or Cmd+V on a Mac. Your clipboard's text goes to the sandbox's clipboard, and the live view pastes it. It uses the terminal's own paste shortcut when a terminal has the focus.
- Copy. On a Mac, press Cmd+C or Cmd+X; the live view sends the copy shortcut of the app that has the focus. On other systems the keys go to the sandbox as you press them: Ctrl+C in most apps, Ctrl+Shift+C in a terminal. The copied text then goes to your clipboard.
- Copy from a menu. After copying with an app's menu, such as right-click, Copy in a browser or Edit, Copy in a terminal, click Copy from desktop at the top right of the live view. The text on the sandbox's clipboard goes to your clipboard.
In a macOS sandbox the copy and paste shortcuts are always sent as Cmd+C, Cmd+X and Cmd+V, whatever system you are on. From Windows or Linux that means Ctrl+C, Ctrl+X and Ctrl+V never reach the sandbox as Control keys, so Control+C can't stop a command in Terminal from there.
Text leaves the sandbox only in the two seconds after you press a copy shortcut in the live view, or when you click Copy from desktop. Your browser must allow the page to write to the clipboard, which needs https or localhost.
Only text is exchanged, up to 200,000 bytes.
Use it outside kumoba
The live view's engine also runs on its own, in any Linux container or VM with an X display. See Use the live view in any container.
Share a link that only watches
kumoba desktop also prints watchUrl, a link to the same desktop without keyboard, mouse or clipboard, for someone who should see what happens but not take part. The viewer page shows "Watching only" and no Copy from desktop button. It expires with url.
kumoba desktop "$id" --user kumoba --json | jq -r .watchUrlChanging the link or the page doesn't give control: the access is signed into the link, and the engine ignores the input of a stream kumobad opened for watching. watchUrl is missing when the link opens noVNC, which has no watch-only mode, and with an image from kumoba 0.7.1 or earlier, whose desktop helper doesn't start the engine for it. From code, sandbox.desktop.liveView({ watchOnly: true }) returns the link, and throws instead of returning one that controls the desktop.
Use the noVNC viewer instead
Images built for kumoba 0.4 or earlier don't include the viewer, so kumoba desktop opens noVNC for them. To get noVNC on a newer image, ask for it:
kumoba desktop "$id" --user kumoba --viewer vnc --openThe output's viewer field says which one the link opens: stream or vnc.
Open the live view of a remote machine
If kumobad runs on a server, forward its preview port from your laptop, then open the printed link:
ssh -N -L 7789:127.0.0.1:7789 my-server &On the server, run kumoba desktop <id> --user kumoba and open the url it prints in your local browser.
Let an agent drive the desktop
A coding agent with a shell, such as Claude Code or Codex, can see the desktop and use it through the kumoba CLI alone. It looks with screenshot and ui-tree, and acts with click, type, key and the other input commands, each a single shell command.
-
Create and start a sandbox from the
defaultimage, and tell the CLI to use it when a command leaves the id out:export KUMOBA_SANDBOX=$(kumoba create --image default --start -q) -
Start the desktop, and open it in your browser to watch the agent work:
kumoba desktop --user kumoba --openThe command returns once the desktop has drawn its first screen, so the agent's first screenshot shows it. After 20 s it returns anyway, with
"painted": falseand awarning. -
Give the agent these instructions, for example in its
CLAUDE.mdorAGENTS.md:## Sandbox desktop You can see and use a Linux desktop (1024x768) with the `kumoba` CLI. KUMOBA_SANDBOX is set, so leave the sandbox id out of these commands. - Look: `kumoba screenshot --settle` saves a PNG and prints its path and size. Open the file to see the screen. Look before you act, and again after. - Find targets: `kumoba ui-tree` lists visible buttons, fields and windows as `role "name" at X,Y`. Click those points rather than guessing from the image. - Click: `kumoba click X Y`, with `--button right` or `--double` when needed. `kumoba hover X Y` moves the pointer without clicking. - Type: click the field first, then `kumoba type "text"`. Write text that starts with `-`, or looks like `name=value`, as `--text=...`, and a leading `@` as `@@`. - Keys: `kumoba key Return`, or a combination such as `kumoba key ctrl+l`. - Scroll and drag: `kumoba scroll X Y down --amount 5`, `kumoba drag X1 Y1 X2 Y2`. - Web pages: `kumoba exec --user kumoba -- kumoba-browse https://example.com` opens Chromium on a page, and `ui-tree` then lists its address bar, buttons and the page's links. - Shell work: `kumoba exec -- <command>` runs a command in the sandbox, which is faster than typing it into a terminal. - When a command fails, run the command its `hint:` line names.
Without KUMOBA_SANDBOX, give each command the sandbox id first, as in kumoba click "$id" 300 200.
The kumoba agent skill teaches the same commands, along with the rest of the CLI, to agents that read skills.
| Command | Example | What it does |
|---|---|---|
screenshot | kumoba screenshot --settle | Saves a PNG of the screen into ~/.kumoba/screenshots and prints its path and size. --settle waits up to 3 s for the screen to stop changing, and never stops on a screen of one colour, -o FILE picks the file, --json prints {"path", "width", "height", "bytes"} |
ui-tree | kumoba ui-tree | Lists the visible named elements, one per line: push button "Send" at 812,440. --limit and --max-depth bound it, --json adds each element's box |
click | kumoba click 812 440 | Clicks at a point. --button right or middle, --double for a double-click |
hover | kumoba hover 812 440 | Moves the pointer there without clicking |
drag | kumoba drag 100 200 400 200 | Presses the button at the first point, moves to the second and releases |
scroll | kumoba scroll 500 400 down --amount 5 | Turns the wheel up or down at a point, 3 steps unless --amount says otherwise |
type | kumoba type "hello world" | Types text at the focused field. A newline in the text presses Return |
key | kumoba key ctrl+shift+t | Presses a key, such as Return, Tab, Escape or F5, or keys joined with +. Key names such as Enter, ArrowLeft and PageUp work in any case, and a letter after a modifier is the same key in either case, so ctrl+A is ctrl+a |
The commands act as the user who started the desktop, so the screen, input and accessibility tree belong to the same session. Before kumoba desktop, they exit 1 with a hint to run it. They work in Linux sandboxes; a macOS sandbox has only the live view. The HTTP API serves the same commands as routes.
Drive the desktop from code
const sandbox = await new Kumoba().create({ image: "default", user: "kumoba" });
await sandbox.desktop.start();
const png = await sandbox.desktop.screenshot();
await sandbox.desktop.click(200, 300);
await sandbox.desktop.type("hello");Like kumoba desktop, start() returns once the desktop has drawn its first screen, with painted: true, or after 20 s with painted: false and a warning. screenshot({ settle: true }) waits for the screen to stop changing, like kumoba screenshot --settle.
await sandbox.desktop.liveView() returns the live view's link, so code can hand a person the page to watch. It is the link kumobad prints, unless the client sets publicUrl. See the TypeScript SDK for every desktop method. These methods drive the desktop of a Linux image; on a macOS sandbox only start() and liveView() work.
Last updated on
Open a shell in a sandbox
Open an interactive terminal inside a kumoba sandbox with kumoba shell, like docker exec -it, and choose the user, working directory or program to run.
Use the live view in any container
Use kumoba's live view engine as a VNC replacement in any Linux container or VM with an X display, and embed the desktop stream in your own web page.