Running Xvfb with firefox

I´m trying to run headlesless firefox with this command sudo xvfb-run -a firefox so i get this error

(process:9000): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Xlib: extension "RANDR" missing on display ":113".

I have searched to solve this problem referring to this link

Xvfb :113 -screen 0 1024x768x24 -extension RANDR &

when I rerun the same commande i got Xlib: extension "RANDR" missing on display ":114". and so on

How could I solve this problem? Any solution will be grateful

2 Answers

Run xvfb-run as:

xvfb-run -a -s "-screen 0 1024x768x24" firefox

Running Xvfb, and then xvfb-run will not cause the latter incarnation to run on the display of the former Xvfb. You'd need to set the DISPLAY variable for the app you wish to run on that other display, if you wish to run Xvfb by hand.

You do not need the RANDR extension for Firefox anyway. It doesn't need to resize the display while running.

4

If you want to explicitly set your display number use something like:

xvfb-run -n 113 --server-args='-screen 0, 1024x768x24' firefox > /dev/null &

This way you can do things based on that known number later, like say x11grab it or add another program to that display.

The RANDR extention is installed by default if you are using the latest packages. i.e. on Ubuntu Server 16.04:

$sudo apt-get install xvfb
$Xvfb :99 -screen 0 1024x768x24 > /dev/null &
$ xdpyinfo -display :99 | grep "number of extensions" -A 25
number of extensions: 25 BIG-REQUESTS Composite DAMAGE DOUBLE-BUFFER DPMS GLX Generic Event Extension MIT-SCREEN-SAVER MIT-SHM Present **** RANDR **** RECORD RENDER SECURITY SGI-GLX SHAPE SYNC X-Resource XC-MISC XFIXES XINERAMA XInputExtension XKEYBOARD XTEST XVideo

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like