5

I´m trying to run headlesless firefox with this command sudo xvfb-run -a firefox http://google.com 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 https://stackoverflow.com/questions/17944234/xlib-extension-randr-missing-on-display-21-trying-to-run-headless-googl

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

Bessa
  • 85

2 Answers2

3

Run xvfb-run as:

xvfb-run -a -s "-screen 0 1024x768x24" firefox http://google.com

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.

dobey
  • 41,650
0

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

xvfb-run -n 113 --server-args='-screen 0, 1024x768x24' firefox http://google.com > /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