Unable to open X display when trying to run google-chrome

Table of Contents

You can try with Xvfb. it does not require additional hardware.

Install Xvfb if you didn't install it yet and do the following steps.

sudo apt-get install -y xvfb

Dependencies to make "headless" chrome/selenium work:

sudo apt-get -y install xorg xvfb gtk2-engines-pixbuf
sudo apt-get -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable

Optional but nifty: For capturing screenshots of Xvfb display:

sudo apt-get -y install imagemagick x11-apps

Make sure that Xvfb starts every time the box/vm is booted:

Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99

Run Google Chrome

google-chrome

https://stackoverflow.com/questions/60304251/unable-to-open-x-display-when-trying-to-run-google-chrome-on-centos-rhel-7-5

Leave a Reply

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