Score:1

How to turn off monitor on Ubuntu Server

cn flag

I'm running Ubuntu Server on an old iMac. The server monitor does not shut off after boot, but that only started happening after a recent update. Until now, setterm -blank 10 in my ~/.bashrc did the trick (and, yes, I did try --blank instead of -blank, even though the latter has been working for months). But now, it stays on constantly.

I've tried the following (via ssh):

sudo vbetool dpms off

mmap /dev/zero: Operation not permitted
Failed to initialise LRMI (Linux Real-Mode Interface).

I edited /etc/sudoers by granting myuname ALL=(ALL) NOPASSWD: /usr/sbin/vbetool, but to no effect.

sudo xset dpms force off

xset: unable to open display ""

xrandr --query

Can't open display.

The $DISPLAY environment variable is not set.

Neither ps aux | grep "X " nor ps aux | grep -i display produce any output to help identify display IDs.

And that's the depth of my toolbox, I'm afraid. Any help to shut off my monitor would be greatly appreciated.

uz flag
Jos
`xset -display :0 dpms force off` works for me (without `sudo`).
chaoborid avatar
cn flag
Thanks @Jos. I still get an error with your suggestion: 'xset: unable to open display ":0"'
uz flag
Jos
What is the output of `ls /tmp/.X11-unix/`? Every X display should correspond to an entry there.
chaoborid avatar
cn flag
Literally nothing. Here it is. `total 8.0K drwxrwxrwt 2 root root 4.0K Jul 12 20:59 . drwxrwxrwt 16 root root 4.0K Jul 12 21:31 ..`
uz flag
Jos
Then you don't have an X server running. Which is normal for a Ubuntu Server. `vbetool dpms off` still seems to be the way to go.
chaoborid avatar
cn flag
I get the same error with `vbetool dpms off` (without sudo) as I reported above. It's not clear to me what "Failed to initialise LRMI (Linux Real-Mode Interface)" means.
uz flag
Jos
See `https://bugs.launchpad.net/ubuntu/+source/vbetool/+bug/1875240` where a solution for this error was found: editing `grub` by adding `iomem=relaxed`, and rebooting.
chaoborid avatar
cn flag
I tried both editing grub by adding `iomem=relaxed` (updating grub, and rebooting), as well as using the `mount -o remount,exec /dev` which was recorded as a solution on that bug report. Both yielded the same LRMI initialization error when running the vbetool.
Terrance avatar
id flag
Try adding `consoleblank=60` to the `GRUB_CMDLINE_LINUX_DEFAULT=` in the `/etc/default/grub` file, then run `sudo update-grub` and reboot the system. 1 minute (60 seconds) after boot, the monitor should turn off.
chaoborid avatar
cn flag
Thanks @Terrance. This seemed to do the trick.
Terrance avatar
id flag
@chaoborid Changed my comment into an answer for you.
Score:0
id flag

Try adding consoleblank=60 or any mount of seconds that you want to the GRUB_CMDLINE_LINUX_DEFAULT= line in the /etc/default/grub file. Then run sudo update-grub and reboot the system.

After your choice of seconds added to consoleblank the monitor should turn off after booting the system up.

Hope this helps!

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.