ComputerBox runs an XFCE desktop with a built-in noVNC server. Forward its GUI ports and anyone with the address can watch or take over — useful for inspecting a misbehaving app, reviewing what an agent is doing, or handing someone a disposable desktop.
Quick Example (Happy Path)
Forward the desktop HTTP/HTTPS ports ofComputerBox to fixed host ports, keep it running after startup, and let a human open it in a browser.
Remote access (for non-local users): replace localhost in the shared addresses with a reachable IP/hostname of the machine running this script, and make sure that machine’s firewall allows the chosen ports. The BoxLite SDK itself only handles “box port -> host port” forwarding; “host -> public network” exposure depends on your network environment.
Node equivalent (@boxlite-ai/boxlite):
Parameters and Returns
ComputerBox(...) desktop-access parameters (Python)
The Node field names are camelCase:guiHttpPort/guiHttpsPort/cpus/memoryMib.
Methods related to desktop access
Built-in defaults (from sdks/node/lib/constants.ts / sdks/python/boxlite/constants.py)
Note:3000/3001are the GUI ports fixed inside the box; the constructor argumentsgui_http_port/gui_https_portchange the mapped port on the host side. The two can differ (for examplegui_http_port=8080serves the desktop on host port 8080).
Connecting a traditional VNC client
If you truly need the standard VNC protocol (rather than the noVNC web page), the only option today is to install and run a VNC server inside the sandbox yourself (for example install
x11vnc/tigervnc in a custom image), then expose the VNC port to the host via general port forwarding. This path has no SDK wrapper; it falls under “run a service inside the box yourself plus port forwarding.”
Current limitation: the standard VNC protocol has no SDK wrapper and requires a self-built service; BoxLite provides no official support for that path, so prefer the built-in noVNC web desktop.
Troubleshooting
Opening the HTTPS address in a browser warns “not secure / certificate error” The webtop desktop uses a self-signed certificate; this is expected. Click “Advanced” -> “Proceed”, or switch to the HTTP port (http://localhost:3000).
The third volume element is a bool read_only (True = read-only / False = read-write), not the string "ro"/"rw". Correct form:
ThePort in use / cannot connect"ro"/"rw"string syntax belongs only to the CLI-vargument, which differs from the SDK’s bool; do not mix them.
gui_http_port/gui_https_port are host ports; if taken, the mapping fails. Switch to a free port; for remote access you also need to open the host firewall and replace localhost in the address with a reachable IP/hostname.
RuntimeError (Python) / bare Error (Node): box failed to start
Common causes: (1) no hardware virtualization (Linux missing /dev/kvm or user not in the kvm group; macOS Intel not supported); (2) unstable network during image pull. An image pull failure raises a standard RuntimeError/bare Error, not a BoxliteError subclass, so catch with a broad type and retry if appropriate.
wait_until_ready times out
The webtop desktop is slow to start on first run (image decompression, X server initialization). Increase timeout accordingly (e.g. wait_until_ready(timeout=120)), and make sure you allocate >=2 CPU / >=2048 MiB memory.
Need the traditional VNC protocol but cannot find an API
Use the built-in noVNC web desktop (see above), or run your own VNC service plus port forwarding.
