Score:1

Completely disable sleep on Ubuntu 22.04

nl flag

I'm using a HP EliteDesk 800 35W G3 Desktop Mini PC (2018) as a server in my home network.

But I can't keep the stupid thing from apparently going to sleep after I turn the monitor off or switch the KVM to another computer. I get up every morning and my ssh from my desktop is gone and it's not pinging until I go into the computer room, turn on the monitor, wait for it to wake up, and start poking around from there.

I have disabled sleep and screensaver in the console.

I have masked sleep.target, suspend.target, hibernate.target and hybrid-sleep.target.

What else do I need to do?

Google is not super helpful, because the search is poisoned by about a zillion pages asking how to disable display sleep, or questions about laptops that end up being answered by laptop-specific details.

No, I have no lid switch. I have no lid.

Possibly related: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2015314

@matigo: I turned off all the Power Management options in the BIOS. Will see how this works. If I use a dummy plug in one port will the other port still work or is that just useful for a headless install? I've only used them for headless installs in the past.

Update: This seems to have solved it.

@matigo YES please do mark your comment as a correct answer, because it is a correct answer. People will thank you for it even if only in the silence of their skulls.

@user68186: I already noted I tried that in my original post.

AskUbuntu: why are you asking me about @user68186's suggestion AGAIN? As noted in the above edit the suggested question is not relevant because I had already as masked all the sleep-related targets. AND mentioned that in my question.

See @matigo's comment for the correct answer.

in flag
This is the fault of the HP hardware. The motherboard on your HP will send a hard “shutdown now” signal to the OS when the monitor is gone for a certain length of time. Sometimes you can disable this in the BIOS/UEFI, but not always. What I’ve had to do to get around this on some HP hardware is to use a dummy video adapter, either HDMI or D-Sub. I’ve not had this issue with any other manufacturer
ar flag
Does this answer your question? [Ubuntu 20.04 suspends when idle, even if relevant power settings are disabled](https://askubuntu.com/questions/1237846/ubuntu-20-04-suspends-when-idle-even-if-relevant-power-settings-are-disabled)
waltinator avatar
it flag
Please [edit] your post to add new information, properly formatted. Information added via comments is hard for you to format, hard for us to read and ignored by future readers (who have better answers). Please click [edit] and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our way to help you improve your question. All facts about your system and problem should go in the Question with [edit]. Please read https://askubuntu.com/help/how-to-ask and https://askubuntu.com/help/formatting . Help us help you.
vidarlo avatar
om flag
@matigo Why not add that as an answer?
in flag
@vidarlo because it's not Ubuntu's fault
vidarlo avatar
om flag
It's still a perfectly good answer to a perfectly good question in my opinion :) I'll upvote it!
Raffa avatar
jp flag
@matigo Tuning hardware to work better with Ubuntu is on-topic IMHO … An answer would help a lot of users and would be a perfect resource … I remember at least one similar question in the last two weeks … So, yes it’s worth an answer :-)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.