Linux desktops for agents
Run multiple desktops locally or on a server you control. Give each agent an HTTP API for apps, shell commands, and desktop input. Watch or take over from your browser.
git clone https://github.com/tanav29/desktop.git
cd desktop
node desktop-cli.mjs new --name research
node desktop-cli.mjs new --name coding
Run these commands with Docker and Node.js 20 or newer.
A full Linux desktop
Run XFCE and Chromium in Docker. Set CPU and memory limits for each desktop.
Full desktop control
Agents can run shell commands, launch apps, control keyboard and mouse, and inspect the screen through HTTP.
TypeScript SDK
Connect to a named desktop from Node.js, batch input actions, and capture frames for vision models.
See and take over
Open the same desktop your agent uses in noVNC and interact with it from your browser.
Multiple named desktops
Give each agent or task its own desktop, with separate ports, credentials, and persistent files.
Private self-hosting
The launcher binds to localhost and generates an API token and a separate viewer password. Connect remotely over SSH.
Architecture
A daemon in every desktop
Every container runs its own daemon and XFCE session. Point your agent at the printed API URL and have it read GET / for desktop control instructions.
Agent
Sends actions to its desktop through HTTP or the TypeScript SDK.
Browser
Connects through noVNC to view and operate the same desktop.
Workspace
Keeps files on the Docker host after the container is removed.
Agent ── HTTP + bearer token ──> Daemon
│
XFCE on Xvfb
│
Browser ── viewer password ──────> noVNC
/workspace <── bind mount ──> Host workspaceimport { Desktop } from "./dist/index.js";
const desktop = new Desktop({
host: "127.0.0.1",
port: 49152, // Replace with the printed API port
token: process.env.DESKTOP_TOKEN,
workspace: "../.desktop-workspaces/research",
});
await desktop.create("xterm", { title: "desktop-demo" });
await desktop.actions([
{ do: "wait_for", window: "desktop-demo" },
{ do: "focus", window: "desktop-demo" },
{ do: "type", text: "echo hello" },
{ do: "key", keys: "Return" },
]);
await desktop.screenshot("example.png");Drive it from code
Control a desktop from Node.js
Launch a terminal, then wait for its window, focus it, and type a command in one request. The screenshot is saved in the desktop’s workspace.
Developed in public
Browse the source, follow changes to the launcher and daemon, or report an issue on GitHub.