How to Capture the Login Screen in Ubuntu 16.10

LightDM Test Mode

For those who want to capture your Ubuntu Unity login screen and share the screenshots with your friends, the LighDM display manager offers a test mode that allows to run a windowed login screen in Ubuntu desktop as unprivileged user.

So you can easily capture this windowed login screen using a screenshot tool or video recorder.

Run LightDM test mode:

1. First open terminal (Ctrl+Alt+T) and run command to install Xserver, a display server implementing the X11 display server protocol:

sudo apt-get install xserver-xephyr

Type in your password when it asks and hit Enter.

2. Then run command:

lightdm --test-mode

A windowed login screen should pop-up, just like the top picture shows.

For those who have changed the Login appearances, e.g., remove white dots, change login background different to user’s desktop background, change background logo, running –test-mode with normal user lacks permission to display the ‘real’ login screen.

To fix it, open terminal and run the commands below one by one:

  1. First run command to get root permission:

    sudo -i

  2. Then allow user lightdm to create a connection to the X server:

    xhost +SI:localuser:lightdm

  3. Now switch to user lightdm in the terminal window:

    su lightdm -s /bin/bash

Finally run lightdm –test-mode in the terminal to run test mode via lightdm privilege:

lightdm-privilege

And record or take screenshots of the windowed login screen and enjoy!