How to disable blank screensaver on Ubuntu Server?
There's no desktop or X, only console (command-line interface).
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The easiest way is to add the parameter
consoleblank=0 to your kernel command-line at boot-time.
/etc/default/grub in your favorite editor; you will need to use
nano, etc.) or
consoleblank=0 to the
e.g. yours may say:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0"
sudo update-grub, and reboot.
setterm -blank 0 on any shell to disable blanking out of tty consoles.
0 disables blanking, any value greater than 0 is the time in minutes. Default is
To permanently enable this you can add this line to your
A more detailled explaination can be found in this answer at superuser.
This will "overwrite" whatever is in your current config for "GRUB_CMDLINE_LINUX_DEFAULT=", mine was default, so I just use the following One Liner.
sudo sed -i 's/\(^GRUB_CMDLINE_LINUX_DEFAULT=\).*/\GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0"/' /etc/default/grub && sudo update-grub2
Same situation, the other suggestions seemed a roundabout solution.
Came across the GNU tool
setvesablank on/off using apropos.
It seems the best fit, trying it out to see if it fits the need.
If none of the above answers work for you, this may be indicative of GPU auto shutoff due to overheating ( I couldn't believe it myself, readon ).
This auto shutoff mechanism is valid in at least Ubuntu 18.04 and Debian Buster. How did I discover this? I have two gpus, a basic video outputer and a gaming gpu; not in sli nor in crossfire. The former I had to remove the heatsink to fit in the case. When I kept my Ubuntu installation and used my gaming gpu instead, the screen would not turn off after 10 min, after logging in with the above patches (answers on this page applied). At first, I thought it was due to crappy generic drivers, so I did the following whilst my gaming gpu was being utilized.
apt search nvidia-driver
sudo apt install nvidia-driver-430
sudo nvidia-smi (after login)
Video GPU 73 degrees celcius, gaming gpu 34 degrees celcius...autoshutoff mechanism proven as far as I am concerned.
Current active nvidia processes 0 (still using the piece of shit generic driver for console, but 73 degrees celcius and anecdotal evidence points to autoshutoff mechanism being triggered.
What is frustrating is the Windows 10 installed and ran without flaw without the heatsink so this was very unexpected...I must have misread GPU-Z because I saw 34 degrees being reported unless there's a bug in GPU-Z where it just basically takes one temperature reading and displays it for both gpus. Nvidia-smi is much more reliable than GPU-Z. Don't trust GPU-Z if it reports the same temps for two different gpus.