Ubuntu (and its derivatives – Xubuntu, Lubuntu, Kubuntu) normally come with hibernation disabled by default, mostly due to possible hardware compatibility issues.
Re-enabling it is not a simple thing to do, despite logic dictating the opposite.
Start by testing out whether or not your system is capable of hibernation. Save everything important and run pm-hibernate in a terminal. If it correctly hibernates and resumes, then it is safe to continue – otherwise, investigate what fails.
Next, edit sudo nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
and look for
[Disable hibernate by default in upower] [Disable hibernate by default in logind]
Change the ResultActive= from no to yes:
[Disable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Disable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key; ResultActive=yes
Save changes. The hibernation option should instantly become available in Xubuntu’s power menu. If it does not, double-check that you’ve edited correctly.
Hi, thanks for the tutorial.
After using it successfully on a machine, I’ve repeated the procedure on a second one, without performing the initial test for an oversight.
Had to restart the machine and it was giving errors on login and hibernation is not working.
Now I don’t see any errors, however I would like to deactivate the hibernation button and when I try editing the file com.ubuntu.desktop.pkla, the following message appears:
“The file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla is being modified (by root using nano 2.5.3, PID 13269). Continue?”
Any suggestions on how to bring it back to normal?
Thank you in advance —by the way on the first machine it works without a hic!
Thanks for taking the time to write this. Hibernate would not show up presumably because I want to use the proprietary NVIDIA drivers, but I did not want to resort to sleep mode because it draws a significant enough amount of power to cause my power supply unit to make the dreaded coil whine (which is inaudible under the noise of the fans under normal computer usage but super annoying when I’m trying to sleep.). Hibernate is a lot better!
thanks a bunch. it was such a pain to start the work when i reach home and start all the opened pages again. now this would be huge help.
Works well! Do you also know how to enable the option in Power Manager, so for a battery critical a hibernate option can be selected?