I was following along this tutorial to configure Xvfb to run firefox headlessly.
http://www.alittlemadness.com/2008/03/05/running-selenium-headless/
I'm running these commands in a docker image (ubuntu:latest) currently to see if I can set up my configuration properly before creating a container.
I'm getting stuck on this command being run:
Xvfb :99 -ac
I get these errors after running the command:
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX
[dix] Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/Type1, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi, removing from list!
I found a blog with some google searching that mentions these errors here:
http://veeraramkumar.blogspot.com/
I ran these commands:
aptitude install x11-xkb-utils
aptitude install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
aptitude install xserver-xorg-core
However the command:
aptitude install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
gives this error:
No candidate version found for xfonts-100dpi
No candidate version found for xfonts-75dpi
No candidate version found for xfonts-cyrillic
No candidate version found for xfonts-100dpi
No candidate version found for xfonts-75dpi
No candidate version found for xfonts-cyrillic
The following NEW packages will be installed:
xfonts-scalable
then it successfully installs xfonts-scalable. Now when I rerun the command:
Xvfb :99 -ac
I only get these errors (down to 5 errors):
[dix] Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi, removing from list!
I tried to use apt-get to find the packages xfonts-100dpi xfonts-75dpi xfonts-cyrillic but it also states that the packages have no installation candidate either. What proper packages do I need to install to correctly configure Xvfb to run firefox headlessly? Or is there something else I should be doing?
Thanks.
Running headless tests without XvfbChromium based browsers and Firefox can spawn without Xvfb when run via the --headless flag. If you're testing against either of those browsers using the --browser flag, you can opt out of Cypress spawning an X11 server by setting the environment variable ELECTRON_RUN_AS_NODE=1 .
Xvfb (short for X virtual framebuffer) is an in-memory display server for UNIX-like operating system (e.g., Linux). It enables you to run graphical applications without a display (e.g., browser tests on a CI server) while also having the ability to take screenshots.
After digging around at other similar questions I was able to get Xvfb to properly work with the following commands once I restarted my ubuntu docker image.
apt-get update
apt-get install -y xorg xvfb firefox dbus-x11 xfonts-100dpi xfonts-75dpi xfonts-cyrillic
Previously I was missing the xorg and dbus-x11 packages after updating.
sudo apt-get install xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11
Restart not needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With