DEV Community

Stack All Flow
Stack All Flow

Posted on • Originally published at stackallflow.com on

How to enable hibernation in Ubuntu?

hibernatepower-management

In Ubuntu 12.04 and newer, hibernation has been disabled by default in policykit. How can I enable this back?

Accepted Answer

If this answer does not work in Ubuntu 13.10, see here for an alternative answer


Hibernation was disabled on 12.04 for machines that are not certified with Ubuntu.

In order to enable hibernation you need to test whether it works correctly by running sudo pm-hibernate in a terminal. The system will try to hibernate. If you are able to start the system again then you are more or less safe to add an override.

To do so, start editing:

sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Enter fullscreen mode Exit fullscreen mode

Fill it with this:

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

Enter fullscreen mode Exit fullscreen mode

Or in 14.04 and later:

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

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

Enter fullscreen mode Exit fullscreen mode

Save by pressing CtrlO then enter and then exit nano by pressing CtrlX.

Restart and hibernation is back!

Or run killall unity-panel-service to just reset the menu.

Some users will then need to run sudo update-grub to get the hibernate option to be available in the power menu. Some users may also have to at least log out then log in to get it to appear in the (upper right) power menu.

The post How to enable hibernation in Ubuntu? appeared first on Stack All Flow.

Top comments (0)