Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to enable hibernation in Ubuntu

📅 2013-Mar-18 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ hibernation, ubuntu ⬩ 📚 Archive

It is truly surprising that Ubuntu ships with hibernation turned off. But, hibernation can be useful on notebooks where I would prefer to hibernate than to power off when the notebook runs completely out of battery.

Ubuntu 14.04

A few steps are needed to enable hibernation in Ubuntu:

$ sudo vim /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no

[Disable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=no

Change the value assigned to ResultActive in both section to yes.

Note: These steps do not enable the Hibernate option for when the laptop lid is closed. That option is not visible in the Power settings. If you use GNOME Tweak Tool, that option can be set. But, I found that my Thinkpad X201i would still not hibernate when the lid was closed. I still had to manually choose Hibernate from the Shutdown menu to put the laptop into hibernation.

Ubuntu 12.02

A few steps are needed to enable hibernation in Ubuntu:

Add these lines and save the file

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧