tabbify.io
Documentation
Product directionEDGE BOX
ReferenceArchitecture

A screen in your devbox

A web page has to be looked at, not only fetched. Every devbox carries a helper called desk that runs a virtual display (Xvfb) with a small window manager and a browser. Nobody sees that display by itself: you, or your agent, look at it through screenshots and drive it with clicks and keys. Use it to check how a page really renders, to click through a flow the way a person would, or to run a desktop program.

The helper is in the image, but the display tools and a browser are not: a devbox that never uses the screen spends no disk or memory on it.

Install it once

desk setup            # Firefox
desk setup chrome     # Google Chrome instead (x86_64 only)

desk setup needs the network and sudo (the devbox user has it). It takes several hundred MB of the devbox root filesystem (Firefox about 800 MB), which holds the system packages and is about 1.9 GB. The tools are gone when the devbox gets a new image: run desk setup again after that. devbox_resize grows the home disk and the memory, not the root filesystem.

An open browser keeps about 0.5 GB of memory (Chrome about 0.35 GB). On the smallest (2 GB) devbox that is fine for one browser; raise the memory with devbox_resize before running heavy pages next to a build.

desk selfcheck lists what is missing, one line per check, and exits with 0 only when everything is in place.

Look and click

desk start                       # the display, 1280x800
desk open http://localhost:3000  # starts the browser, or reuses it
desk wait "My page title" 30     # wait until a window title matches
desk shot --jpeg                 # a small screenshot; prints the file path
desk click 640 400               # left click at screen pixels
desk type "hello"                # type into the focused field
desk key ctrl+a BackSpace        # press keys
desk scroll down 5               # mouse wheel
desk windows                     # every window: id, size, title
desk stop                        # close the display and everything on it

Take a new screenshot after every action and look at it before the next one. desk help lists every command.

Small screenshots

desk shot writes a PNG of the whole screen. As text that is 150,000 characters and more, which is too much to put in a chat. desk shot --jpeg writes a JPEG, usually well under 80 KB, 1024 pixels wide by default. Options:

  • --width 800 or --scale 50% for a different size;
  • --quality 60 for a smaller file (1 to 100, default 70);
  • a file name as the last argument.

The command prints the file path. Keep that path in your report instead of printing the picture. On standard error it also prints the scale, for example scale=0.8000: a point at (x, y) in the picture is at (x / 0.8, y / 0.8) on the screen, and desk click takes screen pixels.

Phone, tablet and other sizes

desk start phone     # 390x844
desk start tablet    # 820x1180
desk start laptop    # 1280x800, the default
desk start fhd       # 1920x1080
desk start 1440x900  # any WxH

Starting a display with another size restarts it and says so. In Chrome the phone and tablet profiles also report a touch screen, a mobile viewport and a mobile user agent, so a page that adapts to phones shows its mobile layout. Firefox has no such emulation: it only gets the window size, and desk status says "no device emulation in firefox". For a mobile test run desk setup chrome first.

Watch it yourself

The display is private to the devbox. To see it, or to sign in to a site by hand, run desk vnc in the devbox. It prints a password, new each time the VNC server starts, and the command for your own computer, which goes through the SSH gateway:

ssh -N -L 5900:127.0.0.1:5900 <devbox-name>@ssh.tabbify.io -p 2222

Then open vnc://127.0.0.1:5900 (on a Mac: Finder, Go, Connect to Server). If port 5900 is taken on your computer (a Mac with Screen Sharing on), use -L 5901:127.0.0.1:5900 and open vnc://127.0.0.1:5901. The VNC server listens only on the devbox's loopback; the way in is your SSH login. The sign-in stays in the browser profile (~/.cache/desk), so the agent can use the site afterwards. Never give an agent a password that is not meant for exactly that site. desk stop ends the VNC server.

Record a video

desk rec start /tmp/run.mp4   # 5 frames a second
desk rec stop                 # prints the file path

A recording of a test run is a few megabytes a minute.

Limits

  • The display does not survive a devbox restart: run desk start again.
  • No sound, no GPU. WebGL may be slow or unavailable.
  • The browser profile in ~/.cache/desk grows to about 200 MB. It is safe to delete while the browser is stopped.
  • Playwright, once you install it, can drive the same display. With Chrome it can attach to the DevTools port: chromium.connect_over_cdp("http://127.0.0.1:9222").

For agents

The check a page in a devbox recipe is the step-by-step version for an agent working over MCP.

An agent with exec rights on the devbox can also call devbox_screenshot: it takes desk shot --jpeg of the running display and answers it as an image, so the agent sees the screen instead of reading a file path. scale is 0.25 to 1 (default 0.5), quality 30 to 90 (default 70); a screenshot larger than the platform's limit (512 KB by default) is refused. Start the display with desk start first.