Score:0

Real mode call failed on MacBook Pro when trying to turn screen off Ubuntu Server 20.04

ca flag

I have Ubuntu Server 20.04 installed on an early 2011 MacBook Pro 8,1 and I want to close the lid and turn the screen off. I have succesfully prevented it from sleeping when closing the lid as described here https://askubuntu.com/a/594417 and from another answer https://askubuntu.com/a/1117586 in the same question, I created a script to trigger the screen on/off. This script gets executed I have confirmed that with logging the calls to it.

The first problem is (was) that

sudo vbetool dpms off

resulted in this

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

So I tried the solution here Ubuntu 20.04 on a laptop - is there any way toturn off the screen? that adds this

sudo mount -o remount,exec /dev
sudo vbetool dpms off
sudo mount -o remount,noexec /dev

but it results in

Real mode call failed

and yes the screen does not turn off

I tried xset and xrandr but they can't open the display

The installation is headless without GUI

uname -a
Linux oldlaptop 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-5.4.0-91-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro

Any ideas how to turn off the screen, either using vbetool or any other?

in flag
The screen should turn itself off if nobody is logged into the console. If you leave the screen at the login prompt, does it not go dark after 5 minutes?
bits avatar
ca flag
No the screen does not turn off automatically, neither when lid is open nor closed
Smolakian avatar
mr flag
I have ended up at the same dead-end here!
Score:0
mr flag

I ran into the same exact wall.

The only solution I found is turning off the screen after a period of inactivity. (This completely removes the need for acpid and lid.sh)

There are two options. The first is to use the following command:

setterm --powerdown 1

Note: If you are testing this out, it doesn't work over SSH. So to test it, you need to run it from the laptop directly. You can put that in a script and have it run at boot.

Second option, and what I did: Add consoleblank=60 to the GRUB commandline:

sudo nano /etc/default/grub

Edit line to read:

GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=60"

Reboot.

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.