How to reboot a headless MacMini M2 into Safe Mode

I don't have a screen connected to my MacMini 2023. I access it now via Screen Sharing after initial setup.


There are command line arguments for restarting an Intel mac into safe mode. Does the same exist for macs with Apple processors?


The reason I am doing this is because Software Update won't stop spinning and the OS is stuck on 13.4.1.



Mac mini (M2, 2023)

Posted on Aug 16, 2023 10:14 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 30, 2023 7:31 AM

If you have physical access to that Mac, then you can try performing the steps outlined in the first post by @ekassos. It will be tricky to do and is best done by first experimenting with a monitor connected so you can get the timing down.


For step #2, you need to hold the power button for at least 10 seconds so it triggers One True Recovery mode (1TR). Then wait a little bit longer, maybe another 10 seconds....this is were experimenting with a monitor would help.


Now just press the "Return" key and very quickly hold down the "Shift" key (maybe you can hold the Shift key first then press the Return key, but I've never tried it). Then you wait until you think macOS has had time to reach the login screen unless you have your other Mac handy to watch for a connection.


I've had to do this a few times, but I also had the option of experimenting with a connected display first.


I'm assuming you have already tried a regular reboot to fix the issue? Maybe you can delete the macOS .plist preference file which holds the results or status of the OS update check (No idea which file or where it would be located).


FYI, be very careful using the "nvram" command on an Apple Silicon Mac since several people on these forums have reported having their Apple Silicon Macs become inoperable afterwards which then required either a firmware "Revive" or possible a firmware "Restore" (the latter will destroy all data on the internal SSD) to bring them back.


I do know that the Software Update check can get stuck like this on its own....sometimes it is due to Apple's servers being too busy. Are you using any anti-virus apps, cleaning/optimizer apps, or third party security software? If so you should uninstall them since they will interfere with the normal operation of macOS...these types of apps are not needed on a Mac.

Similar questions

11 replies
Question marked as Top-ranking reply

Aug 30, 2023 7:31 AM in response to johnnyjackhammer

If you have physical access to that Mac, then you can try performing the steps outlined in the first post by @ekassos. It will be tricky to do and is best done by first experimenting with a monitor connected so you can get the timing down.


For step #2, you need to hold the power button for at least 10 seconds so it triggers One True Recovery mode (1TR). Then wait a little bit longer, maybe another 10 seconds....this is were experimenting with a monitor would help.


Now just press the "Return" key and very quickly hold down the "Shift" key (maybe you can hold the Shift key first then press the Return key, but I've never tried it). Then you wait until you think macOS has had time to reach the login screen unless you have your other Mac handy to watch for a connection.


I've had to do this a few times, but I also had the option of experimenting with a connected display first.


I'm assuming you have already tried a regular reboot to fix the issue? Maybe you can delete the macOS .plist preference file which holds the results or status of the OS update check (No idea which file or where it would be located).


FYI, be very careful using the "nvram" command on an Apple Silicon Mac since several people on these forums have reported having their Apple Silicon Macs become inoperable afterwards which then required either a firmware "Revive" or possible a firmware "Restore" (the latter will destroy all data on the internal SSD) to bring them back.


I do know that the Software Update check can get stuck like this on its own....sometimes it is due to Apple's servers being too busy. Are you using any anti-virus apps, cleaning/optimizer apps, or third party security software? If so you should uninstall them since they will interfere with the normal operation of macOS...these types of apps are not needed on a Mac.

Aug 29, 2023 7:15 PM in response to ekassos

I was caught up in another "issue" sorry for the late response.


TLDR Looks like the only `boot-arg` that is permitted even with SIP disabled is `boot-arg="-v"` for verbose.


I booted my MacMini2 2023 into recovery mode and turned off SIP:


[-bash-3.2# crutil enable --without nvram
crutil: Requesting an unsupported configuration. This is likely to break in the future and leave your machine in an unknown state.
Turning off System Integrity Protection requires modifying system security.
Allow booting unsigned operating systems and any kernel extensions for OS "MacMini HD"? [y/n]:n
csrutil: aborted [-bash-3.2# csrutil disable
Turning off System Integrity Protection requires modifying system security.
Allow booting unsigned operating systems and any kernel extensions for OS "MacMini HD"? (y/n]:y


Then shutdown...

shutdown -h now

and rebooted into Recovery Mode and tried to supply boot-args

[-bash-3.2# csrutil status
System Integrity Protection status: disabled.
[-bash-3.2# whoami
root
[-bash-3.2# nvram -d boot-args
[-bash-3.2# nvram boot-args
nvram: Error getting variable - 'boot-args': (iokit/common) data was not found
[-bash-3.2# nvram boot-args="-v"
[-bash-3.2# nvram boot-args="-x"
Error setting variable - 'boot-args': (lokit/common) not permitted.
[-bash-3.2# nvram boot-args
boot-args     -v
[-bash-3.24 nvram boot-args='-x'
Error setting variable - 'boot-args': (iokit/common) not permitted.
[-bash-3.2# nvram boot-args="-s"
Error setting variable - 'boot-args': (lokit/common) not permitted.
[-bash-3.2# nvram boot-args
boot-args     -v
-bash-3.2#


Unless someone has another idea looks like we hit a roadblock.

Aug 30, 2023 11:00 AM in response to johnnyjackhammer

Yeah, if you are not all in on Apple's features, then you usually end up with odd issues. I don't know how many times I had Messages issues because Messages was the only thing I had associated with my AppleID on my work computer (wanted to keep work & person separated, except needed easier access to Messages).


AFAIK, there is no way to remotely boot into Safe Mode on the Apple Silicon Macs.


You can provide Apple with product feedback here (Apple won't respond):

Product Feedback - Apple


Aug 30, 2023 12:07 PM in response to HWTech

I am pretty sure I found a solution. To confirm it is there a way to see from the logged in user whether they are in safe mode or not?


With SIP off I was able to set nvram boot arguments on the Mac mini using this exact command. Combining both verbose and safe mode boot.


sudo nvram boot-args="-x -v"


I am able to set and unset this remotely using SSH.


I am also able to reboot remotely via SSH


sudo launchctl reboot system

Aug 16, 2023 10:44 PM in response to johnnyjackhammer

Hi johnyjackhammer, here are the instructions you can use for Apple Silicon Macs:


  1. Shut down your Mac.
  2. Press and hold the power button on your Mac. As you continue to hold the power button, your Mac turns on and loads startup options. When you see Options, release the power button.
  3. Select your startup disk. It's named Macintosh HD, unless you changed its name.
  4. Press and hold the Shift key, then click the “Continue in Safe Mode” button below your startup disk.
  5. Log in to your Mac. You might be asked to log in again.


Read more at Use safe mode on your Mac - Apple Support.


Some external reports do say that you can still use older commands like

sudo nvram boot-args="-x"

but do make sure that you understand the risks of such commands before running them.

Aug 16, 2023 11:13 PM in response to ekassos

Thanks.


Can't follow the instructions listed because I don't have a monitor. Only Screen Sharing right now. Without a screen connected to the MacMini 2023 there is no way. Screen Sharing only works once the MacMini 2023 has booted up.


Tried using the command line arguments but it didn't go. Do you think I have to be root?


john@Mac-mini ~ % sudo nvram boot-args="-v"
john@Mac-mini ~ % sudo nvram boot-args="-x"
Error setting variable - 'boot-args': (iokit/common) not permitted.


Looks like setting "-v" is allowed, but not "-x"


These are the options listed after running nvram -p


fmm-mobileme-token-FMM
IDInstallerDataV2
prev-lang:kbd
LocationServicesEnabled
boot-volume
fmm-mobileme-token-FMM-BridgeHasAccount
preferred-networks
boot-note
upgrade-boot-volume
fmm-computer-name
SystemAudioVolumeExtension
ota-original-base-os-version
bluetoothExternalDongleFailed
current-network
auto-boot
ota-updateType
ota-controllerVersion
bootdelay
SystemAudioVolume
StartupMute
usbcfwflasherResult
bluetoothInternalControllerInfo
display-crossbar

Aug 30, 2023 12:30 PM in response to ekassos

@ekassos


Confirming that this does work. Hope it stays that way. Next test is to turn SIP back on and see if it sticks.


I used ssh to check remotely once I knew where the information was.


john@Mac-mini ~ % system_profiler SPSoftwareDataType  | grep "Boot Mode"
      Boot Mode: Safe


Do you know of a way to dump all of the kext command arguments that will work with NVRAM?

Aug 30, 2023 10:25 AM in response to HWTech

Thanks for the post... 😀


I eventually just had to wipe the MacMini and start over. The problem seems to stem from choosing not to use iCloud login when first presented with the option on a new system and admin user account, and then turning it on later in a few select apple.apps. This seems to cause all kinds of havoc, possibly revolving around the current user's contact card not being a Me card tied to an iCloud email address.


I tried every troubleshooting method I could. Eventually, as a last resort, deleting Software Update files in /private/var/folders. Nothing resolved the issue so I used the nuclear option.


I think I understand what you are saying here but I want to be clear. Are you saying I can use the keyboard on my iMac to trigger booting options on the MacMini while connected via ScreenTime? And that I can learn the timing of when to press and how long to hold keys, by doing it directly on the MacMini first with a screen attached.


I can use my TV to figure out the timing. I would just like to have the option in the future to boot remotely into Single User mode since this MacMini will be a server at some point soon, and I don't want to disassemble the situation to resolve issues.



Aug 30, 2023 12:10 PM in response to johnnyjackhammer

Glad you got it working! Here's how to verify if you're in Safe mode:

  1. Press and hold the Option key, then choose Apple menu > System Information.
  2. In the System Information app, select Software in the sidebar.
  3. In the System Software Overview, look at the value listed next to the item labeled Boot Mode.
    • Safe: The Mac is using safe mode.
    • Normal: The Mac is not using safe mode.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to reboot a headless MacMini M2 into Safe Mode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.