macOS Sequoia Apple Silicon M4

Mac Mini M4
Headless Server Guide

Run a Mac Mini M4 as an always-on headless server for OpenClaw and other services, managed entirely via SSH. No monitor, no keyboard, no mouse.

12
Topics Covered
SSH
Primary Access
pmset
Always Awake
launchd
Service Manager
Do all setup with a display attached. Unplug when SSH is confirmed.

1 Enable SSH

Via System Settings

System Settings → General → Sharing → Remote Login → ON

Via Terminal

sudo systemsetup -setremotelogin on
sudo systemsetup -getremotelogin

Verify

sudo lsof -i :22

SSH Key Auth (do this now)

# On your client machine
ssh-keygen -t ed25519 -C "mac-mini"
ssh-copy-id user@mac-mini-ip

Harden sshd

# /etc/ssh/sshd_config
PubkeyAuthentication yes
PasswordAuthentication no
KbdInteractiveAuthentication no
# Restart sshd
sudo launchctl unload \
  /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load \
  /System/Library/LaunchDaemons/ssh.plist
Permissions matter: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys. Wrong permissions = key auth silently fails.

2 Keeping the Mac Awake

The most critical section for headless operation.

pmset (the right approach)

# All-in-one headless server profile
sudo pmset -a \
  sleep 0 \
  displaysleep 0 \
  disksleep 0 \
  womp 1 \
  tcpkeepalive 1 \
  powernap 0
sleep 0Never sleep
displaysleep 0Never display sleep
disksleep 0Never disk sleep
womp 1Wake for network
tcpkeepalive 1Keep TCP alive
powernap 0Predictable behavior

systemsetup alternative

sudo systemsetup -setcomputersleep Never
sudo systemsetup -setdisplaysleep Never
sudo systemsetup -setharddisksleep Never

caffeinate (safety net)

# Background wake assertion
caffeinate -dimsu &

# -d display  -i idle  -m disk
# -s system   -u user activity
For always-on services, use launchd (slide 10) rather than caffeinate. caffeinate is better for one-off scripts.

3 HDMI Dummy Plug

Without a Dummy Plug

  • VNC drops to 800x600 resolution
  • GPU drivers may not fully load
  • Screen Sharing becomes unusable
  • Window managers behave erratically
The M4 Mac Mini will not initialize a proper framebuffer without a display (or dummy plug) connected.

What to Buy

NewerTech HDMI 4K~$15OWC/MacSales
DTECH Dummy Plug~$10 (2-pack)Amazon
Any "HDMI display emulator"~$8-15Anywhere

Get 4K minimum. Plug in before removing real monitor.

Software Alternative

BetterDisplay creates virtual displays on Apple Silicon.

Up to 3200x1800 retina for VNC. Free/paid. github.com/waydabber/BetterDisplay

4 Screen Sharing / VNC

Enable Screen Sharing

System Settings → General → Sharing → Screen Sharing → ON

Via Terminal

sudo /System/Library/CoreServices/\
RemoteManagement/ARDAgent.app/\
Contents/Resources/kickstart \
  -activate -configure -access -on \
  -clientopts -setvnclegacy \
    -vnclegacy yes \
  -clientopts -setvncpw \
    -vncpw yourpassword \
  -restart -agent -privs -all

VNC over SSH Tunnel (recommended)

# Create tunnel
ssh -L 5901:localhost:5900 \
  user@mac-mini-ip -N &

# Connect via tunnel
open vnc://localhost:5901
SSH tunnel encrypts all VNC traffic. No exposure on the network.

Direct Connection

open vnc://mac-mini-ip
M4 Sequoia VNC Gotcha: Max 1920x1080 without dummy plug. With 4K plug: full resolution.

5 FileVault & Auto-Login

The FileVault Problem

All new Apple Silicon Macs ship with FileVault enabled by default.

FileVault requires a password at boot to decrypt the disk — this blocks auto-login entirely.

Without auto-login, reboots require physical keyboard input. This defeats the purpose of headless operation.

Solution: Disable FileVault

System Settings → Privacy & Security → FileVault → Turn Off

  • After decryption completes, auto-login works
  • M4 Secure Enclave still protects disk when powered off
  • Physical security is your primary defense

Enable Auto-Login

System Settings → Users & Groups → Automatically log in as → [your user]

Note: The old defaults write method for auto-login no longer works in Sequoia. Use System Settings.

6 Preventing Sleep: Full Stack

The M4-specific nightmare. Apply ALL of these together.

1
Insert HDMI dummy plug HARDWARE
Physical plug in the HDMI port
2
pmset sleep 0
Disable all system sleep modes
3
powernap 0
Disable Power Nap for predictability
4
pmset -g assertions
Confirm nothing is blocking
5
caffeinate -dimsu &
Permanent wake assertion as safety net
6
pmset -g log
Verify with log monitoring
# 1. Insert HDMI dummy plug (hardware)

# 2. Set pmset to never sleep
sudo pmset -a sleep 0 displaysleep 0 \
  disksleep 0

# 3. Disable Power Nap
sudo pmset -a powernap 0

# 4. Check assertions
pmset -g assertions

# 5. Safety net
caffeinate -dimsu &

# 6. Verify
pmset -g log | tail -20
Sequoia 15.3+ has a known sleep/wake regression. Best practice: sleep 0 — never rely on wake-from-sleep.

7 Headless Command Cheatsheet

pmset

pmset -g
# All power settings

pmset -g assertions
# What's preventing sleep

pmset -g log | grep "Sleep|Wake"
# Sleep/wake history

pmset -g ps
# Power source

scutil / systemsetup

sudo scutil --set ComputerName \
  "mac-mini-server"
sudo scutil --set LocalHostName \
  "mac-mini-server"
sudo scutil --set HostName \
  "mac-mini-server"

systemsetup -getremotelogin
# Check SSH status

defaults

# Disable screen saver
defaults -currentHost write \
  com.apple.screensaver \
  idleTime 0

# Disable notifications
defaults write \
  com.apple.notificationcenterui \
  doNotDisturb -bool true

Wake-on-LAN

sudo pmset -a womp 1                  # Enable
networksetup -getmacaddress Ethernet  # Get MAC
brew install wakeonlan                # Install tool
wakeonlan AA:BB:CC:DD:EE:FF           # Send packet

Only works from sleep (not powered off). Ethernet only. If sleep 0, mostly irrelevant.

Remote Reboot

sudo shutdown -r now     # Restart now
sudo shutdown -h now     # Shutdown
sudo shutdown -r +5      # In 5 minutes
sudo shutdown -r 23:00   # At 11pm
sudo killall shutdown    # Cancel

Recovery Mode requires physical access on Apple Silicon.

8 Apple Silicon Gotchas

IssueDetailFix
FileVault on by default Blocks auto-login at boot Disable in System Settings
No display = no GPU init 800x600 VNC, partial framebuffer HDMI dummy plug ($10)
Sequoia 15.3 regression Display wake failures after sleep pmset sleep 0 (never sleep)
Wi-Fi disconnects Drops when idle, even with sleep disabled Use Ethernet (built-in Gigabit)
SSH before login sshd works, but no WindowServer for GUI apps CLI-only is fine; enable auto-login for GUI
Spotlight on first boot Pegs CPU for 10-30 min, sluggish SSH Wait it out or mdutil -i off /
Recovery Mode Requires physical presence (hold power button) Keep Apple Configurator 2 + USB-C cable handy
Bonjour / mDNS Advertises as hostname.local ssh [email protected]
Tip: Set a static DHCP lease on your router so the Mac Mini always gets the same IP. Then you don't need to rely on Bonjour.

9 Services with launchd

LaunchDaemon vs LaunchAgent

TypeRuns AsWhen
LaunchDaemonrootSystem boot
LaunchAgentuserUser login
User Agentcurrent userUser login

Key plist Options

RunAtLoadStart at boot/login
KeepAliveAuto-restart on crash
ThrottleIntervalMin seconds between restarts
StartIntervalRun every N seconds
StartCalendarIntervalSpecific time (crontab-like)
EnvironmentVariablesInject env vars

OpenClaw LaunchDaemon Example

# /Library/LaunchDaemons/com.ocasia.openclaw.plist
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.ocasia.openclaw</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/openclaw</string>
    <string>--config</string>
    <string>/etc/openclaw/config.yaml</string>
  </array>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
  <key>StandardOutPath</key>
  <string>/var/log/openclaw/stdout.log</string>
</dict>
</plist>
# Manage
sudo chown root:wheel *.plist
sudo chmod 644 *.plist
sudo launchctl bootstrap system *.plist
sudo launchctl list | grep openclaw
sudo launchctl kickstart -k \
  system/com.ocasia.openclaw

10 Quick Setup Checklist

Run through in order with a display attached.

1
Enable SSH
sudo systemsetup -setremotelogin on
2
Set hostname
sudo scutil --set ComputerName/LocalHostName/HostName
3
Configure power management
sudo pmset -a sleep 0 displaysleep 0 ...
4
Disable FileVault
System Settings → Privacy & Security → FileVault → Off
5
Enable auto-login
System Settings → Users & Groups → Auto log in
6
Enable Screen Sharing
VNC backup access
7
Copy SSH keys
ssh-copy-id [email protected]
8
Harden SSH
PasswordAuthentication no in sshd_config
9
Insert HDMI dummy plug
$10 from Amazon
10
Test SSH, then unplug display
ssh [email protected] "uptime"
You're headless. Manage everything over SSH from now on. Set a static DHCP lease on your router for a fixed IP.
1 / 11