Trying to configure Xvfb to run Firefox headlessly
Asked Answered
C

2

5

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.

Contentment answered 31/12, 2015 at 15:33 Comment(0)
C
11

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.

Contentment answered 31/12, 2015 at 17:0 Comment(0)
R
3
sudo apt-get install xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11

Restart not needed.

Rundown answered 24/5, 2016 at 20:33 Comment(1)
that's true, I did not need to restart my image. Only needed to use the correct commands.Contentment

© 2022 - 2024 — McMap. All rights reserved.