Lanuching chromium-browser on Centos throws: Gtk-WARNING **: cannot open display

10,623 views
Skip to first unread message

עופר בר

unread,
Sep 3, 2017, 5:00:34 AM9/3/17
to Chromium-dev
Hi,

I have a Tomcat 8 application on Centos (6 or 7) which is trying to launch chromium-browser (headless) for PDF rendering.
However it fails doing so.

When I try to manually launch:
> chromium-browser --headless
from the shell, either under root or another user I get this error:

(chromium-browser:29101): Gtk-WARNING **: cannot open display:

Is it possible to launch chromium-browser headless on Centos? How?

Is it possible from Tomcat?

Thanks!

Ofer

Sami Kyostila

unread,
Sep 4, 2017, 11:48:53 AM9/4/17
to ofer...@gmail.com, Chromium-dev
Which version of Chromium are you using? I suggest trying again with the latest Chrome release.

- Sami

‪su 3. syysk. 2017 klo 10.01 ‫עופר בר‬‎ <ofer...@gmail.com> kirjoitti:‬
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/e2216e05-e54f-40c0-acd1-2f1e2c440c21%40chromium.org.

עופר בר

unread,
Sep 4, 2017, 3:02:11 PM9/4/17
to Chromium-dev, ofer...@gmail.com, skyo...@chromium.org
I have installed chromium like this:

> yum install epel-release
> yum install chromium 

The versions I got:

chromium.x86_64                         59.0.3071.115-3.el7            @epel
chromium-libs.x86_64                    59.0.3071.115-3.el7            @epel
chromium-libs-media.x86_64              59.0.3071.115-3.el7            @epel
chromium-release.noarch                 2.2-1                          installed
chrome-remote-desktop.x86_64            59.0.3071.115-3.el7            epel
chromedriver.x86_64                     59.0.3071.115-3.el7            epel
chromium-browser.x86_64                 38.0.2125.111-1.el6.centos     chromium-el6

Is this the correct way to install chromium-browser on Centos?

Thx

Sami Kyostila

unread,
Sep 5, 2017, 12:50:59 PM9/5/17
to עופר בר, Chromium-dev
I would recommend trying with the Google-provided binaries. I'm not sure how the CentOS binaries correspond to upstream Chromium.

- Sami

‪ma 4. syysk. 2017 klo 20.02 ‫עופר בר‬‎ <ofer...@gmail.com> kirjoitti:‬

Lambros Lambrou

unread,
Sep 5, 2017, 3:35:17 PM9/5/17
to Sami Kyostila, עופר בר, Chromium-dev
The error:

cannot open display:

suggests that you haven't set the $DISPLAY environment variable.

To run Chrome headless (or any other X11 application), you need to have an X server running.
On a headless system, you might do this using Xvfb (I believe Chrome uses Xvfb for some tests).
Once you are running Xvfb (or Xorg) you need to set $DISPLAY to point to it.

Depending on your headless setup, you might already be running an X server (but without a physical monitor connected). In that case, you could try simply setting DISPLAY to :0 like this:
DISPLAY=:0 chromium-browser --headless


עופר בר

unread,
Sep 7, 2017, 7:10:17 AM9/7/17
to Chromium-dev, skyo...@google.com, ofer...@gmail.com
Thank you very much for your response!

I've tried running this command with DISPLAY=:0...
but I'm still getting an error:

Xlib:  extension "RANDR" missing on display ":0"

I also tried running using the xvfb-run command, and it doesn't produce any error from the shell, but when I call it from the Java code in Tomcat I get error 1.
I'm guessing that this is because the user which is running Tomcat has no login (marked in /etc/passwd).

Should I just change this restriction or do I need to do something else?

Thanks!

Sami Kyostila

unread,
Sep 7, 2017, 7:26:58 AM9/7/17
to Lambros Lambrou, עופר בר, Chromium-dev
Correction: Headless Chrome (unlike regular Chrome) is not an X11 application and therefore does not depend on any X server to be present. I suspect the binary you're trying to run is an older or somehow modified version which tries to communicate with X11 for some reason.

- Sami

Lambros Lambrou

unread,
Sep 7, 2017, 2:16:42 PM9/7/17
to Sami Kyostila, עופר בר, Chromium-dev
Thank you for the correction, I did not know that!
Due to the nature of CentOS, it seems very likely that chromium-browser is based on an older snapshot of Chromium code.

עופר בר

unread,
Sep 11, 2017, 7:04:57 AM9/11/17
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
HI Sami,

Thanks for your responses.
I guess you're right since the chromium-browser that I got from the Centos repository has a version: 38, while the other libraries are 59:

chromium.x86_64                         59.0.3071.115-3.el7            @epel
chromium-libs.x86_64                    59.0.3071.115-3.el7            @epel
chromium-libs-media.x86_64              59.0.3071.115-3.el7            @epel
chrome-remote-desktop.x86_64            59.0.3071.115-3.el7            epel
chromedriver.x86_64                     59.0.3071.115-3.el7            epel
chromium-browser.x86_64                 38.0.2125.111-1.el6.centos     chromium-el6

However, the link that you provided earlier does not a a Centos built version.

Does that mean that I have to build Chromium myself???

Thx

Sami Kyostila

unread,
Sep 11, 2017, 7:38:50 AM9/11/17
to עופר בר, Chromium-dev, lambros...@chromium.org
That's right. We only provide binaries for Debian/Ubuntu (.deb) and Fedora/openSUSE (.rpm).

- Sami

‪ma 11. syysk. 2017 klo 12.04 ‫עופר בר‬‎ <ofer...@gmail.com> kirjoitti:‬

Torne (Richard Coles)

unread,
Sep 11, 2017, 11:45:25 AM9/11/17
to skyo...@google.com, עופר בר, Chromium-dev, lambros...@chromium.org
The RPM binaries will work on CentOS as well; RHEL/CentOS/Fedora are "close enough".

Paweł Hajdan, Jr.

unread,
Sep 11, 2017, 1:43:06 PM9/11/17
to Torne (Richard Coles), Sami Kyostila, עופר בר, Chromium-dev, Lambros Lambrou
They're not guaranteed to work though, and in fact broke several times in the past.

Please report issues with CentOS Chromium packages to CentOS.

Paweł

Tomáš Popela

unread,
Sep 12, 2017, 6:24:45 AM9/12/17
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
Dne pondělí 11. září 2017 13:04:57 UTC+2 עופר בר napsal(a):
I guess you're right since the chromium-browser that I got from the Centos repository has a version: 38, while the other libraries are 59:

chromium.x86_64                         59.0.3071.115-3.el7            @epel
chromium-libs.x86_64                    59.0.3071.115-3.el7            @epel
chromium-libs-media.x86_64              59.0.3071.115-3.el7            @epel
chrome-remote-desktop.x86_64            59.0.3071.115-3.el7            epel
chromedriver.x86_64                     59.0.3071.115-3.el7            epel
chromium-browser.x86_64                 38.0.2125.111-1.el6.centos     chromium-el6

However, the link that you provided earlier does not a a Centos built version.

Does that mean that I have to build Chromium myself???

First of all I would uninstall the chromium-browser package that you have installed as there could be some conflicts. Then update the chromium from epel run the epel version that is provided by Spot by issuing:

$ chromium-browser --headless --disable-gpu --dump-dom https://www.chromestatus.com

This works for me on RHEL 7.4 with:

$ rpm -qa chromium
chromium-59.0.3071.115-3.el7.x86_64

I also tried the official Chrome RPM packages and they work as well (just replace chromium-browser with google-chrome)..

עופר בר

unread,
Sep 13, 2017, 4:40:37 AM9/13/17
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
Thank you Tomáš !

I also tried the Google Chrome and it works fine.

It is explained on this deprecated site: https://chrome.richardlloyd.org.uk/

However, the problem with the official build is that Google only supports Centos 7. 
Centos 6 is left in the dark, although the OS is still maintained until 2020.

Thx

Ofer

Tomáš Popela

unread,
Sep 13, 2017, 5:45:47 AM9/13/17
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
Dne středa 13. září 2017 10:40:37 UTC+2 עופר בר napsal(a):
It is explained on this deprecated site: https://chrome.richardlloyd.org.uk/

It's not true what's written there:

> (ignoring Chromium, which no-one seems to be keeping up-to-date for RHEL/CentOS 6)

there is a chromium-browser package with up to date Chromium - see https://access.redhat.com/errata/RHSA-2017:2676 for example.. And also we are ready for the situation when Chromium removes GTK+ 2 support.

עופר בר

unread,
Sep 13, 2017, 10:07:47 AM9/13/17
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
I believe this is only available for RH customers but not freely for Centos users...

Anyway, I wasn't able to find any current repositories that work on Centos for Chromium.
If you find it, I'll be happy to know!

Thx

Paweł Hajdan, Jr.

unread,
Sep 14, 2017, 4:29:54 AM9/14/17
to עופר בר, Chromium-dev, Lambros Lambrou, Sami Kyostila
On Wed, Sep 13, 2017 at 10:40 AM, עופר בר <ofer...@gmail.com> wrote:
However, the problem with the official build is that Google only supports Centos 7.

To avoid potentially confusing people: it may happen to work (as mentioned earlier), but it's not guaranteed.

See https://support.google.com/chrome/answer/95346 for official system requirements. Currently for Linux, these are 64-bit Ubuntu 14.04+, Debian 8+, openSUSE 13.3+, or Fedora Linux 24+.
 
Centos 6 is left in the dark, although the OS is still maintained until 2020.

Chrome was never officially supported on CentOS 6 - see point above.

I'm not sure what's the status of Chromium packaging for CentOS / EPEL. Anyone interested is welcome to join https://groups.google.com/a/chromium.org/forum/#!forum/chromium-packagers for help with packaging. That list is not intended for end-users though, just packagers.

Paweł
 
On Tuesday, September 12, 2017 at 1:24:45 PM UTC+3, Tomáš Popela wrote:
Dne pondělí 11. září 2017 13:04:57 UTC+2 עופר בר napsal(a):
I guess you're right since the chromium-browser that I got from the Centos repository has a version: 38, while the other libraries are 59:

chromium.x86_64                         59.0.3071.115-3.el7            @epel
chromium-libs.x86_64                    59.0.3071.115-3.el7            @epel
chromium-libs-media.x86_64              59.0.3071.115-3.el7            @epel
chrome-remote-desktop.x86_64            59.0.3071.115-3.el7            epel
chromedriver.x86_64                     59.0.3071.115-3.el7            epel
chromium-browser.x86_64                 38.0.2125.111-1.el6.centos     chromium-el6

However, the link that you provided earlier does not a a Centos built version.

Does that mean that I have to build Chromium myself???

First of all I would uninstall the chromium-browser package that you have installed as there could be some conflicts. Then update the chromium from epel run the epel version that is provided by Spot by issuing:

$ chromium-browser --headless --disable-gpu --dump-dom https://www.chromestatus.com

This works for me on RHEL 7.4 with:

$ rpm -qa chromium
chromium-59.0.3071.115-3.el7.x86_64

I also tried the official Chrome RPM packages and they work as well (just replace chromium-browser with google-chrome)..

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.

Ray Kim

unread,
Jun 6, 2018, 9:29:19 PM6/6/18
to Chromium-dev, lambros...@chromium.org, ofer...@gmail.com, skyo...@chromium.org
I tried the: 
$ chromium-browser --headless --disable-gpu --dump-dom https://www.chromestatus.com

but am getting this following error: 
[0606/103737.242533:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context.
Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf
[0606/103737.991950:ERROR:gl_implementation.cc(292)] Failed to load /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[0606/103737.994392:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0606/103737.995079:ERROR:service_manager_context.cc(252)] Attempting to run unsupported native service: /usr/lib6.4/chromium-browser/content_gpu.service

along with the html document. Is there any article that explains how to set up chromium-browser correctly ?
Reply all
Reply to author
Forward
0 new messages