Computer Use
by @ram-raghav-s
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
clawhub install computer-useπ About This Skill
name: computer-use description: Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag, etc). Unlike OpenClaw's browser tool, operates at the X11 level so websites cannot detect automation. Includes VNC for live viewing. version: 1.2.1
Computer Use Skill
Full desktop GUI control for headless Linux servers. Creates a virtual display (Xvfb + XFCE) so you can run and control desktop applications on VPS/cloud instances without a physical monitor.
Environment
:99Quick Setup
Run the setup script to install everything (systemd services, flicker-free VNC):
./scripts/setup-vnc.sh
This installs:
:99All services auto-start on boot and auto-restart on crash.
Actions Reference
| Action | Script | Arguments | Description |
|--------|--------|-----------|-------------|
| screenshot | screenshot.sh | β | Capture screen β base64 PNG |
| cursor_position | cursor_position.sh | β | Get current mouse X,Y |
| mouse_move | mouse_move.sh | x y | Move mouse to coordinates |
| left_click | click.sh | x y left | Left click at coordinates |
| right_click | click.sh | x y right | Right click |
| middle_click | click.sh | x y middle | Middle click |
| double_click | click.sh | x y double | Double click |
| triple_click | click.sh | x y triple | Triple click (select line) |
| left_click_drag | drag.sh | x1 y1 x2 y2 | Drag from start to end |
| left_mouse_down | mouse_down.sh | β | Press mouse button |
| left_mouse_up | mouse_up.sh | β | Release mouse button |
| type | type_text.sh | "text" | Type text (50 char chunks, 12ms delay) |
| key | key.sh | "combo" | Press key (Return, ctrl+c, alt+F4) |
| hold_key | hold_key.sh | "key" secs | Hold key for duration |
| scroll | scroll.sh | dir amt [x y] | Scroll up/down/left/right |
| wait | wait.sh | seconds | Wait then screenshot |
| zoom | zoom.sh | x1 y1 x2 y2 | Cropped region screenshot |
Usage Examples
export DISPLAY=:99Take screenshot
./scripts/screenshot.shClick at coordinates
./scripts/click.sh 512 384 leftType text
./scripts/type_text.sh "Hello world"Press key combo
./scripts/key.sh "ctrl+s"Scroll down
./scripts/scroll.sh down 5
Workflow Pattern
1. Screenshot β Always start by seeing the screen 2. Analyze β Identify UI elements and coordinates 3. Act β Click, type, scroll 4. Screenshot β Verify result 5. Repeat
Tips
ctrl+End to jump to page bottom in browsersLive Desktop Viewing (VNC)
Watch the desktop in real-time via browser or VNC client.
Connect via Browser
# SSH tunnel (run on your local machine)
ssh -L 6080:localhost:6080 your-serverOpen in browser
http://localhost:6080/vnc.html
Connect via VNC Client
# SSH tunnel
ssh -L 5900:localhost:5900 your-serverConnect VNC client to localhost:5900
SSH Config (recommended)
Add to ~/.ssh/config for automatic tunneling:
Host your-server
HostName your.server.ip
User your-user
LocalForward 6080 127.0.0.1:6080
LocalForward 5900 127.0.0.1:5900
Then just ssh your-server and VNC is available.
System Services
# Check status
systemctl status xvfb xfce-minimal x11vnc novncRestart if needed
sudo systemctl restart xvfb xfce-minimal x11vnc novnc
Service Chain
xvfb β xfce-minimal β x11vnc β novnc
-noxdamage for stabilityOpening Applications
export DISPLAY=:99Chrome β only use --no-sandbox if the kernel lacks user namespace support.
Check: cat /proc/sys/kernel/unprivileged_userns_clone
1 = sandbox works, do NOT use --no-sandbox
0 = sandbox fails, --no-sandbox required as fallback
Using --no-sandbox when unnecessary causes instability and crashes.
if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone 2>/dev/null)" = "0" ]; then
google-chrome --no-sandbox &
else
google-chrome &
fixfce4-terminal & # Terminal
thunar & # File manager
Note: Snap browsers (Firefox, Chromium) have sandbox issues on headless servers. Use Chrome .deb instead:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
Manual Setup
If you prefer manual setup instead of setup-vnc.sh:
# Install packages
sudo apt install -y xvfb xfce4 xfce4-terminal xdotool scrot imagemagick dbus-x11 x11vnc novnc websockifyRun the setup script (generates systemd services, masks xfdesktop, starts everything)
./scripts/setup-vnc.sh
If you prefer fully manual setup, the setup-vnc.sh script generates all systemd service files inline -- read it for the exact service definitions.
Troubleshooting
VNC shows black screen
pgrep xfwm4sudo systemctl restart xfce-minimalVNC flickering/flashing
/usr/bin/xfdesktop)VNC disconnects frequently
--heartbeat 30 flag-noxdamage flagx11vnc crashes (SIGSEGV)
-noxdamage -noxfixes flagsRequirements
Installed by setup-vnc.sh:
xvfb xfce4 xfce4-terminal xdotool scrot imagemagick dbus-x11 x11vnc novnc websockify
π Tips & Best Practices
ctrl+End to jump to page bottom in browsers