Archives For hibernate

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.

Ubuntu 14.10 Hibernate

The Hibernate option is available in Beta and Alpha releases of Ubuntu 14.10, but the final release removed this option in the Unity desktop.

This quick guide is going to show you how to re-enable this feature so that you can hibernate your machine from the shutdown menu (top-right gear button).

hibernate ubuntu 14.10

1. Before getting started, you may run command below in terminal (Ctrl+Alt+T) to test if hibernate works in your case:

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 command below 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 value of ResultActive to yes in both.

enable-hibernate-conf

3. To save the changes, press Ctrl+X and type y and finally hit Enter.

When everything’s done, restart your computer.

Tips:

1. If previous steps do not work for you, replace the command in step 2 with:

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

2. Thanks to Cruz, you can add below lines into the configuration file to make Hibernate work for multiple users:

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

3. If you want to hibernate your laptop when lid is closed, run command to edit the configuration file:

sudo nano /etc/systemd/logind.conf

Add HandleLidSwitch=hibernate as a new line into the end and save the file. It will work at next boot.

ubuntu hibernate

This simple and brief tutorial is going to show you how to enable the hibernate feature in Ubuntu 14.04 Trusty Tahr.

Hibernate is disabled by default in Ubuntu, when the computer hibernates, all of your applications and documents are stored and the computer completely switches off so it does not use any power, but the applications and documents will still be open when you switch on the computer again.

hibernate ubuntu 14.04

Test if hibernate works in your case:

Before getting started, press Ctrl+ALt+T on your keyboard to open the terminal. When it opens, run:

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.

Enable Hibernate in System Tray Menu:

The indicator-session was updated to use logind instead of upower. Hibernate is disabled by default in both upower and logind.

To re-enable hibernate, run the commands below one by one to edit the config file:

sudo -i

cd /var/lib/polkit-1/localauthority/50-local.d/

gedit com.ubuntu.enable-hibernate.pkla

Tips: if the config file does not work for you, try another one by changing /var/lib to /etc in the code.

Copy and paste below lines into the file 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
ResultActive=yes

enable hibernate ubuntu 14.04

Restart your computer and done.

Hibernate your laptop when lid is closed:

1.Edit “/etc/systemd/logind.conf” via command:

sudo gedit /etc/systemd/logind.conf

2. Change the line #HandleLidSwitch=suspend to HandleLidSwitch=hibernate and save the file.

3. Run command below or just restart your computer to apply changes:

sudo restart systemd-logind

That’s it. Enjoy!

I’ve written a post about how to enable hibernate option in previous Ubuntu releases. Ubuntu 13.10 is a little different, so I write this tutorial to teach how to enable this feature in Saucy Salamander. Hope it helps!

Hibernate is disabled by default in Ubuntu, when the computer hibernates, all of your applications and documents are stored and the computer completely switches off so it does not use any power, but the applications and documents will still be open when you switch on the computer again.

hibernate ubuntu 13.10

Test if hibernate works

Before getting started, press Ctrl+ALt+T on your keyboard to open terminal. When it opens, run:

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.

Enable Hibernate

The indicator-session was updated to use logind instead of upower. Hibernate is disabled by default in both upower and logind.

To re-enable hibernate, run below command to edit the config file:

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

Copy and paste below lines into the file 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
ResultActive=yes

enable hibernate ubuntu 13.10

After reboot, the login screen session menu should have a Hibernate option.

After logged in, the desktop session menu still doesn’t have the Hibernate option. Run killall indicator-session-service and the menu will be updated with Hibernate. This is a little buggy, because you need to run this command everytime you login to get the option. If you know how to fix it, tell me and thanks!

UPDATE: Thanks to MoonShadow, here’s the method to kill indicator services at startup:

1. Go to Startup Application from Unity Dash.

2. Click Add and type in:

Name: restart indicator services
Command: sleep 60 && killall indicator-session-service

kill-indicator-services