AI agents get Linux desktops in milliseconds through virtual-machine forking

bunshin is a project that runs many sandboxed Linux desktops on one ordinary computer and gives any agent tools to use them. Each desktop is a virtual machine with a browser at 1280x800. The project is infrastructure only: the user brings their own agent. The engine is written in about two thousand lines of C with no external dependencies; the remainder is Go using only the standard library. Version 0.1 is early, developed and tested on one computer with Intel x86-64, WSL2, and kernel 6.18. It works end to end there, with an integration test that proves it, but it has not been tested on other machines.

Desktops are never booted; they are live copies of a template

The core innovation is that a desktop is never booted from scratch. One template boots once, with its windows open, and every desktop is a live copy of it. The engine forks the running machine. The copy shares memory and disk with the template and pays only for what it changes. A copy is a fork. Guest memory is a private mapping of the engine process. To copy a running machine the engine stops its virtual CPUs for two or three milliseconds, reads their state from KVM, and forks. The child process is the new machine: it inherits memory and device state as they are, rebuilds only what lives in the host kernel, and resumes from the same instruction. Pages are shared until one side writes them. Every machine can be copied at any time, and a copy of a copy is just another fork: no snapshot files, no chain to compact.

Fifteen MCP tools cover desktop actions

bunshin provides fifteen MCP tools: create_desktop, list_desktops, delete_desktop, start_desktop, pause_desktop, fleet_status, screenshot, click, move_mouse, drag, scroll, type_text, press_key, cursor_position, and run_command. Actions return a screenshot of the result, and an action on a paused or stopped desktop wakes it. Remote clients can use streamable HTTP with a bearer token. The endpoint is http://127.0.0.1:7400/mcp. A configuration example for any MCP client is {"mcpServers": {"bunshin": {"command": "/absolute/path/to/bunshin", "args": ["mcp"]}}}.

Live console shows every desktop on one page

The console prints a link to a local page with every desktop live, its CPU and memory, and the latest agent action. A desktop's border turns amber while an agent acts on it. Click a desktop to watch it closely and follow its activity, or press Take control to use your own mouse and keyboard on it; while you are in control, agents can look but their input is refused. That is how logins, captchas and payments are meant to be done. The page is served on 127.0.0.1 only, the link carries a token, and requests from other sites open in the same browser are refused.

Agents can open with one click

From the console, a dock at the bottom shows the logo of each agent installed on the computer: Claude Code, Codex, pi, Hermes, OpenClaw, OpenCode, Gemini CLI. Click one and a terminal opens with that agent running, already given the bunshin tools. Under WSL the terminal is a Windows Terminal tab. Commands to connect and disconnect agents write entries each agent expects in its own configuration file, after keeping a copy of it. The system knows Claude Code, Codex (the CLI, the app and the IDE extension share one file), pi, OpenCode, Claude Desktop, Cursor, Gemini CLI and Windsurf. Under WSL it also finds Claude Desktop and the Codex and Cursor apps installed on Windows and connects them through wsl.exe.

Stop and keep a desktop; it comes back in 0.4 s

A desktop saved to a file comes back in 0.4 s with every window where it was, even after a reboot. Stop keeps everything on disk. bunshin stop NAME saves a desktop to a file and turns it off: no memory, no CPU, and it survives a restart of the computer. Start, or simply the next action, brings it back with every window where it was. Set BUNSHIN_IDLE_STOP to have idle desktops stopped by themselves. One thing to know: a desktop started from disk no longer shares memory with the template, so it costs its full size in memory (about 600 MB for the Firefox desktop) until it is deleted.

Memory is returned instantly when a desktop is paused or stopped

Each machine tells the engine which blocks of its memory are free, and the engine returns them to the host at once. Before an idle desktop is paused it also drops its file cache and gathers its free memory. In the test, a desktop that filled 119 MB and deleted the file went back to 9 MB. Desktops with no activity for 10 minutes are paused; the next action resumes them. Watching a desktop in the console is not activity. A fresh copy uses almost nothing and grows as it works, so the room is computed from what desktops may still grow into, not only from what they use today.

Measurements from a test laptop

Numbers were measured on a laptop with Intel i7-1355U, 12 threads, 25 GB, WSL2, kernel 6.18. The Firefox desktop (the default image; template with 2 GB and 2 CPUs) creation takes 60 to 110 ms; up to 330 ms each when several are made in a row. Right after creation its own memory is 16 to 38 MB. After a minute of sitting idle its own memory is 110 to 150 MB (Firefox keeps working in the background). Its share of the memory common to the fleet is about 220 MB. Pausing a desktop, waking it and running a command takes 137 ms, with three command line starts included. Stopping a desktop to disk takes 3.3 s (2.5 s of it waiting for the desktop to hand back free memory); the file is 530 to 620 MB. Starting it again from disk and running a command takes 0.4 s. Booting the template to a settled screen takes 17 s, once. Building the image, mostly downloading and unpacking packages, takes about 11 minutes.

The minimal test image (an X server and one window, 512 MB, 2 CPUs), which shows what the engine itself costs, has these numbers: create a desktop takes 32 to 39 ms; running machine stopped during a copy takes 2 to 3 ms; memory of a fresh copy is about 1 MB of its own; waking a paused desktop and running a command takes 13 to 16 ms; saving a machine to a file and starting it again takes 45 ms and 37 ms.

How the desktop image is built

The desktop image is an ext4 file. bunshin image build makes it with no root, no Docker and no loop devices: it formats an empty file with mke2fs, boots a builder machine with that file as its writable disk, sends the base system into it file by file (the agent inside creates them as root), then runs a setup script there. The image only has to do one thing: start an X server on display :1 from /etc/bunshin/boot, a shell script the agent runs at boot. The built-in script and setup are in internal/image/files. Commands are bunshin image build for Debian trixie with the desktop, the default; bunshin image build --tar rootfs.tar.gz to start from your own root filesystem archive; bunshin image build --tar rootfs.tar --setup my-setup.sh -o my.ext4 to use a custom setup; and bunshin init --image my.ext4 to start from a custom image.

Network and access controls

Programs inside a desktop use an HTTP proxy on its loopback; the agent carries each connection to the host, where the daemon serves it. Every request names its destination, so the policy is by site name, checked again on the address the name resolves to. This computer and its local network are closed to desktops unless you open them. Variables control the policy: BUNSHIN_ALLOW is everything, comma-separated sites desktops may reach (subdomains included). BUNSHIN_DENY is nothing, sites that are always refused. BUNSHIN_PRIVATE, when set to 1, lets desktops reach this computer and private networks. BUNSHIN_OFFLINE, when set to 1, refuses every connection. BUNSHIN_PORTS are 80,443, ports tunnels may reach; * for any. BUNSHIN_NET is open, ask: a site not on the allow list is refused and waits for your approval in the console (or bunshin allow SITE). BUNSHIN_SAVE_KEY is a passphrase: stopped desktops are encrypted on disk. BUNSHIN_ALLOW_SECRETS, when set to 1, lets agents type things shaped like API keys into desktops. BUNSHIN_KERNEL is found, the guest kernel (a Linux bzImage). BUNSHIN_HOME is ~/.local/state/bunshin, where machines, images and logs live. BUNSHIN_MCP_TOKEN is a bearer token for mcp --http. BUNSHIN_CUA_TOKEN is a made-up token for cua-server, required on an address other than 127.0.0.1. BUNSHIN_SANDBOX is on by default; off runs the engine unconfined, to find out whether a problem comes from the confinement; partial accepts a kernel without Landlock.

Engine confinement and security model

The engine confines itself before the machine starts. A system call filter leaves it unable to start a program, connect to anything or open a network socket; Landlock leaves it able to open only the directory of running machines and /dev/kvm. A flaw in the engine would leave a guest with that, not with your account. The network leaves only through the proxy, to web ports, never to this computer or to private and overlay networks. Every desktop is sealed into its own directory, and gets cores and randomness of its own. Nobody acts on the template. Secrets stay out: agents cannot type things shaped like keys into a desktop, typed text is never logged, and stopped desktops can be encrypted (BUNSHIN_SAVE_KEY). The fleet pauses the largest desktop before the computer runs short of memory.

What this means for developers and teams

For software developers and AI teams, bunshin offers a way to run isolated Linux desktops without the overhead of traditional virtual machines. The fork-based copy mechanism means new desktops appear in under 110 ms, and idle desktops are paused after 10 minutes of inactivity, returning memory to the host. The 15 MCP tools let agents create, control, screenshot, and stop desktops programmatically. Teams can configure which sites desktops may reach through the allow list, and can encrypt desktops on disk with a passphrase. The system is useful for agent workloads that need interactive browsers, command-line access, or GUI interaction, while keeping the host environment closed. The engine's confinement, Landlock policies, and network proxy provide boundaries that contain activity within the desktops. Development teams working on AI agent infrastructure can examine the design notes and protocol documentation to understand how to integrate bunshin as a desktop-provisioning layer. The project is at version 0.1 and early status; the author has run fuzz testing with make fuzz, but outside review of the code has not yet happened.

Cloud computing platforms serve as centralized infrastructure for storing, processing, and running applications over network connections. In a military context, such platforms handle classified and unclassified data, logistics, communication, and mission planning workloads. A breach of this nature raises concerns about data exfiltration, persistent access, and the integrity of military operations that depend on available and secure computing resources.

For software developers and IT teams, the breach underscores the importance of defense-in-depth strategies. Network segmentation, least-privilege access controls, and encryption at rest and in transit are foundational controls for any environment handling sensitive data. Monitoring for anomalous activity, logging access patterns, and enforcing multi-factor authentication reduce the window of opportunity for attackers who obtain credentials or exploit vulnerabilities. The FBI NCI breach specifically affects criminal information sharing networks that local authorities depend on for case coordination, highlighting the cascading impact when government information systems are compromised.

Organizations should review identity and access management policies, ensure audit logs are retained and analyzed, and validate that incident response plans account for cloud-specific attack vectors. The arrests of the global cybercrime group leadership demonstrate that law enforcement can disrupt threat actor operations, but the unclear connection between separate breaches suggests that opportunistic and coordinated attacks continue to pose risk. Maintaining up-to-date asset inventories and regularly assessing third-party contracts and supply chain risks are practical steps teams can take to reduce exposure.

The Air Force said it continues to assess and modernize its enterprise cloud capabilities. For development teams working on government or regulated systems, this signals a need to align with evolving security frameworks and risk management processes. While the full impact of the breach remains under assessment, the incident provides a clear signal that no sector is immune to determined adversaries targeting computing infrastructure.