Hibernation

Hello guys, this is the first time posting here, I in fact created this account just to post this.

so I’ve been trying to put my kali machine to hibernation, but it was always a failure, technically, the laptop is able to hibernate and resume, the problem is that the laptop doesn’t actually shut down, it hibernate (save state to swap file) and immediately resumes without even that blink in the power button, its like sleep mode but it wakes up the moment it sleeps, the only difference is that sleep mode is actually working. This is really frustrating, because i couldn’t find any similar or related kali problem on the internet, if i find anything similar, it would be ubuntu instead. to exclude the possibility of hardware incapability, i wanna inform you that hibernation works more than well on windows, (dual booting). So ya here is a set of commands output to give you more informations on the hibernation config i set :

cat /etc/systemd/logind.conf

This file is part of systemd.

systemd is free software; you can redistribute it and/or modify it under the

terms of the GNU Lesser General Public License as published by the Free

Software Foundation; either version 2.1 of the License, or (at your option)

any later version.

Entries in this file show the compile time defaults. Local configuration

should be created by either modifying this file (or a copy of it placed in

/etc/ if the original file is shipped in /usr/), or by creating “drop-ins” in

the /etc/systemd/logind.conf.d/ directory. The latter is generally

recommended. Defaults can be restored by simply deleting the main

configuration file and all drop-ins located in /etc/.

Use ‘systemd-analyze cat-config systemd/logind.conf’ to display the full config.

See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#SleepOperation=suspend-then-hibernate suspend
#HandlePowerKey=poweroff
#HandlePowerKeyLongPress=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
#HandleSuspendKeyLongPress=hibernate
HandleHibernateKey=hibernate
#HandleHibernateKeyLongPress=ignore
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleSecureAttentionKey=secure-attention-key
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#StopIdleSessionSec=infinity
#DesignatedMaintenanceTime=
┌──(theghost㉿shadow)-[~]
└─$ cat /etc/systemd/system.conf

/etc/systemd/system.conf.d/ directory. The latter is generally recommended.

Defaults can be restored by simply deleting the main configuration file and

all drop-ins located in /etc/.

Use ‘systemd-analyze cat-config systemd/system.conf’ to display the full config.

See systemd-system.conf(5) for details.

[Manager]
#LogLevel=info
#LogTarget=journal-or-kmsg
#LogColor=yes
#LogLocation=no
#LogTime=no
#DumpCore=yes
#ShowStatus=yes
#CrashChangeVT=no
#CrashShell=no
#CrashAction=freeze
#CtrlAltDelBurstAction=reboot-force
#CPUAffinity=
#NUMAPolicy=default
#NUMAMask=
#RuntimeWatchdogSec=off
#RuntimeWatchdogPreSec=off
#RuntimeWatchdogPreGovernor=
#RebootWatchdogSec=10min
#KExecWatchdogSec=off
#WatchdogDevice=
#CapabilityBoundingSet=
#NoNewPrivileges=no
#ProtectSystem=auto
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=combined
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=journal
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
#DefaultTimeoutAbortSec=
#DefaultDeviceTimeoutSec=90s
#DefaultRestartSec=100ms
#DefaultStartLimitIntervalSec=10s
#DefaultStartLimitBurst=5
#DefaultEnvironment=
#DefaultCPUAccounting=yes
#DefaultIOAccounting=no
#DefaultIPAccounting=no
#DefaultMemoryAccounting=yes
#DefaultTasksAccounting=yes
#DefaultTasksMax=15%
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=1024:524288
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=8M
#DefaultLimitLOCKS=
#DefaultLimitSIGPENDING=
#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
#DefaultLimitRTPRIO=
#DefaultLimitRTTIME=
#DefaultMemoryPressureThresholdSec=200ms
#DefaultMemoryPressureWatch=auto
#DefaultOOMPolicy=stop
#DefaultSmackProcessLabel=
#ReloadLimitIntervalSec=
#ReloadLimitBurst=
DefaultSuspendState=shutdown

└─$ swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 16G 0B -2
└─$ uname -r
6.11.2-amd64
└─$ sudo journalctl -xe | grep -i hibernate
Jan 22 18:18:48 shadow systemd-logind[856]: The system will hibernate now!
Jan 22 18:18:50 shadow systemd[1]: Starting systemd-hibernate.service - System Hibernate…
░░ Subject: A start job for unit systemd-hibernate.service has begun execution
░░ A start job for unit systemd-hibernate.service has begun execution.
Jan 22 18:18:51 shadow systemd-sleep[2767]: Performing sleep operation ‘hibernate’…
░░ Subject: System sleep state hibernate entered
░░ The system has now entered the hibernate sleep state.
Jan 22 18:18:58 shadow systemd-sleep[2767]: System returned from sleep operation ‘hibernate’.
░░ Subject: System sleep state hibernate left
░░ The system has now left the hibernate sleep state.
Jan 22 18:18:58 shadow systemd[1]: systemd-hibernate.service: Deactivated successfully.
░░ The unit systemd-hibernate.service has successfully entered the ‘dead’ state.
Jan 22 18:18:58 shadow systemd[1]: Finished systemd-hibernate.service - System Hibernate.
░░ Subject: A start job for unit systemd-hibernate.service has finished successfully
░░ A start job for unit systemd-hibernate.service has finished successfully.
Jan 22 18:18:58 shadow systemd[1]: systemd-hibernate.service: Consumed 1.908s CPU time, 4.2M memory peak.
░░ The unit systemd-hibernate.service completed and consumed the indicated resources.
Jan 22 18:18:58 shadow systemd[1]: Reached target hibernate.target - System Hibernation.
░░ Subject: A start job for unit hibernate.target has finished successfully
░░ A start job for unit hibernate.target has finished successfully.
Jan 22 18:18:58 shadow systemd[1]: Stopped target hibernate.target - System Hibernation.
░░ Subject: A stop job for unit hibernate.target has finished
░░ A stop job for unit hibernate.target has finished.
Jan 22 18:18:58 shadow systemd-logind[856]: Operation ‘hibernate’ finished.
Jan 22 18:19:19 shadow systemd[1]: Starting systemd-suspend-then-hibernate.service - System Suspend then Hibernate…
░░ Subject: A start job for unit systemd-suspend-then-hibernate.service has begun execution
░░ A start job for unit systemd-suspend-then-hibernate.service has begun execution.
░░ Subject: System sleep state suspend-then-hibernate entered
░░ The system has now entered the suspend-then-hibernate sleep state.
Jan 22 18:19:27 shadow systemd-sleep[3093]: System returned from sleep operation ‘suspend-then-hibernate’.
░░ Subject: System sleep state suspend-then-hibernate left
░░ The system has now left the suspend-then-hibernate sleep state.
Jan 22 18:19:27 shadow systemd[1]: systemd-suspend-then-hibernate.service: Deactivated successfully.
░░ The unit systemd-suspend-then-hibernate.service has successfully entered the ‘dead’ state.
Jan 22 18:19:27 shadow systemd[1]: Finished systemd-suspend-then-hibernate.service - System Suspend then Hibernate.
░░ Subject: A start job for unit systemd-suspend-then-hibernate.service has finished successfully
░░ A start job for unit systemd-suspend-then-hibernate.service has finished successfully.
Jan 22 18:19:27 shadow systemd[1]: Reached target suspend-then-hibernate.target - Suspend; Hibernate if not used for a period of time.
░░ Subject: A start job for unit suspend-then-hibernate.target has finished successfully
░░ A start job for unit suspend-then-hibernate.target has finished successfully.
Jan 22 18:19:27 shadow systemd[1]: Stopped target suspend-then-hibernate.target - Suspend; Hibernate if not used for a period of time.
░░ Subject: A stop job for unit suspend-then-hibernate.target has finished
░░ A stop job for unit suspend-then-hibernate.target has finished.
Jan 22 18:19:27 shadow systemd-logind[856]: Operation ‘suspend-then-hibernate’ finished.

cat /etc/fstab

/etc/fstab: static file system information.

Use ‘blkid’ to print the universally unique identifier for a

device; this may be used with UUID= as a more robust way to name devices

that works even if disks are added and removed. See fstab(5).

systemd generates mount units based on this file, see systemd.mount(5).

Please run ‘systemctl daemon-reload’ after making changes here.

/ was on /dev/nvme0n1p4 during installation

UUID=d8787621-bbcd-42bd-9c74-4d204cab86fb / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme0n1p1 during installation

UUID=20AA-A108 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0

i couldn’t paste that because of some error in the forum. Please help me, i assume a lot of others have this error, because i literally found 0 correspondence to this issue

as your laptop was originally designed to be a windows laptop, yeah, it all works there… not relevent with Linux…

…hibernation issues can be caused by several things, a process that is not ‘sleeping’ when asked, and so prevents hibernation, or on some devices can be acpi events not registering properly.
you wont find an answer by searching for kali linux because thats too specific, you search for your laptop model, linux and hibernation issues…

anyway, you could try adding a kernel parameter to tell it to sleep;

sudo kernelstub -a "mem_sleep_default=deep"