8

Since I attached an external monitor to my laptop I'm no longer able to login when resuming from suspend. LightDM appears on both screens and shows my name in the login box, but the password field is not visible and entering the password anyway has no effect.

The machine is still running, and I can access it by SSH or an alternative shell (with ctrl-alt and function keys), but I can't get back to my previous Unity session.

Logging out and in again without suspending works correctly.

The laptop is a Dell Precision M6700 with an nVidia Quadro K4000M and the external monitor is connected via DisplayPort 1.2. The OS is Ubuntu 16.04 and the problem occurs with both the latest nVidia drivers and the Nouveau display driver.

What can I do to fix LightDM?

3 Answers3

2

Here is a workaround that uses the idea from Malith's answer, but automates a few steps, let me know if it works for you, and if not, I have some other ideas that may work.

Create a file named /etc/systemd/system/suspend-workaround.service, with the following content:

[Unit]
Description=suspend lightdm workaround
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/chvt 1
ExecStop=/bin/chvt 7

[Install]
WantedBy=sleep.target

Type the following on a terminal to reload systemd files and enable the unit above:

sudo systemctl enable suspend-workaround.service
sudo systemctl daemon-reload

Try to suspend and report your results.

EDIT: If the above unlocks your session (it shouldn't), you can make your session lock post resume, by replacing the ExecStop=/bin/chvt 7 with ExecStop=/bin/chvt 7 ; /bin/loginctl lock-sessions.

You can also disable session locking on system settings, and force it to lock post resume using a systemd script like the one above, by calling /bin/loginctl lock-sessions and leaving all the chvt stuff out.

Daniel
  • 558
1

When you needed to suspend, do it using the shell opened by Ctrl + Alt + F2 login to that shell using your username and password. Then type sudo pm-suspend to suspend the machine. (If not, try installing pm-utils using sudo apt-get install pm-utils) To resume, press any key and you will see the last shell window. Now you can press Ctrl + Alt + F7 to get your Unity session.

amc
  • 7,292
Malith
  • 111
0

I've been frustrated by this and found a solution that worked just now. I don't know if it will work reliably. I'm on Ubuntu 14.04 but it apparently happens on later versions also.

Use cntrl-alt-f1 to get to an alternate console. Login as normal (doesn't need to be root). Use ps -aef and grep to find compiz. Then kill compiz with "kill -9 ". Be sure to enter compiz's pid not compiz's parent's pid (ppid). The "top" command can help you find the right process and k (for kill) can be used to do the work.

Go back to cntrl-alt-f7 and the screen flickers, redraws, etc (like when window manager gives up windows, dropping decorations, etc.). Then it displayed the greeter UI with my username and (Yes!) a Password text entry box. I typed my password and got back to my desktop. It looked a bit odd, and it started up a new instance of compiz without me doing that myself. I examined each window, saving work where needed, and exited each window. Finally all the windows are closed and I made whatever notes I needed. Then I did a restart of the linux system.

After reboot I see the normal greeting page with my user name AND the password text entry box. Yea!