How To Take A Screenshot Of Your Login Screen

Version 1.0
Author: Falko Timme
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.

Share this page:

6 Comment(s)

Add comment

Comments

From: An Arch Guy at: 2011-07-28 12:06:02

Save all the trouble. simply install SLiM. Pressing F11 gives you a screenshot of the login screen.

From: borderamigos at: 2011-07-29 15:34:05

On my Debian box I just press PrtScrn and it does a screen capture.

From: Anonymous at: 2011-07-29 19:47:42

Sorry, I fail to see how installing an entirely new Login Manager is "saving all the trouble".

From: istok at: 2011-07-31 00:05:16

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

true story.

 

 

 

From: Anonymous at: 2011-07-31 22:09:40

This is what I was looking for when I wrote my article about switching between Unity and GNOME. http://linuxblog.darkduck.com/2011/05/4-terribly-easy-steps-to-move-away-from.html

From: Anonymous at: 2012-07-07 19:01:27

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?