how to add the missing RANDR extension
Asked Answered
L

3

33

I have setup the xvfb server on my headless server and when I m running the DISPLAY=:99 firefox I am getting this exception missing RANDR extension

Many of them said to disable some xinerna from the xorg.conf file but this file is not getting created in my case.

So I am searching for how to add the missing RANDR extension.

Lunette answered 28/9, 2012 at 16:37 Comment(0)
J
17

First off, Xvfb doesn't read configuration from xorg.conf. Xvfb is a variant of the KDrive X servers and like all members of that family gets its configuration from the command line.

It is true that XRandR and Xinerama are mutually exclusive, but in the case of Xvfb there's no Xinerama in the first place. You can enable the XRandR extension by starting Xvfb using at least the following command line options

Xvfb +extension RANDR [further options]
Joell answered 2/10, 2012 at 15:34 Comment(9)
At least on raspbian, there seems to be no RANDR support from Xvfb. Is there an alternative solution?Lukash
@Black: You can always build from source yourself with your own, custom configuration. I strongly suggest to install the toolchain on the Raspbian system itself and compile there. Luckily Xvfb is not very complex and a manageable task for a R-Pi; you definitely don't want to go through the struggles of setting up a compatible cross-compilation toolchain, if you can avoid it.Joell
@DenisShevchenko: what's the result of executing strings $(which Xvfb) | grep -i randrJoell
@Joell Empty result. In fact, I use xvfb-run.Astonish
@DenisShevchenko: xvfb-run is not the same as Xvfb. You have to pass the parameters to Xvfb and it may very well be that xvfb-run drops the additional command line arguments.Joell
@Joell I can use xvfb-run with additional parameters for Xvfb. For example, when I run this xvfb-run -n 122 -s '+extension RANDR' firefox http://www.google.com - I see Xvfb process Xvfb :122 -xkbdir /nix/store/izm517h2yl5qx67hpb6byw8cqr7pwkjh-xkeyboard-config-2.15/etc/X11/xkb +extension RANDR -nolisten tcp. So +extension RANDR doesn't help...Astonish
@DenisShevchenko: Okay. But you should still test if Xvfb itself has been built with RANDR support. Anyway, the result of the command, as I asked you to run, comes out empty, then your particular build of Xvfb has been built without support for RANDR. The only solution is to get a build with this supported. Either by building it yourself, or finding a suitable binary.Joell
@DenisShevchenko: I am using raspbian as well, and running strings $(which Xvfb) | grep -i randr does show matches. Yet I still get Xlib: extension "RANDR" missing on display ":1", Any pointers on compiling from source?Earn
@BrantSterlingWedel: Even if RANDR support has been built into Xvfb it's not enabled by default. See my original answer for how to enable.Joell
O
25

I am seeing this error message when I run Firefox headless through selenium using xvfb. It turns out that the message was a red herring for me. The message is only a warning, not an error. It is not why Firefox was not starting correctly.

The reason that Firefox was not starting for me was that it had been updated to a version that was no longer compatible with the Selenium drivers that I was using. I upgraded the selenium drivers to the latest and Firefox starts up fine again (even with this warning message about RANDR).

New releases of Firefox are often only compatible with one or two versions of Selenium. Occasionally Firefox is released with NO compatible version of Selenium. When that happens, it may take a week or two for a new version of Selenium to get released. Because of this, I now keep a version of Firefox that is known to work with the version of Selenium that I have installed. In addition to the version of Firefox that is kept up to date by my package manager, I have a version installed in /opt/ (eg /opt/firefox31/). The Selenium Java API takes an argument for the location of the Firefox binary to be used. The downside is that older versions of Firefox have known security vulnerabilities and shouldn't be used with untrusted content.

Orgell answered 4/4, 2014 at 17:36 Comment(7)
you saved me a couple of hours :)Claudette
You can pass the binary location you like when loading the webdriver. That includes a custom install, a portable one or whatever you point to.Ouch
well, what pair are you using now? 4.43 with 29?Carnauba
I'm currently running Firefox 31 with Selenium 2.43.1 (Java drivers).Orgell
cool story, but this has nothing to do with the question askedFrangipane
@CoreyGoldberg That error message in the question is the most prominent thing you see when Firefox Selenium fails to start. My guess is that even the person that asked the question was just barking up the wrong tree. They didn't need to add randr extensions, but there was no other error or warning messages for them to zero in on.Orgell
@StephenOstermiller the question never even mentions selenium. Guessing about possible solutions based on details that weren't provided is not the same thing as answering a question that was asked. There's a chance your solution may help the OP user, but that's not at all relevant. SO is a Q&A site, not an interactive debugging and troubleshooting service.Frangipane
J
17

First off, Xvfb doesn't read configuration from xorg.conf. Xvfb is a variant of the KDrive X servers and like all members of that family gets its configuration from the command line.

It is true that XRandR and Xinerama are mutually exclusive, but in the case of Xvfb there's no Xinerama in the first place. You can enable the XRandR extension by starting Xvfb using at least the following command line options

Xvfb +extension RANDR [further options]
Joell answered 2/10, 2012 at 15:34 Comment(9)
At least on raspbian, there seems to be no RANDR support from Xvfb. Is there an alternative solution?Lukash
@Black: You can always build from source yourself with your own, custom configuration. I strongly suggest to install the toolchain on the Raspbian system itself and compile there. Luckily Xvfb is not very complex and a manageable task for a R-Pi; you definitely don't want to go through the struggles of setting up a compatible cross-compilation toolchain, if you can avoid it.Joell
@DenisShevchenko: what's the result of executing strings $(which Xvfb) | grep -i randrJoell
@Joell Empty result. In fact, I use xvfb-run.Astonish
@DenisShevchenko: xvfb-run is not the same as Xvfb. You have to pass the parameters to Xvfb and it may very well be that xvfb-run drops the additional command line arguments.Joell
@Joell I can use xvfb-run with additional parameters for Xvfb. For example, when I run this xvfb-run -n 122 -s '+extension RANDR' firefox http://www.google.com - I see Xvfb process Xvfb :122 -xkbdir /nix/store/izm517h2yl5qx67hpb6byw8cqr7pwkjh-xkeyboard-config-2.15/etc/X11/xkb +extension RANDR -nolisten tcp. So +extension RANDR doesn't help...Astonish
@DenisShevchenko: Okay. But you should still test if Xvfb itself has been built with RANDR support. Anyway, the result of the command, as I asked you to run, comes out empty, then your particular build of Xvfb has been built without support for RANDR. The only solution is to get a build with this supported. Either by building it yourself, or finding a suitable binary.Joell
@DenisShevchenko: I am using raspbian as well, and running strings $(which Xvfb) | grep -i randr does show matches. Yet I still get Xlib: extension "RANDR" missing on display ":1", Any pointers on compiling from source?Earn
@BrantSterlingWedel: Even if RANDR support has been built into Xvfb it's not enabled by default. See my original answer for how to enable.Joell
K
2

I had the same problem with Firefox 30 + Selenium 2.49 + Ubuntu 15.04.

It worked fine with Ubuntu 14 but after upgrade to 15.04 I got same RANDR warning and problem at starting Firefox using Xfvb.

After adding +extension RANDR it worked again.

$ vim /etc/init/xvfb.conf

#!upstart
description "Xvfb Server as a daemon"

start on filesystem and started networking
stop on shutdown

respawn

env XVFB=/usr/bin/Xvfb
env XVFBARGS=":10 -screen 1 1024x768x24 -ac +extension GLX +extension RANDR +render -noreset"
env PIDFILE=/var/run/xvfb.pid

exec start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --exec $XVFB -- $XVFBARGS >> /var/log/xvfb.log 2>&1
Kanaka answered 6/4, 2016 at 12:43 Comment(1)
Worked on Ubuntu 14.04 or 14.10? cause I am trying on 14.04 and I am getting the missing RANDR extension message when trying to run Chromium-browser ... ok that might be Chromium issueLactary

© 2022 - 2024 — McMap. All rights reserved.