Wednesday, March 03, 2021

Tip: Remote login to recover from missing display

This morning, I found that my Mac’s screen wouldn’t wake up. The computer runs 24x7, with the screen blanking after a few hours of idle time. Nearly all of the time, I just tap a key on the keyboard to wake the screen when I want to use it.

This morning, that didn’t work. The screen remained asleep. I tried obvious things like hot-plugging the display and hot-plugging the keyboard, but no luck.

The usual thing most people do in this situation is to forcibly power-off the computer and reboot, but I never like doing that, because there are always open files. Sure, the file system’s journal should be able to recover everything, but it’s still something I reserve for a last resort.

Fortunately, I always have remote login (System Preferences → Sharing → Remote Login) enabled. So I was able to use SSH to log-in from another computer:

$ slogin username@hostname ...

As it turns out, the computer was up and running just fine, only without any display - as indicated by the fact that I was able to log in remotely.

From there, I was able to safely reboot it:

$ sudo reboot

This did reboot the computer (I heard the startup chime and everything), but I still had no display afterward. So I logged in (remotely) again and told it to power off:

$ sudo shutdown -h now

It powered off. After waiting a minute, I pressed the power button and it booted up normally.

I have no idea what caused the hardware to forget the display, but at least I was able to perform a safe power cycle, thanks to the use of remote login capability.

If you normally don’t keep remote login enabled, you might want to enable it, because it comes in very handy in situations like this where the computer is running normally but the attached display/keyboard/mouse are not working.

(I have also posted this article to TidBITS Talk.)

No comments: