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