To prevent Proxmox on a laptop from suspending when the lid is closed, edit the /etc/systemd/logind.conf file to set HandleLidSwitch=ignore, HandleLidSwitchExternalPower=ignore, and HandleLidSwitchDocked=ignore. Uncomment these lines by removing the ‘#’ symbol, then save the file and restart the systemd-logind service with systemctl restart systemd-logind or reboot the system for the changes to take effect.
Step-by-step Guide:
- Open the configuration file: Open the
logind.conffile using a text editor such asnanoorvim:bashsudo nano /etc/systemd/logind.conf - Modify the settings: Find the following lines. If they are commented out (start with a ‘#’), remove the ‘#’ to uncomment them.
#HandleLidSwitch=suspendbecomesHandleLidSwitch=ignore#HandleLidSwitchExternalPower=suspendbecomesHandleLidSwitchExternalPower=ignore#HandleLidSwitchDocked=suspendbecomesHandleLidSwitchDocked=ignore
- Save and exit: Save the changes to the file and exit the editor.
- Apply the changes: Restart the
systemd-logindservice for the new settings to become active:bashsudo systemctl restart systemd-logindAlternatively, you can reboot the Proxmox system.
After these steps, closing the laptop lid will no longer cause the system to suspend, allowing Proxmox to remain accessible.