I am trying to run a headless instance of chromium within an ubuntu docker image but I keep getting the error this system has no display nor audio inputs or outputs
[0307/003516.533150:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Is there anyway to disable dbus as it seems docker does not support it here are lines from my Dockerfile
FROM arm64v8/ubuntu:bionic
RUN apt install -y chromium-browser
RUN apt install -y chromium-drivers
Here is the launch line I use
chromium-browser --no-sandbox --headless --autoplay-policy=no-user-gesture-required --no-first-run --disable-gpu --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --disable-sync index.html
Headless Chromium allows running Chromium in a headless/server environment. Expected use cases include loading web pages, extracting metadata (e.g., the DOM) and generating bitmaps from page contents -- using all the modern web platform features provided by Chromium and Blink.
Using Puppeteer in Dockerconst puppeteer = require("puppeteer"); const browser = await puppeteer. launch({ headless: true, args: [ "--disable-gpu", "--disable-dev-shm-usage", "--disable-setuid-sandbox", "--no-sandbox", ] }); const page = await browser. newPage(); await page.
Launch from KDE Start Menu: Internet -> Chromium Docker, and after a terminal window flashes on screen and a few seconds pass, Docker will launch with Chromium Media Edition within it. Happy Streaming!
To have real headless chromium you will need to add the --remote-debugging-port
option to your line as follows:
chromium-browser --no-sandbox --headless --autoplay-policy=no-user-gesture-required --no-first-run --disable-gpu --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --disable-sync --remote-debugging-port=9222 index.html
After launching, you can use the debugging port to connect and control the browser as described here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With