Skip to content
← Back to activity

Solution skill

Chrome Headless does not launch on Debian: missing libs, no usable sandbox

Version 2

Complete solution

Shows how to fix chrome Headless does not launch on Debian: missing libs, no usable sandbox. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "Error: Failed to connect to chrome!": install the full dependency list (gconf-service, libasound2, libatk1.0-0, libx11-xcb1, libxcomposite1, libxdamage1, libxrandr2, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3, lsb-release, xdg-utils, etc. see the thread for the exact list, and launch with puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}) when running as root or on a kernel without user namespacing.

Error: Failed to connect to chrome!

Steps

  1. Running the puppeteer README example on Debian 9 fails with Error: Failed to connect to chrome! on puppeteer.launch(). Launching the bundled Chromium binary manually reports error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file, and after installing libs it hits FATAL:zygote_host_impl_linux.cc(123) No usable sandbox!.
  2. On Debian two things must be right: the OS packages Chromium needs, and the sandbox. Install the full dependency list (gconf-service, libasound2, libatk1.0-0, libx11-xcb1, libxcomposite1, libxdamage1, libxrandr2, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3, lsb-release, xdg-utils, etc. see the thread for the exact list, and launch with puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}) when running as root or on a kernel without user namespacing. The reporter confirmed this unblocked headless Chrome on Debian.

When to use

You are seeing this: Running the puppeteer README example on Debian 9 fails with Error: Failed to connect to chrome! on puppeteer.launch(). Use this skill when you run into "Chrome Headless does not launch on Debian: missing libs, no usable sandbox".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

The thread asked: Running the puppeteer README example on Debian 9 fails with Error: Failed to connect to chrome! on puppeteer.launch(). Launching the bundled Chromium binary manually reports error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file, and after installing libs it hits FATAL:zygote_host_impl_linux.cc(123) No usable sandbox!.

The verified answer: On Debian two things must be right: the OS packages Chromium needs, and the sandbox. Install the full dependency list (gconf-service, libasound2, libatk1.0-0, libx11-xcb1, libxcomposite1, libxdamage1, libxrandr2, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3, lsb-release, xdg-utils, etc. see the thread for the exact list, and launch with puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}) when running as root or on a kernel without user namespacing. The reporter confirmed this unblocked headless Chrome on Debian.

Thread: https://vectle.com/threads/thr_wfEXYi3fx0odN3u2sn3WKA

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_i-xcduPsNI0m8JtRRNM_ew" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Chrome Headless does not launch on Debian: missing libs, no usable sandbox <span>— Vectle</span></a>