The Hibernate option is available in Beta and Alpha releases of Ubuntu 14.10, but the final release removed this option in the Unity desktop.
This quick guide is going to show you how to re-enable this feature so that you can hibernate your machine from the shutdown menu (top-right gear button).
1. Before getting started, you may run command below in terminal (Ctrl+Alt+T) to test if hibernate works in your case:
sudo pm-hibernate
After you computer turns off, switch it back on. Did your open applications re-open? If hibernate doesn’t work, check if your swap partition is at least as large as your available RAM.
2. To re-enable hibernate, run command below to edit the configuration file:
sudo nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
When the file opens in the terminal window, scroll down to find out the section started as:
“[Disable hibernate by default in upower]” and “[Disable hibernate by default in logind]”
Change the value of ResultActive to yes in both.
3. To save the changes, press Ctrl+X and type y and finally hit Enter.
When everything’s done, restart your computer.
Tips:
1. If previous steps do not work for you, replace the command in step 2 with:
sudo nano /etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
2. Thanks to Cruz, you can add below lines into the configuration file to make Hibernate work for multiple users:
[Re-enable hibernate for multiple users by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate-multiple-sessions
ResultActive=yes
3. If you want to hibernate your laptop when lid is closed, run command to edit the configuration file:
sudo nano /etc/systemd/logind.conf
Add HandleLidSwitch=hibernate as a new line into the end and save the file. It will work at next boot.
Does it work if the swap is encrypted?
Also hibernate on lid close works over /etc/acpi/actions/lm_lid.sh. Add in it path to hibernate script)
This didn’t work for me. Might be that my lenovo can’t handle the hibernate command from the kernel.
Worked for me, but for some reason, when I turn it on, I loose my wifi. I’ll keep trying any way.
Hi,
I followed the steps and working fine in Ubuntu 16.0 LTS version
Thanks