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
  • 1
  • 1
  • 8

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
  • 40,344
  • 5
  • 56
  • 98
  • what do you by I " need to set the DISPLAY variable for the app I wish to run on that other display, if I wish to run Xvfb by hand." – Bessa Nov 04 '15 at 08:10
  • I mean, simply running Xvfb by hand doesn't set the DISPLAY variable, so anything you run won't find the display, unless DISPLAY is set to the value for the display Xvfb was told to run on. `xvfb-run -a` sets up a new display automatically, and tells whatever process you're passing to it, to use that display. – dobey Nov 04 '15 at 19:50
  • I was running this command on my terminal `xvfb-run -a -s "-screen 0 1024x768x24" firefox http://google.com` but i have another error Xlib: extension "RANDR" missing on display ":99". console.error: Could not read session file Message: Unix error 13 during operation open on file /.mozilla/firefox/zcu.default/sessionstore-backups/recovery.js (Permission denied) – Bessa Nov 05 '15 at 08:56
  • when I run this command `$ls -al /.mozilla/firefox/zcu.default/sessionstore-backups/recovery.js` this is the output `-rw-------` – Bessa Nov 05 '15 at 09:10
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
TomSchober
  • 504
  • 1
  • 5
  • 15