Enabling Hibernate Support in Ubuntu 14.04 LTS

In this article, I’ll show you how to enable hibernate support in Ubuntu 14.04 (“Trusty Tahr”) by making a “Hibernate” menu entry appear in Unity’s global system pulldown menu. The Ubuntu developers disabled this a couple of years ago because hibernate didn’t work reliably on all systems – proceed at your own risk!

Unity System Menu

Unity global system menu after enabling the Hibernate option.

Before changing any configuration, save your work, backup your data, then check if hibernation works on your system:

  $ sudo pm-hibernate

The system should go to sleep and wake up when you power it on again. If it doesn’t, you first have to fix it before proceeding. When I encountered hibernation problems in the past, it was due to bugs in graphics or network device drivers. Sometimes I was able to work around it by selecting a different driver, but there have been cases where I had to wait for a new kernel release.

If pm-hibernate worked, you can enable hibernate support by changing the configuration of the PolKit authorization framework. After a bit of searching, the following solution worked for me (note that the solution for Ubuntu versions before 13.10 is different!). As user root, create a file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla with the following content:

[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

Then run the following command to restart the session (or simply reboot):

  $ killall indicator-session-service

You should then see the Hibernate system menu item.

About these ads
This entry was posted in linux and tagged , . Bookmark the permalink.

11 Responses to Enabling Hibernate Support in Ubuntu 14.04 LTS

  1. Erik Stenlund-Gens says:

    Darn, the

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

    -part disables my wireless upon wakeup from hibernate (or at least that’s the pracitcal effect). Also, “hibernate” only pops up in the shut down-menu in the top right corner but not in the menu called for when the power button is pressed. Any ideas on this?

    Thanks and god morning!
    /Erik

    • Matthias says:

      Hi Erik,

      yes, I’ve experienced the disabled network effect *sometimes*. Does a manual “nmcli nm sleep false” after wakeup re-enable the network? This should bring NetworkManager back from sleep mode.

  2. Sreenivas says:

    i am using dell inspiron 1525 recently i upgraded ubuntu13.10 to 14.10LTS. Hibernate option is not there and system not Suspend some times they are getting Black screen but laptop is working…….Please tell me the answers how to solve this problems and they are having many problems in this version……

  3. In my machine it also appeared and disappeared. This is produced because my machine has multiple users created. You´ll need to also add this to the file:

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

  4. app says:

    Hi,
    I did this!!
    check if ur hav a swap
    sudo gedit /etc/fstab -> check ur swap uuid and /dev/sdaX
    sudo blkid
    cat /proc/swaps
    sudo swapon -s
    if u dont hav 1 create1
    sudo swapoff -a
    sudo /sbin/mkswap /dev/sdaX example xda6,4,5……
    sudo swapon -a
    sudo swapon –all –verbose
    mountall -v
    sudo gedit /etc/default/grub
    GRUB_CMDLINE_LINUX=”acpi_sleep=nonvs resume=UUID=your uuid(swap)”
    sudo update-grub
    sudo gedit /etc/initramfs-tools/conf.d/resume
    RESUME=UUID=your uuid(swap)
    sudo update-initramfs -u
    sudo mountall
    Reboot
    Good luck

  5. On my system, for some reason the echo disk > /sys/power/state works fine in hibernating the laptop, but pm-hibernate does not. I implemented the polkit edit to enable the hibernation option on the drop down menu, but it doesn’t work either. That is, the option is there now, but the behavior is like when evoking pm-hibernate.
    I have tried looking for solutions for that but coudn’t find yet. Do you have any suggestions?
    Cheers,
    Marcelo.

  6. jasomdotnet says:

    I had similar problem with hibernation in Ubuntu 14.04. I was missing swap space. Here is short tutorial how to solve this problem: http://www.jasom.net/how-to-enable-hibernation-in-lubuntu-14-04

    Hope it helps somebody!

  7. thanks man . it’s working fine in ubuntu 14.04.1 LTS

  8. CEP says:

    Found this useful, thanks :) Alternatively, you could also use

    killall unity-panel-service

    to restart just the top-panel.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s