0

For some reason, the lock screen has ceased to appear recently. I'm using 16.04, with the default Unity environment.

This problem seems to have occurred to others before, but none of those solutions work (for instance, here and here).

The Lock Super+L option appears in the system menu as normal, but it doesn't do anything (nor does hitting those keys). The system is set to show the lock screen upon waking up from suspend, but it no longer does so, it just immediately shows the desktop (well, a black box and the desktop, see the picture below).

Lock is on in System settings -> Brightness & Lock, as is Require my password when waking from suspend.

gsettings get org.gnome.desktop.lockdown disable-lock-screen is set to false.

gsettings get org.gnome.desktop.screensaver ubuntu-lock-on-suspend is set to true.

Also, this command always used to lock the screen, but now it does nothing: qdbus com.canonical.Unity /com/canonical/Unity/Session com.canonical.Unity.Session.Lock

I don't remember changing any configuration settings, nor have any relevant (I think) packages updated of late, which would imply a bug, but maybe I'm wrong on that. I do have x-screensaver installed, but it has worked fine for years.

Edit: the output of apt policy lightdm reads:

lightdm:
Installed: 1.18.3-0ubuntu1.1
Candidate: 1.18.3-0ubuntu1.1
Version table:
*** 1.18.3-0ubuntu1.1 500
    500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
    500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
    100 /var/lib/dpkg/status
    1.18.1-0ubuntu1 500
    500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

I should also add that when the computer wakes from suspend, there's a black area that appears, which only becomes clear when a opening a window or something refreshes the screen.Ugly Disabling asking for password when waking from suspend in the system settings prevents the black screen from showing up, but, of course, that doesn't give me a screen lock.

Fern Moss
  • 8,785
  • I'm not 100% if they are related, but it sounds like a light-dm issue (the login screen). Can you try this command and let me know what it says : apt policy lightdm – jwcooper Apr 26 '19 at 19:46
  • @jwcooper Edited my question to include that output. – Fern Moss Apr 26 '19 at 23:06
  • Looks like lightdm is installed. Another user had some luck creating a new user on the system and that user was able to use the lock screen. If you want, you can try that and if it works we can work from there. Other than that, i'm not really sure. – jwcooper Apr 26 '19 at 23:11
  • Also, when was the last time you updated the system. There was a bug reported similar to this launchpad that has been fixed. You can try sudo apt-get update && sudo apt-get dist-upgrade – jwcooper Apr 26 '19 at 23:14
  • @jwcooper Hmm, dist-upgrade did nothing, but the lock screen works with the new user. At least I know it's not a missing package then. – Fern Moss Apr 26 '19 at 23:58
  • Alright, so we're making progress. Heres the link where I found that answer: https://www.linuxquestions.org/questions/ubuntu-63/ubuntu-16-04-lock-screen-problem-4175601800/ Basically, the resolution they came to was to create a new user and then copy over the home and config folders from themselves into that new user. Obviously, that's not a great solution and I hate even proposing it, however, I havent found another solution yet. The choice is yours whether or not you want to do that or wait for me or someone else to come up with something better. – jwcooper Apr 27 '19 at 01:32
  • So here's what I found that makes sense. You may have added yourself somehow to the passwordless login group. Lets try this command from the account you want the lock screen to work on: sudo gpasswd -d nopasswdlogin Change username to you username and then try to suspend and come back and see what happens. – jwcooper Apr 27 '19 at 01:39
  • No luck with gpasswd -d. The linuxquestions.org thread seems to be sort of a similar problem, but not quite. Switching user names completing would be... a pain considering how much stuff I have customized. Hopefully something can be figured out. – Fern Moss Apr 27 '19 at 05:53
  • @jwcooper Ok, the lack of a lock screen was too annoying, so I created a new user (then another one with the same name as my old one, ha). At least most of my settings migrated just fine. If you want to make an answer like "your system is screwed, create a new user account", I'll make it as the solution. There must be some bug somewhere since we covered all possible config problems, but who knows. Now everything is working fine with the new account. – Fern Moss Apr 30 '19 at 00:36
  • Maybe run diff command between new user and broken user? Not sure if it's worth the time and effort though... – WinEunuuchs2Unix Apr 30 '19 at 02:52

1 Answers1

1

The only answer I could come up with was based on this answer: Create New user to Restore missing lock screen

Basically, It states that you need to create a new user and migrate your home folder data to that user. It's not the best solution, but it seems to be the only working one I could find.

There was one more answer that I included in the comments above that you may want to check. You would need to check the passwordless login group and see if your username had been inadvertently added to that group. If it had, you would need to remove it with sudo gpasswd -d <USERNAME> nopasswdlogin. Also had you check lightdm and a few other things, but those solutions didnt seem to lead anywhere. Anyone else facing this problem should probably still start there though.

jwcooper
  • 169