Ubuntu: Enabling Hibernation

Out of the box Ubuntu shows the “Suspend” option in the system menu (rightmost option on the menu bar) but it doesn’t offer an option to hibernate the system.

Screenshot from 2016-02-04 19-02-32

The difference is that a suspended system enters a low power state but still needs energy to keep the content of DRAM. If you unplug a suspended system the unsaved state will be lost and it will boot afresh when it’s turned back on.

In hibernation the system saves its memory content to disk and can be powered down completely without losing any application state. When it’s powered back on application windows open and they resume their operation.

Before enabling the hibernation option in the menu we can test if this functionality works. The following command will put the system in a hibernated state and turn it off.

ilya@lin1:~$ sudo pm-hibernate

When powered on the system should keep all the windows/applications open.

If this test was successful we can enable “Hibernate” option in the system menu by creating the following file.

root@lin1:~# cat /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

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

After rebooting the new option should be visible in the menu.

Screenshot from 2016-02-04 19-08-51

Source: How to Enable Hibernation in Ubuntu 14.04