Skip to content

Browser automation fails on Linux root/VPS: needs --no-sandbox and chromium channel auto-detection #15765

@Korkyzer

Description

@Korkyzer

Environment

  • Hermes running as root on Ubuntu 24.04 VPS (Hetzner)
  • No system Google Chrome installed (no /opt/google/chrome/chrome)
  • playwright-core + bundled Chromium installed via npx playwright install chromium

Problems

1. Native browser_navigate (agent-browser) times out

Local agent-browser tries to launch headless Chromium but hangs/timeout after 60s because Chrome refuses to start as root without --no-sandbox.

2. MCP Playwright defaults to system Chrome (channel: "chrome")

Even when no system Chrome exists, @playwright/mcp defaults to channel: "chrome" (looking at /opt/google/chrome/chrome), causing:

Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome
Run "npx playwright install chrome"

Current workarounds

Workaround A: CDP override for native browser

Launch Chromium manually with sandbox disabled:

chrome --headless --no-sandbox --disable-dev-shm-usage --remote-debugging-port=9222 ...

Then set in ~/.hermes/config.yaml:

browser:
  cdp_url: "http://localhost:9222"

Workaround B: MCP Playwright args

In ~/.hermes/config.yaml:

mcp_servers:
  playwright:
    command: npx
    args:
      - -y
      - "@playwright/mcp@latest"
      - --headless
      - --browser
      - chromium
      - --no-sandbox

Requests

  1. Auto-detect root user: When running as root, automatically append --no-sandbox (and --disable-dev-shm-usage) to Chromium launch args in both agent-browser and MCP Playwright contexts.
  2. Fallback to bundled Chromium: If system Chrome is not found, default MCP Playwright to bundled chromium (chrome-for-testing) instead of hardcoding channel: "chrome".
  3. Document browser.cdp_url persistence: Make the CDP override more discoverable for server/VPS deployments.

These changes would make browser automation work out-of-the-box on clean VPS installs without manual config patching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilestool/browserBrowser automation (CDP, Playwright)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions