> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Desktop and computer use

> A Linux desktop your agent can see and drive, and you can watch.

The `desktop` template has an XFCE desktop on Xvfb, Google Chrome, `xdotool` and `scrot`, and VNC servers. Nothing runs until you start it, so an idle desktop sandbox costs the same as any other. It is compatible with E2B's `e2b-desktop` SDK, which starts the desktop on create and gives you screenshots, mouse and keyboard.

## Drive it from code

```python desktop.py theme={null}
from anona.desktop import Sandbox  # e2b_desktop.Sandbox plus live view and SSH

desk = Sandbox.create()  # template "desktop", starts Xvfb and XFCE
try:
    print(desk.get_screen_size())
    desk.move_mouse(200, 150)
    desk.left_click()
    desk.write("hello")
    png = desk.screenshot()
    open("screen.png", "wb").write(png)
    print("screenshot", len(png), "bytes", png[:4])
    print("watch it:", desk.live_url())  # Anona live view, control scope
finally:
    desk.kill()
```

```typescript desktop.ts theme={null}
import { Sandbox as Desktop } from "@e2b/desktop";
import { Sandbox } from "@anona/sdk";

const desk = await Desktop.create(); // template "desktop", starts Xvfb and XFCE
try {
  console.log(await desk.getScreenSize());
  await desk.moveMouse(200, 150);
  await desk.leftClick();
  const png = await desk.screenshot();
  console.log("screenshot", png.length, "bytes");

  const sbx = await Sandbox.connect(desk.sandboxId); // the Anona extras on the same sandbox
  console.log("watch it:", await sbx.live.desktopUrl());
} finally {
  await desk.kill();
}
```

Install the Python extra with `pip install "anona[desktop]"`; for TypeScript add `@e2b/desktop` next to `@anona/sdk`.

## Watch it

There are two ways to see the screen:

| | Anona live view | E2B noVNC stream |
| - | - | - |
| How | `desk.live_url()` (Python), `sbx.live.desktopUrl()` (TypeScript), `anona-compute desktop <id>` | `desk.stream.start()` then `desk.stream.get_url()` |
| Transport | Anona's stream relay; the sandbox opens no port | noVNC on port 6080 of the sandbox URL |
| Access | Short-lived viewer token; view-only viewers get a separate view-only VNC server | Port URL; see [Preview links](https://docs.anonalabs.com/compute/guides/preview-links.md) |
| Embedding | See [Live view](https://docs.anonalabs.com/compute/guides/live-view.md) | E2B's own page |

## From the terminal

```text theme={null}
anona-compute desktop $SANDBOX_ID                        # print the live-view URL (control)
anona-compute desktop $SANDBOX_ID --vnc 127.0.0.1:5901   # serve the desktop as plain VNC for any VNC client
anona-compute desktop $SANDBOX_ID --vnc 127.0.0.1:5901 --view-only
anona-compute desktop $SANDBOX_ID --mode novnc           # the E2B noVNC URL on port 6080
```

## For agents

* Over MCP, `desktop_screenshot` returns the screen as an image; see [Agents via MCP](https://docs.anonalabs.com/compute/guides/mcp.md).
* The `coding-agent` template has a computer-use MCP server registered with each agent CLI. It is a placeholder today (`screenshot`, `mouse_move`, `click`, `type_text`, `key` through `scrot` and `xdotool`). **Coming soon:** a computer-use API in the Anona guest agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.