Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Fix Selenium Headless Mode Errors on Linux

A practical diagnostic path for Selenium headless errors on Linux: test Chrome directly, verify driver compatibility, inspect logs, and fix libraries or paths.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To fix Selenium headless-mode errors on Linux, first identify whether Chrome itself can start, then check the Chrome/ChromeDriver versions, user permissions, runtime libraries, and driver discovery. Headless Chrome does not normally need Xvfb; adding flags at random can hide the cause rather than fix it.

Start with the failure layer

Headless mode removes the visible browser window. It does not remove Chrome’s need for a working browser binary, a compatible driver, and the Linux runtime libraries Chrome depends on. Diagnose in this order so each result narrows the cause.

  1. Record the first complete error. Save the exception, ChromeDriver log, Chrome and ChromeDriver versions, browser path, and arguments passed by the test.
  2. Try launching the exact Chrome binary directly. Use the same Linux account and environment as the test. If Chrome fails outside Selenium, resolve that installation or environment failure before changing WebDriver settings.
  3. Check version compatibility and driver discovery. Confirm the selected ChromeDriver supports the installed Chrome version, and establish which driver and browser Selenium actually selected.
  4. Check the execution user and named missing libraries. Do not assume a generic flag or package addresses a different error.

ChromeDriver’s troubleshooting guide identifies running Chrome as root as a common startup-crash cause. It says the --no-sandbox workaround is unsupported and highly discouraged. Prefer running Chrome as a regular Linux user and correcting the container or service setup.

Check Chrome and ChromeDriver versions

Selenium’s Chrome documentation says Chrome and ChromeDriver major versions should match. An error such as “This version of ChromeDriver only supports Chrome version …” points to a compatibility mismatch, not a headless-specific failure. Check the major version of the browser and the driver executable Selenium is using; a separately installed driver may be taking precedence over the one you expected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For standard Selenium bindings, Selenium Manager is built in and used by default to manage browser drivers. It is generally the simplest route when the environment supports its downloads. If you use a custom package manager, a managed image, or a network that blocks downloads, explicitly configure browser or driver locations and keep the versions compatible. Selenium Manager’s behavior and supported environments are documented at Selenium Manager.

Choose a management approach

Approach When it fits What to check
Selenium Manager Standard supported Selenium setup where automatic browser/driver management is permitted. Network and proxy access for downloads, plus the exact error if management fails.
Explicit paths Custom package managers, controlled images, or installations where versions and locations are pinned. The actual browser and driver paths selected at runtime, their compatibility, and who maintains updates.

Do not download another driver or change paths until the error indicates that driver management or discovery is the problem. For example, “Unable to locate the chromedriver executable” is a discovery/path issue; it does not by itself show that headless mode is broken.

Confirm the binary and arguments Chrome receives

Use ChromeDriver’s guidance to launch the same Chrome binary used by the test from a normal user command line. Check the ChromeDriver log for the selected binary and preserve the arguments used in the failing test. If direct Chrome launch fails, fix that first. If direct launch works but WebDriver does not, investigate driver compatibility, the service log, and differences in the test harness or environment.

Enable ChromeDriver service logging before changing multiple variables. Selenium’s Chrome documentation shows how to send service output to a file or standard output and configure logging. Keep the log with the browser path, version numbers, arguments, and the full first startup error; this makes startup failures such as “DevToolsActivePort file doesn’t exist” diagnosable instead of guessing that one particular flag is responsible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use headless mode without a display server

Selenium documents Chrome headless arguments including --headless=new. Chrome’s headless documentation explains that Chrome creates platform windows without displaying them, and its headless shell documentation says a display server such as Xvfb is not needed for headless Chrome. A machine without a desktop session is therefore not, by itself, a reason to install Xvfb.

Use a visible session only as a comparison where a display is available: run the same binary and arguments headful, then compare the direct Chrome result with the WebDriver result. Avoid changing several launch arguments at once. For version-specific options, use the current Selenium and Chrome documentation rather than assuming an old flag remains appropriate.

Resolve missing Linux runtime libraries

If the error says error while loading shared libraries, act on the library named in that message. Selenium Manager’s Linux example reports libatk-1.0.so.0 as missing and identifies libatk-bridge2.0-0 as the package to install for that example. Package names differ among distributions; use the package manager and package name appropriate to your Linux distribution. That example package is not a general fix for unrelated errors or every Linux system.

Troubleshoot common messages

Message or symptom Likely area Next step
“DevToolsActivePort file doesn’t exist” Chrome failed during startup; the message alone does not identify why. Launch the exact binary directly as the same user, then inspect ChromeDriver’s startup log, arguments, and environment.
“This version of ChromeDriver only supports Chrome version …” Browser/driver compatibility. Compare Chrome and ChromeDriver major versions and verify which executable Selenium selected. Check Selenium Manager or correct explicit paths.
error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file A missing runtime library. Install the distribution-appropriate package for the named library; Selenium’s documented example identifies libatk-bridge2.0-0 for this case.
“Unable to locate the chromedriver executable” Driver discovery or path configuration. Check Selenium Manager’s download access or configure the correct explicit driver path for the installation.
Chrome crashes when launched by a service running as root Execution user and sandbox configuration. Run Chrome as a regular Linux user. ChromeDriver describes --no-sandbox as unsupported and highly discouraged.
Automatic driver/browser setup cannot download Network, proxy, package-manager, or environment constraints. Check download access and proxy settings; if necessary, use a controlled browser and compatible driver at explicit paths.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a website screenshot rather than browser automation, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP tools let AI agents take screenshots, and 1,000 shots a month are free with no card; paid plans start at $5 for 3,000.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cURL example, using the documented API pattern with a target URL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for setup and options. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does Selenium headless Chrome require Xvfb on Linux?

No. Chrome’s headless shell documentation says a display server such as Xvfb is not needed for headless Chrome.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does “DevToolsActivePort file doesn’t exist” identify one specific broken flag?

No. It is a startup failure symptom; the ChromeDriver log and direct launch of the selected binary are needed to narrow the cause.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.