How can I enter recovery mode (for Mac OS, on an iMac) remotely?

Our team administrates several Macs. To save costs (flights, etc.) in events where we have to remotely restore a system at our client location, we are trying to understand how to enter recovery mode without being physically present at the keyboard to enter recovery mode by pressing Cmd + R.

Can I pass a flag to sudo reboot or something similar, to initiate a reboot into recovery mode?

(All of the internet searches I've done have turned up "Press this series of keys on the keyboard" to enter various flavors of recovery.)


Solution 1:

You can set NVRAM options from command line to boot into recovery:

sudo nvram "recovery-boot-mode=unused"
sudo reboot

This will put your system into recovery mode.

NVRAM (nonvolatile random-access memory) is a small amount of memory that holds certain settings and can be accessed at boot by the Mac's firmware.