Hibernate / Resume from hibernation - Ubuntu (MATE) 18.04
Hibernate / Resume from Hibernation did work as expected in Ubuntu MATE 16.10, 17.04, 17.10 (at least on my PCs, not on my notebooks).
Issue: Hibernate / Resume from Hibernation do not work as expected after new installation / upgrading to Ubuntu (MATE) 18.04.
This short guide assumes you have a swap partition on your Ubuntu (MATE) 18.04 PC.
- Open MATE Terminal
sudo blkid | grep swap
- Copy the UUID (it looks like this XXX-XXX-XXX-XXX-XXX)
sudo pluma /etc/default/grub
- Search for GRUB_CMDLINE_LINUX_DEFAULT => it looks like this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
- Add the resume=UUID=XXX-XXX-XXX-XXX-XXX parameter => GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=XXX-XXX-XXX-XXX-XXX"
- Save the file and close pluma
- Save your work (open files) and reboot
- Log into Ubuntu (MATE) and open some applications
- Check if Hibernate works on your computer by entering
sudo systemctl hibernate
=> your PC will enter Hibernate (hopefully) - If your PC successfully entered Hibernate, resume from hibernation (press the Power button, move your mouse or press a key... depending on your PC)
- If the PC successfully resumed from Hibernate, all the applications you've opened in step 9 show up correctly and you can continue work, Hibernate / Resume from Hibernation works as expected.
- Open MATE Terminal
sudo pluma /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
- Add following (if not already there):
[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
16. Save the file and close pluma
17. Hibernate button should be available via click on the Power button -> Shutdown (or Menu -> Quit)
18. Test Hibernate and Resume from hibernation
This was the solution for my 3 PCs (not notebooks!) running Ubuntu MATE 18.04 now.
Notes
- If step 10 / 11 / 12 did not work for you, you should not continue. I am sorry, but I have no alternative solution (yet?). My notebooks DO NOT "support" Hibernate / Resume from hibernation with Ubuntu (but with Windows 7, 8.x, 10.x).
- Hibernate / Resume from hibernation should work with a swapfile, too. I use swap partitions on my PCs. You may want to search the Internet for a solution.
Hope this helps