tobi/wrapvm

A desktop VM for agents: wrap's base image + XFCE, shared Chrome, agent-browser and agent-desktop. Containerfile + Smolfile.

What wrapvm is

wrapvm is a ready-made virtual desktop computer for AI agents. It packages a full graphical Linux desktop (XFCE) inside a container image, so an agent can see and click around a real screen, open a real browser, and run commands — all from one published image.

What's inside

The image contains:

  • A virtual display (Xvfb) running XFCE, viewable in a normal web browser through a tool called voxl on port 6080. A helper command prints the sign-in link.
  • One persistent Google Chrome with remote debugging (CDP) enabled on port 9222, so agents can drive it programmatically.
  • agent-browser — a CLI that lets an agent control that Chrome instance.
  • agent-desktop — a CLI that lets an agent control the desktop itself (clicking, typing) via the accessibility layer (AT-SPI).
  • Two "skills" (desktop and browser) installed into ~/.agents/skills, which point agents at the documentation for those two CLIs.
  • Sound via PulseAudio with a null sink — audio is streamed to the viewer and can be recorded with ffmpeg.
  • Chrome as the default browser everywhere (xdg-open, XFCE, $BROWSER), with its sandbox enabled.
  • ffmpeg for recording.
  • A custom shell prompt that shows [vm:<machine>] under smolvm or [container:<host>] in a container.

How it's built

The Containerfile is based on tobi/wrap's desktop image (a specific commit, c562a7d), with wrapvm's additions marked wrapvm: in the file. CI builds it, runs tests, and publishes it as ghcr.io/tobi/wrapvm:desktop (also tagged :latest).

Files in the repo

File Purpose
Containerfile The VM definition; CI builds and tests it
Dockerfile Symlink to Containerfile so docker build . works
Smolfile Config for booting the image as a smolvm machine (workspace mount, network policy, credentials)
wrapvm A script that creates one machine per directory — create, start, shell in; wrapvm -- CMD runs a command
skills/ The desktop and browser skills, installed into ~/.agents/skills
tests/ Tests run by CI and make test

How to use it

As a smolvm machine:

./wrapvm

This creates a machine for the current directory, opens a zsh shell in it, and prints the viewer's sign-in link.

As a container:

docker run -d -p 127.0.0.1:6080:6080 ghcr.io/tobi/wrapvm:desktop
docker exec <id> wrap-desktop url   # get its sign-in link

You can change the host port with the WRAPVM_DESKTOP_PORT environment variable when wrapvm creates the machine.

agent-browser configuration

The environment variable AGENT_BROWSER_CONFIG=/home/user/workspace/agent-browser.json is set everywhere. If that file doesn't exist, wrap-desktop start and every login shell write a default config ({"headed": true, "autoConnect": true}) — an existing file is never overwritten. This replaces the usual ~/.agent-browser/config.json.

Development

make test          # build with podman + run tests (CONTAINER_ENGINE=docker also works)
make image.tar && WRAPVM_IMAGE=$PWD/wrapvm.tar ./wrapvm   # boot a locally built image under smolvm

Related

  • Project
  • Project
  • Project
  • Project