hermes - ✅(Solved) Fix Browser automation fails on Linux root/VPS: needs --no-sandbox and chromium channel auto-detection [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15765Fetched 2026-04-26 05:25:12
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×1cross-referenced ×1referenced ×1

Root Cause

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.

Fix Action

Fix / Workaround

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

PR fix notes

PR #15771: fix(browser): inject --no-sandbox when running as root on Linux VPS

Description (problem / solution / changelog)

Problem

Chromium refuses to start as root without --no-sandbox, causing browser_navigate to hang and timeout on VPS/Docker deployments (common with Hetzner, DigitalOcean, etc.).

Fix

When the process is running as root (uid=0), inject AGENT_BROWSER_CHROME_FLAGS with --no-sandbox --disable-dev-shm-usage into the browser subprocess environment. The flag is skipped if the user has already set AGENT_BROWSER_CHROME_FLAGS manually. Uses hasattr(os, "geteuid") guard for Windows compatibility.

Fixes #15765

Changed files

  • hermes_cli/mcp_config.py (modified, +29/-1)
  • tools/browser_tool.py (modified, +14/-0)

Code Example

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

---

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

---

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

---

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

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.

extent analysis

TL;DR

To resolve the issue, consider modifying the launch arguments for Chromium to include --no-sandbox when running as root and configure MCP Playwright to default to the bundled Chromium.

Guidance

  • Modify the agent-browser launch command to include --no-sandbox and --disable-dev-shm-usage when running as root to prevent timeouts.
  • Update the MCP Playwright configuration to use the bundled Chromium by setting the channel to chromium instead of chrome when the system Chrome is not found.
  • Set the browser.cdp_url in ~/.hermes/config.yaml to the manually launched Chromium instance to override the default CDP URL.

Example

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

And in ~/.hermes/config.yaml:

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

Notes

The proposed solutions assume that the issue is caused by the lack of --no-sandbox flag when running Chromium as root and the hardcoded channel: "chrome" in MCP Playwright.

Recommendation

Apply the workaround by modifying the launch arguments and configuring MCP Playwright to use the bundled Chromium, as this approach addresses the root cause of the issue and provides a reliable solution for VPS deployments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING