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:
Create and enable swap partition (swap file seem not working)
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
- 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
Le Vuong | Sciencx (2024-10-06T22:02:13+00:00) Ubuntu hibernate. Retrieved from 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.