Ubuntu hibernate

When working on Linux/Ubuntu, have you ever gotten tired of reopening tons of apps and workspaces again and again when you bring your laptop somewhere, especially when the battery runs out?

It’s much cooler when you can open your machine with all your…


This content originally appeared on DEV Community and was authored by Le Vuong

When working on Linux/Ubuntu, have you ever gotten tired of reopening tons of apps and workspaces again and again when you bring your laptop somewhere, especially when the battery runs out?

It’s much cooler when you can open your machine with all your apps already running.

Let’s try this guide to enable hibernation on your Ubuntu system.

Only 3 steps as below:

  1. Create and enable swap partition (swap file seem not working)

  2. Create Polkit action.

nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla



# NEW entry since Ubuntu 18:
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

 # NEW entry since Ubuntu 18:
[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


  1. Create clean up hook

sudo nano /etc/systemd/system/use-10_grub_common.service



[Unit]
Description=Execute the /etc/pm/sleep.d/10_grub_common script after hibernation.
After=hibernate.target

[Service]
Type=oneshot
ExecStart=/etc/pm/sleep.d/10_grub-common thaw

[Install]
WantedBy=hibernate.target


And enable this service: sudo systemctl enable use-10_grub_common

Enjoy using Ubuntu!


This content originally appeared on DEV Community and was authored by Le Vuong


Print Share Comment Cite Upload Translate Updates
APA

Le Vuong | Sciencx (2024-10-06T22:02:13+00:00) Ubuntu hibernate. Retrieved from https://www.scien.cx/2024/10/06/ubuntu-hibernate/

MLA
" » Ubuntu hibernate." Le Vuong | Sciencx - Sunday October 6, 2024, https://www.scien.cx/2024/10/06/ubuntu-hibernate/
HARVARD
Le Vuong | Sciencx Sunday October 6, 2024 » Ubuntu hibernate., viewed ,<https://www.scien.cx/2024/10/06/ubuntu-hibernate/>
VANCOUVER
Le Vuong | Sciencx - » Ubuntu hibernate. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/06/ubuntu-hibernate/
CHICAGO
" » Ubuntu hibernate." Le Vuong | Sciencx - Accessed . https://www.scien.cx/2024/10/06/ubuntu-hibernate/
IEEE
" » Ubuntu hibernate." Le Vuong | Sciencx [Online]. Available: https://www.scien.cx/2024/10/06/ubuntu-hibernate/. [Accessed: ]
rf:citation
» Ubuntu hibernate | Le Vuong | Sciencx | https://www.scien.cx/2024/10/06/ubuntu-hibernate/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.