I have a Mac Mini (Intel based) that I want to use headless. It used to work, but now if I don’t login with a monitor and keyboard attached it shuts down after a couple of minutes. Makes it hard to use as a headless device. Before it shuts down you can’t even connect using SSH. There has to be a display and keyboard attached and you have to login from there.
It’s running Monterey, but I’m not sure if this began with the Monterey install last fall or more recently.
I also “had” a Mac Mini (old one, probably 2013 or around). I ran VNC server on the Mac Mini and remote log in from other Mac using VNC viewer. However, the VNC server dropped out evey now and then, and I have to plug in monitor, keyboard and mouse to log in and restart the server. I gave up at the end.
If someone can share a more reliable solution, I may start using the old Mac again.
I bought myself a little hardware dongle years ago that emulates a display. The Mac Mini is pleased because a “display” is connected (look for HDMI dummy on Amazon, it did cost me 5 bucks). Everything works fine.
You do not need to attach a keyboard. You can tell the Mac in the System preferences not to look for a keyboard. It is somewhere in the keyboard settings.
Regarding restarting the Mac: like @aardy already has mentioned, FileVault complicates using a Mac Mini headless (it can be done though with FileVault turned on). My solution was not to bother using FileVault on my Mac Mini (I am fine without FileVault on the Mac Mini, it is no laptop, it is sitting at home, yes, it can be stolen, but …).
This is what I do too - I just got a cheapo hardware dongle.
And I set the headless Mini to a slightly smaller resolution than my regular desktop. That way I can Screen Sharing into it, fullscreen the window, and I have a slight black border so the window is easy to differentiate.
I have a 2018 Mini sitting under my desk. I use Jump Desktop to connect to it, set in its own Space. I have neither a keyboard nor display connected. I have a HCMI dummy plug, but found I did not need to use it. I do not have FileVault enabled.
I’ve had no issues booting it up and connecting in this configuration. No issues other than my back complaining when I need to crawl under the desk to press the start button that is!
I forget why I decided to use Jump. A couple of years ago I needed to spend sometime remote (my dad fell and broke his hip, and I spent the better part of three months at my parent’s place). I remember looking at several tools and I selected Jump.
I got the HDMI plug when I first got the Mini, and was using an eGPU. IIRC there were issue starting up with the eGPU as the only monitors. Eventually that issue was resolved and I no longer needed the plug.
Lots of replies here already, but I have a couple new things to add.
I’ve created separate boot/system and data partitions on my internal drive. This way I can encrypt the data drive and still log in remotely.
The automatic shutdown that occurs when you don’t log in seems to be a recent macOS security feature. My Macs that run Monterey do that but my old server runs Sierra and doesn’t do that. While it wrecks physical security you could always have the server auto-login. It would then mean you couldn’t automount the encrypted data drives.
OK, I did some research, this has been discussed on Apple’s site like 5 years ago! https://discussions.apple.com/thread/7875966
The TL;DR answer is that with FileVault enabled on the boot drive partition there is a special pre-boot login screen. And if you wait more than 5 minutes the system shuts down. The regular, post-boot login screen doesn’t time out, so if you simply log out, or if you don’t use FileVault on the boot drive partition, you won’t see the problem.
There is a sorta workaround, but there is no way to remove the timeout.