Ubuntu

Fix laptop doesn't suspend after the lid is closed in Ubuntu 16.04

Fix laptop doesn't suspend after the lid is closed in Ubuntu 16.04

Many users of Ubuntu 16.04 users are reporting problems with laptop not going to suspend/sleep mode when the lid is closed. This is a confirmed bug in Ubuntu 16.04, and developers are working on a permanent fix to this problem.

It seems like the problem may be due to hardware-kernel compatibility in most cases, and for some, it is due to missing proprietary drivers. For now, the reasons are still vague, and the root cause is not yet determined as per the Ubuntu bug thread.

But don't worry, there is a workaround to get through this problem by modifying the logind.conf file. Let's get started. Note that it is important first to check if you have enabled the suspend settings for the laptop lid close setting in the 'Power' options.

Fix Laptop doesn't Suspend after the lid is closed

Go to 'Power' settings and select 'Suspend' for the item “When the lid is closed”. You can do it for only the Battery power mode or also for 'when plugged' in option.

Power Settings

Once you have confirmed the setting is right, and still, Ubuntu doesn't go to suspend when the laptop lid is closed, try this below workaround:

Workaround to make Ubuntu suspend when the laptop lid is closed

This fix is confirmed to be working on Ubuntu 16.04, 16.04, 17.04, and 17.10. As per the below comments, few users are reporting it not to be working on Ubuntu 18.04.

Step 1: Launch 'Terminal' and run the following command:

sudo vi /etc/systemd/logind.conf

Step 2: You should see the following content in the file.

#NAutoVTs=6 #ReserveVT=6 #KillUserProcesses=no #KillOnlyUsers= #KillExcludeUsers=root #InhibitDelayMaxSec=5 #HandlePowerKey=poweroff #HandleSuspendKey=suspend #HandleHibernateKey=hibernate #HandleLidSwitch=suspend #HandleLidSwitchDocked=ignore #PowerKeyIgnoreInhibited=no #SuspendKeyIgnoreInhibited=no #HibernateKeyIgnoreInhibited=no #LidSwitchIgnoreInhibited=yes #HoldoffTimeoutSec=30s #IdleAction=ignore #IdleActionSec=30min #RuntimeDirectorySize=10% #RemoveIPC=yes #UserTasksMax=12288

Step 3: Carefully navigate and make sure the following lines are changed to look like shown below. If you have already changed the setting in the Power Settings as described above, some of the options should show “Suspend”. That's fine. I'm just mentioning it to make sure you have the right setting.

HandleSuspendKey=suspend HandleLidSwitch=suspend HandleLidSwitchDocked=suspend

Step 4. Save the file.

Step 5. Reboot your computer.

That's it. Try closing the lid and see if your Ubuntu PC suspends successfully.

Final Thoughts

Since this is a workaround and hardware dependent, this temporary fix might not work on all the Ubuntu PCs. Unfortunately, there is nothing more we can do apart from what is presented in this tutorial. We should wait and see when an official fix becomes available, but going by the status, the Ubuntu team seems like not making much progress on this issue. This is mainly because of the hardware configuration.

How to reverse Mouse and Touchpads scrolling direction in Windows 10
Mouse and Touchpads not only make computing easy but more efficient and less time-consuming. We cannot imagine a life without these devices, but still...
How to change Mouse pointer and cursor size, color & scheme on Windows 10
The mouse pointer and cursor in Windows 10 are very important aspects of the operating system. This can be said for other operating systems as well, s...
Ilmaiset ja avoimen lähdekoodin pelimoottorit Linux-pelien kehittämiseen
Tämä artikkeli kattaa luettelon ilmaisista ja avoimen lähdekoodin pelimoottoreista, joita voidaan käyttää 2D- ja 3D-pelien kehittämiseen Linuxissa. Tä...