How can I take a screenshot of the login screen?

Solution 1:

This blog might be helpful: http://ptspts.blogspot.com/2010/02/how-to-create-screen-shot-of-gdm-login.html

Install ImageMagick for the image file format conversion below:

sudo apt-get install imagemagick

Create a helper script:

echo 'DISPLAY=:0 XAUTHORITY=/var/lib/gdm/:0.Xauth xwd -root' >/tmp/shot.sh

Make sure your login screen is active (log out or reboot the machine, and wait until you see the login screen). Log in in text mode (by pressing Ctrl-Alt-F1), or using SSH. Create the screen shot by running

sudo bash /tmp/shot.sh >/tmp/shot.xwd

You can log in now (by pressing Ctrl-AltF7 first to get back to the GDM login screen). Convert the screen shot to JPEG and/or PNG:

convert -quality 50 /tmp/shot.xwd /tmp/shot.jpg
convert /tmp/shot.xwd /tmp/shot.png

View the screen shot in your favourite image viewer.

Solution 2:

For 11.10 and Lightdm and later

You can try running unity-greeter --test-mode in a terminal. It displays the login screen within the session. You can then take a screenshot of the login screen like you normally do with any other application.

enter image description here

Solution 3:

You can try this:

gnome-screenshot -d 10

you don't need to install any thing just enter the command and lock the screen, the screen will be shot within 10 seconds after the command is executed.

Even more .. the command will lock the screen , copy the screenshot to clipboard and unlock the screen again. All by it self.

gnome-screensaver-command -l && sleep 2 && gnome-screenshot -c && loginctl unlock-session

screenshot of Ubuntu lock screen

Solution 4:

Type this in a terminal:

dm-tool add-nested-seat --fullscreen

That's it! take a screenshot as usual

Press Alt + F4 to close the fullscreen window of your login screen

Solution 5:

For Ubuntu 14.04

The answers above did not work for me in Ubuntu 14.04 - I searched around and found this that works.

  1. Install ImageMagick

     sudo apt-get install imagemagick
    
  2. Create a file in your home directory named shot.sh preferably in your home folder and paste the following code inside it:

     chvt 7;
     sleep 5s;
     DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 xwd -root -out ~/screenshot.xwd;
     convert ~/screenshot.xwd ~/screenshot.png;
     rm ~/screenshot.xwd
    
  3. Make it executable

     sudo chmod +x shot.sh
    
  4. Logout of the system. Press Ctrl+Alt+F1 to go to the console (tty1) and login. Run the script using this command:

     sudo ./shot.sh
    

It will take you back to login screen graphical interface (chvt 7) and after five seconds it will take and save the screenshot in your home directory with a file name screenshot.png.


Here's mine:

enter image description here

Source: How to Take Screenshot of Login Screen in Ubuntu Linux