How To Take A Screenshot Of Your Login Screen

Want to support HowtoForge? Become a subscriber!
Submitted by falko (Contact Author) (Forums) on Wed, 2011-07-27 08:33. :: Linux | Desktop

How To Take A Screenshot Of Your Login Screen

Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Follow me on Twitter
Last edited 07/18/2011

Normally you use a screenshot tool to take screenshots of your Linux desktop. Unfortunately, this doesn't work if you want to take a screenshot of your login prompt. This tutorial explains how you can take a screenshot of your Linux desktop login screen nevertheless.

I do not issue any guarantee that this will work for you!


1 Find Out The Virtual Terminal (VT) Of The Login Screen

First, log out of your desktop session so that you get to the login screen:

Now press CTRL + ALT + F1 to get to a command prompt:

While you are at the command prompt, type CTRL + ALT + F8 or CTRL + ALT + F7 to get back to the login screen - usually it is at CTRL + ALT + F8 which means your VT is 8. (It is possible that it is located at another VT - if you don't find it at 7 or 8, please try your other F keys).


2 Taking The Screenshot

Now that you know the number of the VT of the login screen, go back to the command prompt (CTRL + ALT + F1) and log in. We need to have the packages imagemagick and xnest installed; on Ubuntu, we can install them as follows:

sudo apt-get install imagemagick xnest

Now make sure you have root privileges - on Ubuntu you can achieve this by typing

sudo su

We can now take the screenshot with this command:

chvt 8; sleep 5; XAUTHORITY=/var/gdm/:0.Xauth DISPLAY=:0.0 import -window root /tmp/gdm-login-shot.png

Make sure you use the correct VT of the login screen in the chvt command (if your VT is 7, use chvt 7; instead).

This command will switch to your login screen automatically and take a screenshot. Log into your desktop and open a file browser. You should find your login screenshot in /tmp/gdm-login-shot.png.

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Sat, 2012-07-07 20:01.

Hey, i use ubuntu 12.04, and get the following error :

No protocol specified
No protocol specified
import: unable to open X server `:0.0' @ error/import.c/ImportImageCommand/366

 Could you please help me out with this?

Submitted by Anonymous (not registered) on Sun, 2011-07-31 23:09.
This is what I was looking for when I wrote my article about switching between Unity and GNOME.
Submitted by istok (not registered) on Sun, 2011-07-31 01:05.

i know ubuntu users who take photos of their login screen with their phone cameras.

true story.




Submitted by An Arch Guy (not registered) on Thu, 2011-07-28 13:06.
Save all the trouble. simply install SLiM. Pressing F11 gives you a screenshot of the login screen.
Submitted by Anonymous (not registered) on Fri, 2011-07-29 20:47.
Sorry, I fail to see how installing an entirely new Login Manager is "saving all the trouble".
Submitted by borderamigos (not registered) on Fri, 2011-07-29 16:34.
On my Debian box I just press PrtScrn and it does a screen capture.