Ubuntu 20.04 disable sleep


I recently installed Ubuntu 20.04 on the eMMC of my Vim3 pro (kernel version 4.9, since this is the only one that shows correct colors and gives power to USB devices).

However when I connect to it via SSH after a while (less than 1h) it goes into sleep mode, which I don’t want.

How do I disable this?

Thank you

hi, apparently you need to disable it in the settings so that it does not fall asleep

@chiMicke Maybe you can try this . Add a new line into you board ssh setting

$ vim /etc/ssh/sshd_config

then add a new line

ClientAliveInterval  60

sync && reboot , then try again .


Hi @chiMicke,
I was facing the same problem a month ago, It is related to physical device inactivity,
@Vladimir.v.v and myself tried to solve the problem,

It is related to the usage of a display manager which invokes a suspend if the device is not being physically used, my advice if primarily doing SSH use server version of ubuntu,

Good day!

1 Like

yes, I remember, we solved this issue with you

Aye, It Was a very confusing but fun investigation…

I thought, chiMicke had a Desktop version

I installed the server version, but added xfce4 since I’m not 100% cli capable, and sometimes I’ll want to use it as a desktop.

I did the sshd_config thingy, but I guess this will only work as long as I’m connected via ssh? There will be times when I want it to run a long python program (~2h) without being connected via ssh or screen the whole time, will it also work then?

I looked in the config tools of xfce but couldn’t find any power management settings…

I found this online but I’m not sure if this will do the trick:

This command disables suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

and this command brings it back:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
1 Like

Same exact mistake…

wow, that is nice, someone finally gets a hint to the problem, @chiMicke please check it, and tell me if it works…

I tried this. I’m not sure how to sync it, but I saved it, rebooted and after that the effect was the same. I did check afterwards and the setting was properly saved

the mask solution seems to have done the trick, it’s been up for more than an hour

Well that sounds great, what do you mean by mask solution ?
can you elaborate the steps taken for this to work, how did you do the sync step ?

By “the mask solution” I meant “sudo systemctl mask …” the one I found that disables sleep, hibernation etc

I didn’t look further for the way to sync. Possibly it’s just typing “sync” or “sudo sync” I’ve seen that before somewhere