#!/bin/bash # Sets up a desktop for AI agents on an exe.dev VM (Ubuntu 24.04): # desktop-vnc TigerVNC X server, display :1, localhost:5900, no password # desktop-xfce the Xfce session on display :1 # desktop-novnc noVNC on port 6080 (private: https://.exe.xyz:6080/) # desktop-chrome Google Chrome on the desktop, DevTools (CDP) on localhost:9222 # desktop-playwright-mcp Playwright MCP for that Chrome, on localhost:8931/mcp # Run it as the VM's user (exedev); it uses sudo. Safe to run again. # From https://exe.dev/deploy/computer-use set -euo pipefail GEOMETRY=${GEOMETRY:-1280x800} U=$(id -un) H=$HOME echo "== packages" sudo apt-get update -q sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \ xfce4 xfce4-terminal dbus-x11 tigervnc-standalone-server novnc python3-websockify \ xdotool ffmpeg fonts-noto-color-emoji if ! command -v google-chrome >/dev/null; then curl -fsSL -o /tmp/google-chrome.deb \ https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -q /tmp/google-chrome.deb rm -f /tmp/google-chrome.deb fi if ! node -v 2>/dev/null | grep -q '^v2[4-9]'; then curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - sudo apt-get install -y -q nodejs fi sudo npm install -g --no-fund --no-audit @playwright/mcp@0 # Open the desktop at the bare URL, scaled to the browser window. echo '' | sudo tee /usr/share/novnc/index.html >/dev/null echo "== services" sudo tee /etc/systemd/system/desktop-vnc.service >/dev/null </dev/null </dev/null </dev/null </dev/null </dev/null && break; sleep 1; done systemctl is-active desktop-vnc desktop-xfce desktop-novnc desktop-chrome desktop-playwright-mcp curl -fs localhost:9222/json/version | grep '"Browser"' curl -fsI localhost:6080/vnc.html | head -1 echo "Desktop: https://$(hostname).exe.xyz:6080/"