Sandbox flags are added for you
Most Linux containers ship without a usable setuid sandbox. Chromium then exits before the debugging port binds, and the session fails with no obvious cause. Extension.js adds--no-sandbox and --disable-setuid-sandbox to Chromium launches when it detects that layout. Detection needs the platform to be Linux, plus one of these signals:
- The
CIvariable, set to the stringtrue. - A
/.dockerenvfile, which Docker creates. - A
/run/.containerenvfile, which Podman creates. - The
REMOTE_CONTAINERSvariable, set totrueby VS Code. - The
CODESPACESvariable, set totrueby GitHub Codespaces. - The
containervariable, set by several Linux runtimes.
The platform check is part of the condition. A container running on a macOS or
Windows host reports a different platform, so the flags are not added there.
browserFlags config key and the EXTENSION_BROWSER_FLAGS variable.
Bind the dev server to all interfaces
The dev server binds to127.0.0.1 by default, which no process outside the container can reach. Pass --host 0.0.0.0 to bind every interface instead:
127.0.0.1, which is correct when you forward the port to your host. The host field in ready.json reports that connectable value, not the bind address.
When the browser has to reach the container under another name, pass it explicitly:
Keep the browser on the host
A container without a display cannot launch a browser. Start the dev server alone with--no-browser, then load the compiled output in your own browser:
dist/<browser>/, for example dist/chromium/. Load that directory as an unpacked extension on the host. Reloads still arrive over the dev server once the port is forwarded.
File watching over bind mounts
Extension.js watches with native filesystem events by default, because polling wakes the CPU and delays reloads. Native events are reliable inside a container that owns its own filesystem. A bind mount from a macOS or Windows host is the case that breaks. Those mounts often drop events, and edits made on the host never reach the compiler. Turn on polling for that case:EXTENSION_WATCH_POLL_INTERVAL to another value in milliseconds when you want a different cadence.
Checklist for a container session
- Forward the dev server port to the host.
- Start the session with
--host 0.0.0.0. - Add
--no-browserwhen the container has no browser. - Add
EXTENSION_WATCH_POLL=truewhen edits arrive over a bind mount.
Next steps
- Read Browser flags for the flags that Extension.js passes.
- Read Developing extensions under WSL for the Windows equivalent.
- Read CI templates for headless runs on a build server.

