Why are my Xvfb screenshots black with traces of color (Ubuntu 16.04 LTS)
2
votes
1
answer
1751
views
I am running a headless Ubuntu 16.04 LTS in the Google Cloud. There is an application I need to run in the background that requires a GUI. I am trying to use Xvfb to allow the program to run, but as the program requires some GUI inputs, I also need to take screenshots of the screen to see what inputs are required.
However, I am having trouble taking screenshots. To test the process of taking a screenshot, I install and run firefox navigated to google. I take a screenshot two ways, using scrot and using imagemagick. Both ways results in a black image with hints of the google homepage in it (see attached picture). The colour and details prevents the use of the screenshot to interpret what is being shown. What is causing this lack of detail and how can I fix this?
The relevant commands are below:
sudo apt-get install xvfb xorg xserver-xorg scrot imagemagick
Xvfb :1 &
export DISPLAY=:1
DISPLAY=:1 firefox https://www.google.com &
DISPLAY=:1 scrot
DISPLAY=:1 import -window root tmp_screenshot.png

Asked by John Smith
(23 rep)
Mar 8, 2020, 03:38 PM
Last activity: Mar 29, 2020, 05:01 PM
Last activity: Mar 29, 2020, 05:01 PM