How to: Enable Hibernation on Linux Mint and Ubuntu Distro's

Post a Comment

People, people, if that one making you to reboot to your dual booted system into windows, is unpresence of hibernation on Linux side. Mainly problem is not going into hibernation mode, its coming back and having ability to resume things which are left off. But sometimes black screen appears when we try to go resume after our previous suspend [sleep in windows language]. A hard reboot is reqd. in order to be working again on that system, this leads to loss of tasks and focus of work.

Moving on to Solutions...

There are three solutions to this problem, which I tried one after another, some worked for me and some worked for others, so its kind of mixtures of solution in which any solution can lead you to success.

Before anything, you have to check whether you linux distro supports Hibernation. You can do this by:
$ : sudo pm-hibernate 
 
# or for newer Ubuntu's like 17.04
$: sudo systemctl hibernate

if you don't have hibernation, try to install pm-utils, and..
$: sudo apt-get install hibernate       # also you can do this by going to synaptic package manager if you have that.

Solution 1: Update Linux through update manager

Okay, you probably read this right, its utilities that are way too old can make you stay back from using hibernation. New changes to Ubuntu sometimes changes the settings to those distro also, which are using ubuntu's code base as its code base. AND you can check which version of ubuntu base you are running under "pretty name" by simply: 
$ : sudo cat /etc/os-release 

 

Solution 2 : Adding lines in polkit for hibernation

this is a small tricky bussiness, you have to add some lines as follows:

$ : sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
You have to add lines of any one block according to you ubuntu version, first block is default thingy which means if two blocks (i.e lines of code for 16.04 or 15.04) after this doesn't work, you can use this.

add these lines:
[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

for Ubuntu 16.04 and above add these:

[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.hibernate-multiple-sessions
ResultActive=yes

for Ubuntu 15.04 or 14.04 add these:

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

[Re-enable hibernate by default for login1]
  Identity=unix-user:*
  Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
  ResultActive=yes
restart system, and hopefully hibernation will be working.
 
 

Solution 3: Installing Tuxonice and using it.

This requires you to have swap area more than you RAM size.
you can check if swap is more or less than RAM by:
$ : free
if swap is not more than RAM, this solution will not work for you. Do increase your swap area.

OK, assuming you have more swap area.. 
Before installing this, you have to delete a file under which hibernation code is written for default so that tuxonice could configure hibernation of its own way.

delete the hibernation file:
$ : sudo rm /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
 
Lets install TuxonIce:
sudo add-apt-repository ppa:tuxonice/ppa
sudo apt-get update
sudo apt-get install tuxonice-userui linux-generic-tuxonice linux-headers-generic-tuxonice 
 
Now restart system.

Check hibernation by :
$ : sudo pm-hibernate or sudo systemctl hibernate
Thats it !

For me, installing TuxonIce [solution3] followed by updating linux [solution1] worked. 


Y Aakash
Hello World, I Dwell with Creative Sketching, Coding, Finance & Blogging by putting my Views and Work.

Related Posts

Post a Comment