The other day I was doing a job for the University. When I decide to turn off the computer and go to sleep it occurs to me that it is better to put it on hibernate, so I don't have to open all my programs in the morning. What a surprise, that the hibernate option in Ubuntu does not appear in the session menu in Unity, so I had to hibernate from terminal.
Days later I realized that the same thing happens on my computers with Xubuntu y KubuntuSo I started looking for a solution.
The why of the problem
It was decided that it was better to disable the hibernate option in Ubuntu by default since there are many computers in which it does not work correctly, which can cause data loss.
Check if your equipment is compatible
A very simple test can be done from the terminal. Here an excellent post from Kzkg ^ Gaara.
My computer is compatible, how can I enable hibernation in Ubuntu?
It is very simple, you only have to edit one file.
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
and add the following
[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
What it does is add a policykit rule (used to control system privileges) to allow us to hibernate.
At the next restart the option should appear in the menu:
Fonts
Ask Ubuntu | Official Documentation
Perfect. I just implemented it and it works. Thank you.
what I would like is to be able to configure to hibernate when pressing the power button, in kde if it is possible easily, but in Unity-Gnome I still don't know how to do it
There is a way to do it but cn elementary OS ???
It is the same procedure 😉
Thank you!
If it worked for me ... I think, because it showed me a message, apparently an error. I don't know if it happened to someone else.
I have ubuntu 14.04 lts x64 I did everything, but it still does not work and when chekee gave me that if it accepts hibernation
with win7 I can do it.
I do not get the option and that I restart and everything
Is there a command missing to update the file? or save it?
I also modified the file and saved it but everything remains exactly the same, as if I had not written anything. 🙁
Thank you very much, it is my first experience in Linux and now I see all the help there is! Especially in Spanish! 😀
Thanks if it works great for me I even activate the hybrid sleep function
Thanks for the info!!
I have some doubts.
A long time ago, when I decided to add ubuntu to my netbook, I asked for help and they recommended creating a partition like this: "A logic, swap system, 1 gigabyte commonly used, triple the ram to hibernate / suspend"
My question: Does it automatically suspend there, or do you have to configure something?
Another question, when hibernating, it saves the session to disk .. On which partition?
Thank you!
When you create that partition for sleep / hibernation, you give it a special name, the operating system recognizes the partition with that name for that use.
Great, it works 100% on Xubuntu, thanks
Incredible, it worked for me! many thanks!
Hi, I am new to all this Linux and I started with ubuntu, I wanted to add the hibernate function, all Ok the hibernate button appeared but when pressing it the laptop freezes and does not go into hibernate mode, I did all the steps as shown here , I read comments on this post and the one you refer to to find out if the machine allows hibernation (check and I get freeze mem disk) but I have not found a solution, try with the sudo pm-hibernate commands but with the commands it does nothing.
Does anyone know what can I do?
Help ...
Check that you have a SWAP partition equal to or greater than the RAM installed on the computer.
Otherwise, trying to dump the contents of RAM will fail.
All the best
Install Windows.
Excellent!
Thank you very much for your help, have a happy 2016
Thank you very much it helped me a lot, and it works perfect ... I thought I had to increase the size of the swap but for now it works fine ... I have 4 gb of ram and 2 of swap ... is it okay or will I have to increase the swap?