How to Enable Hibernate in Ubuntu 17.10

October 15, 2017 — 3 Comments

The hibernate functionality is disabled in Ubuntu by default because it might not work on some machines. For those who want to re-enable the feature, here’s how to do it in Ubuntu 17.10.

1. Test if hibernate works on your machine.

Open terminal either via Ctrl+Alt+T keyboard shortcut or by searching ‘terminal’ from application launcher. When it opens, run command:

sudo apt install pm-utils && 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 the command 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 both values of ResultActive to yes.

Save the changes by pressing Ctrl+X and then typing y and finally hitting Enter.

To make Hibernate working for multiple users, you can add following lines into the configuration file:

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

And for some machines you may replace the command in step 2, in case it doesn’t work, with following one:

sudo nano /etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Press power button to hibernate:

After enabled the hibernate functionality, you can launch Settings from application tool. In the ‘Power’ settings, you are able to set ‘Hibernate’ when the power button is pressed.

Hibernate when laptop lid is closed:

You can also make your laptop automatically hibernate when the lid is closed.

To do so, open terminal (Ctrl+Alt+T) and run command to edit the logind.conf file:

xhost +local: && sudo gedit /etc/systemd/logind.conf

When it opens, change the line #HandleLidSwitch=suspend into HandleLidSwitch=hibernate.

Tip, you can replace the value of HandleLidSwitch to poweroff, ignore for other lid closed actions.

To apply all the changes, restart your computer.

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to ubuntuhandbook1@gmail.com

3 responses to How to Enable Hibernate in Ubuntu 17.10

  1. The swap partition is larger than available RAM, but s2disk does not recognize it. The swap partition is recognized by swapon -s, though.

  2. Thanks works Perfectly

  3. Like a charm. Only missing how to add hibernate option into the shutdown gnome button. Currently only options Cancel, Restart and Power Off are present.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*