← Blog

How do you run multiple AI agents on one computer?

Give each agent its own screen. An Orgo Linux computer runs up to four screens, each with its own pointer and window manager. How to create, target, resize, and destroy screens, what survives a restart, and when to use separate computers instead.

Updated

Give each agent its own screen. An Orgo Linux computer boots with one screen and can run up to four. Each is its own X server, with its own root window, cursor and window manager, so one agent's pointer and keys cannot reach another's (List screens). Two agents on one screen do not work, because X11 has one pointer per display: in the docs' words, "two hands on one mouse" (Create a screen). If agent A moves the pointer while agent B types, B's keys can land in A's window, and neither sees it coming, since each knows the screen only from its last screenshot.

Extra screens are a Linux feature. macOS, iPhone and Android computers have exactly one screen, and Windows computers have no screens endpoints.

The boot screen is called default and runs on display :99. Each screen you create is named after its display, so display :100 is screen-100. Screens on one computer share its disk, CPU and memory.

Screens or separate computers

Screens on one computerOne computer per agent
Agents per machineUp to 4, Linux only1
Disk and filesSharedSeparate
CPU and memoryShared; each screen costs memorySeparate, sized per computer (Instance types)
A runaway processAffects every screenContained
A restartRestarts every screenRestarts one agent
Suited toA planner and a worker on one job, a supervisor watching a workerOne computer per end user, separate customers, long-running workers

A computer "runs out of memory long before it runs out of screens," because each screen is an X server plus a window manager plus whatever runs on it. A simple test: if the agents hand files to each other, use screens. If one agent crashing or filling the disk would hurt the other, use separate computers. For one computer per user at fleet scale, see Scale AI agent computers to thousands.

Creating a screen

Call create on a running computer. An empty body gives the new screen the boot screen's size (Create a screen):

bash
curl -X POST https://www.orgo.ai/api/computers/$COMPUTER_ID/screens \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

The response is 201:

json
{ "id": "screen-100", "display": ":100", "width": 1920, "height": 1080, "vnc_port": 6000, "ws_port": 6081, "default": false }
  • Send width and height together or not at all. If either is missing or zero, both fall back to the boot screen's size and no error is returned: on a 1920x1080 computer, {"width": 1280} returns a 1920x1080 screen.
  • A new screen has a window manager and nothing else: no panel, no wallpaper, no icons. Its first screenshot is an empty root window. Open the app your agent needs with bash on that screen.
  • A fifth screen is refused with 409, as is any create on a macOS, iPhone or Android computer.

Targeting a screen

Add ?screen=<id> to the action. On Linux, eight actions honor it: screenshot, click, mouse-move, drag, type, key, scroll and bash. Everything else, exec and wait included, runs on the boot screen (llms.txt).

Chrome is on the default Linux image as google-chrome-stable. Give each screen its own --user-data-dir: Chrome runs one process per profile, so a second launch on the same profile opens its window in the Chrome already running, on that Chrome's screen.

bash
# Agent B's screenshot
curl "https://www.orgo.ai/api/computers/$COMPUTER_ID/screenshot?screen=screen-100&response_format=base64" \
  -H "Authorization: Bearer $ORGO_API_KEY"
 
# Agent B opens a browser on its own screen
curl -X POST "https://www.orgo.ai/api/computers/$COMPUTER_ID/bash?screen=screen-100" \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command": "nohup google-chrome-stable --no-sandbox --no-first-run --user-data-dir=/root/.config/chrome-screen-100 >/dev/null 2>&1 &"}'
  • On Linux an unknown screen id returns 404, never the boot screen, because acting on the wrong screen would put a click on another agent's screen (Get a screen).
  • For a screen other than default, bash checks the screen exists and prefixes your command with export DISPLAY=:N;, so windows it opens appear there. The echoed command is yours, without the prefix. Without ?screen=, bash runs with DISPLAY=:99 (Bash).
  • Windows ignores ?screen= on click, type, key, scroll, drag, mouse-move and screenshot. Bash on Windows with any id other than default returns 404.

One pattern: agent A keeps default and never sends ?screen=; agent B always sends ?screen=screen-100. Store each agent's screen id next to its computer id.

Screen size and the model

A computer use model plans clicks in the coordinates of the screenshot it saw, so the size it is told must match the screen. Read each screen's width and height from GET /computers/{id}/screens and pass those to that agent's model. Model setup is in Computer use models compared.

To resize a screen:

bash
curl -X PATCH https://www.orgo.ai/api/computers/$COMPUTER_ID/screens/screen-100 \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width": 1280, "height": 720}'

Resize uses xrandr, so the X server keeps running and open windows are kept. Both dimensions are required; a missing, zero or negative one returns 400. The display and ports do not change (Resize a screen). Update the size your agent sends its model.

Restarts

Extra screens come back empty. Each create, resize or destroy is recorded before Orgo answers. After a restart, a start, or a computer resize that restarted the machine, Orgo makes the extra screens again with the same ids, displays, ports and sizes. A stop keeps the record with the computer's archive.

Windows and processes that were open on them do not come back, and neither does a size you gave default. Screens are not restored after an OS update, a backup restore, a reboot run inside the computer (such as reboot), or a stop Orgo made because the owner's plan was downgraded.

Recreating screens happens in the background. The restart answers without waiting; Orgo then waits up to three minutes for the computer and makes each missing screen, skipping any that fail. After a restart, list the screens before an agent resumes, and reopen its apps. To keep open windows, suspend instead; see Pause, fork or clone an AI agent's computer.

Watching one screen

Each screen reports its vnc_port (5900 plus the display number) and ws_port (5981 plus the display number), inside the computer. From outside, the hosted noVNC stream takes the same ?screen= and the computer's password:

Code
wss://www.orgo.ai/desktops/{id}/ws/websockify?screen=screen-100&token={password}

An id the computer does not have closes the socket with code 4012. WebRTC streams only the boot screen; asking it for another closes the connection with code 4010, the cue to fall back to noVNC. See Embed an AI agent's computer in your app.

Errors

A list on an asleep Linux computer does not wake it: Orgo answers from the screens on file with vnc_port and ws_port set to null, and returns 409 computer_asleep only when nothing is on file.

Status and codeMeaningNext step
400 "Computer not available"The computer is being created, or is frozenWait for running, or start it
404 on an action with ?screen=Unknown screen idList screens again
404 on screens endpointsWindows, or no such computerUse one computer per agent
409 on createFour screens already, or the screen failed to start (always on macOS, iPhone, Android)Destroy an idle screen, or use another computer
409 "the default screen cannot be destroyed"Tried to delete defaultLeave the boot screen
409 no screen "<id>" on deleteAlready goneTreat as done
500 no screen "<id>" on resizeResize of an id that does not existCheck with Get, which answers 404
409 resume_requiredAn hourly computer asleep in storageCall Start
409 computer_waking or 503 resumingWaking from storageRetry after retry_after (30 seconds)
409 suspend_in_progressA suspend is still being savedWait, then resume

Sources: List, Create, Get, Resize, Destroy.

Cleaning up

Destroying a screen stops its X server, its window manager and every window on it, and cannot be undone. It answers 204, frees the display number, and drops the screen from Orgo's record so a restart does not bring it back (Destroy a screen).

bash
curl -X DELETE https://www.orgo.ai/api/computers/$COMPUTER_ID/screens/screen-100 \
  -H "Authorization: Bearer $ORGO_API_KEY"

The next create takes the lowest free display from :100 up, so a destroyed screen-100 can come back as a new screen. Take the id from each create response rather than caching it.