Add ‘Hibernate’ Option in Power Menu in Ubuntu 18.04

May 4, 2018 — 10 Comments

This quick tutorial is going to show you how to enable hibernate option in the top-right corner power menu in Ubuntu 18.04. So you’ll get a similar menu as the picture shows:

Test if hibernate works

First of first, you have to make sure hibernate works in command line.

1. Open terminal via Ctrl+Alt+T or by searching for ‘terminal’ from app launcher. When it opens, run command:

sudo systemctl hibernate

Please SAVE all of your work before hitting enter, in case something goes wrong and your open applications and documents cannot be recovered.

2. After you computer turns off, switch it back on. Did your open applications re-open?

If hibernate doesn’t work, take a look at this question on askubuntu.

Enable Hibernate in Menus

If hibernate works in command line, continue enable it in the menus via following steps.

1. Open terminal (Ctrl+Alt+T) and run command to create a configuration file:

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

When the file opens, paste following content and save it.

[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;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes

2. Restart your computer and click the link to install the gnome extension: Hibernate Status Button.

For those who never installed a gnome extension, see this how to tutorial for details.

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

10 responses to Add ‘Hibernate’ Option in Power Menu in Ubuntu 18.04

  1. Great job Ji m, you are the only one I found telling to install this gnome extension ;-)

  2. hibernate was enabled in 17.10 using this procedure but stopped working after upgrade to 18.04. fixed by adding resume=UUID={uuid of swap partition: see /etc/fstab} kernel param

  3. I was able to run `sudo systemctl hibernate`, but everything were closed after turning on it. Any idea? My laptop is Levono ideapad 320

  4. it does like hibernate/restart on my laptop
    computer turns off but turns on again automatically (my software’s doesn’t close and they are open)
    my laptop is lenovo z500

  5. I also had to edit /etc/default/grub adding a resume=UUID parameter like this:

    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash resume=UUID=XXX-XXX-XXX-XXX-XXX

    where XXX-XXX-XXX-XXX-XXX is my system swap UUID. Then do an update-grub.

    • Works like a charm when using the grub modification. Thanks for the hint!
      (minor: You forgot the trailing ” though :-).

    • This seems to do the trick for me. Using an ASUS Zenbook UX430 with 8GB RAM and Intel i7.

    • Didn’t work for me in 18.04 for some reason. My swap file is located in `/swapfile`, there were a couple other partitions on my laptop (I use dual boot w/ Win10). I’ve tried all of them one by one in the `resume=UUID=…` line but to no avail. The hibernation command just turned off the PC and that was it.

  6. The short solution for me was to press ALT when the shutdown window was open and a pause button appears which puts the machine into hibernate. But sudo systemctl hibernate was not working.

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> 

*