Hemifield's picture
|
download
raw
3.35 kB
# Persistent Linux desktop
This bundle runs Xvfb, Openbox, and xterm from persistent user storage on this
Debian 12 x86_64 host. Startup needs no sudo, network access, or OS package
installation. It uses the host's base C library and Python 3.
Run any command with a fresh desktop and the bundle's library environment:
```sh
python3 /data/home/.codex/computer-use/linux/desktop/run.py -- COMMAND ARGUMENTS
```
Use `--no-terminal` before `--` when the command creates its own windows.
The command receives `DISPLAY`, `XAUTHORITY`, the bundled libraries through
`LD_LIBRARY_PATH`, and the bundled X11 tools through `PATH`. Its stdin, stdout,
and stderr remain intact, so this wrapper can start an MCP stdio server.
`environment()` in `run.py` also returns the library and resource environment
without starting a desktop.
The desktop uses a local X11 socket, a random MIT-MAGIC-COOKIE-1 credential in a
private temporary directory, and no TCP listener. Xvfb selects an unused display
number. Desktop processes stop when the command exits or the wrapper receives
SIGINT, SIGTERM, or SIGHUP. Diagnostics are saved in `logs/`.
This is a virtual desktop on this host. It does not attach to a physical screen.
The default terminal runs Bash without profile or rc files; Ctrl+V pastes the
clipboard, which is how the native `sky.type_text` implementation enters text.
`run.py` restores the owner-execute bit on its exact expected owned executables
if a task-environment refresh has reset file modes. It does not repair arbitrary
files or modify system programs. Start it with Python so this recovery also
works if `run.py` itself has lost its executable bit.
Debian Xvfb compiles in `/usr/bin` as the location of `xkbcomp`. The small
`xvfb_xkbdir.c` relocation shim sets the exported `XkbBinDirectory` variable from
`CUA_XKB_BINDIR`. Only the Xvfb process receives this shim in `LD_PRELOAD`.
The Debian binaries and OpenAI native libraries are unchanged. Rebuild it with:
```sh
gcc -shared -fPIC -O2 -Wall -Wextra \
-o /data/home/.codex/computer-use/linux/desktop/xvfb_xkbdir.so \
/data/home/.codex/computer-use/linux/desktop/xvfb_xkbdir.c -ldl
```
Xvfb starts with `-xkbdir` and `-fp` pointing into the bundle. Fontconfig uses
`config/fonts.conf`, DejaVu fonts in the bundle, and `cache/fontconfig/`.
GLX is disabled because this task needs 2D desktop input and screenshots; this
also avoids loading the large Mesa software renderer from persistent storage.
`packages.json` records all 143 downloaded Debian package versions and SHA-256
hashes. They came from the configured signed Bookworm package indexes via
`apt-get download`. The package set starts with:
```text
xvfb xterm xdotool x11-utils xauth openbox x11-xkb-utils xkb-data
xfonts-base fonts-dejavu-core fontconfig
```
Archive symlink and hardlink aliases are materialized as ordinary file and
directory copies inside the bundle. This is necessary because task persistence
drops symbolic links. `aliases.json` records their original targets and any
unavailable optional targets. Privileged mode bits are removed, and no dpkg
maintainer scripts run.
Verified as uid 1000: authenticated desktop startup, rejection of an
unauthenticated X11 connection, native `@oai/sky` screenshots, click, text entry,
Return, visible command output, executable-mode recovery, and process cleanup.

Xet Storage Details

Size:
3.35 kB
·
Xet hash:
5b7c493f32346a717189fe931f26013a45e93b5437ca0b29ab2cc370ea8e9904

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.