- name
- openclaw-browser-wsl-attach
- description
- Automatically prepare, repair, and attach an OpenClaw-controlled Chromium browser in WSL or Linux environments where OpenClaw runs as root or in a headless session. Use when the user asks to configure browser control, fix browser startup failures, enable OpenClaw browser automation, repair CDP/browser issues, or start a reusable attachOnly Chromium session for screenshots, web automation, login flows, clicking, typing, or page extraction.
OpenClaw Browser WSL Attach
Prepare a stable OpenClaw browser session by using Chromium in attachOnly mode with remote debugging enabled. Prefer this workflow in WSL, headless Linux, or root-run OpenClaw environments where direct browser launch is flaky.
Workflow
- Check browser readiness before changing anything.
- If OpenClaw browser is already attached and healthy, reuse it.
- If Chromium exists but OpenClaw launch is unstable, switch to
attachOnlymode. - Run
python3 scripts/configure-browser.pyand restart the gateway. - Start Chromium manually with CDP on port
18800. - Verify
curl http://127.0.0.1:18800/json/versionandopenclaw browser status. - Then use normal browser actions through OpenClaw.
Quick checks
Run these checks first:
openclaw browser status
command -v chromium || command -v chromium-browser || command -v google-chrome
curl -s http://127.0.0.1:18800/json/versionInterpretation:
- If
openclaw browser statusshowsrunning: true, the browser is ready. - If CDP JSON returns but OpenClaw still fails to launch browser itself, prefer
attachOnly. - If Chromium is missing, install or point
browser.executablePathto a valid Chromium-based browser.
Preferred configuration
Use this browser config in ~/.openclaw/openclaw.json for WSL/root/headless Linux:
"browser": {
"enabled": true,
"executablePath": "/usr/bin/chromium",
"headless": true,
"noSandbox": true,
"attachOnly": true
}Notes:
- Use
noSandbox: truewhen Chromium runs as root. - Use
attachOnly: truewhen OpenClaw-managed launch times out or is unreliable. browser: unknownanddetectedBrowser: customare acceptable ifrunning: trueand CDP works.
Start Chromium manually
Use the bundled scripts in this order:
python3 scripts/configure-browser.py
# restart gateway after config changes
bash scripts/start-browser.sh
bash scripts/healthcheck.shWhat each script does:
configure-browser.py: updates~/.openclaw/openclaw.jsonfor WSL/root/headless attachOnly mode and writes a timestamped backupstart-browser.sh: creates the OpenClaw browser profile directory, kills stale Chromium on port18800when needed, starts headless Chromium, and prints verification outputhealthcheck.sh: shows binary, status, CDP, process, and environment diagnostics
Verify success
Healthy state usually looks like:
curl http://127.0.0.1:18800/json/versionreturns JSONopenclaw browser statusshowsrunning: trueopenclaw browser tabsworks
Once healthy, continue with OpenClaw browser tooling normally.
Repair workflow
If browser control breaks later:
- Re-run
openclaw browser status - Re-run
bash scripts/start-browser.sh - Run
bash scripts/healthcheck.sh - If needed, inspect
/tmp/openclaw-browser.log - Confirm port
18800is not blocked by another process - Restart gateway only after config changes
User-facing guidance
After setup, the user can simply ask for browser tasks in natural language, for example:
- open a URL
- search a phrase
- log into a site
- click a button
- extract page content
- take a screenshot
Read references/troubleshooting.md when browser attach still fails after the standard workflow.
Prefer this skill whenever the task is about making OpenClaw browser automation reliable on this machine, not just using the browser tool once.