3

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?

3
  • 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? 🤔
    – matigo
    Dec 29, 2021 at 6:53
  • No the screen does not turn off automatically, neither when lid is open nor closed
    – bits
    Dec 30, 2021 at 4:25
  • I have ended up at the same dead-end here!
    – Smolakian
    Nov 11, 2022 at 17:28

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .