Troubleshot rebooting Mac mini server I have a Mac mini running 10.13.6 as a server.


Time Machine
homebridge 
File Server 
Content caching
Netinstall
Xcode
running VMware Fusion with Linux guest system


Since a few weeks, the whole system starts at  random moments.

What would be a way to troubleshot this?
The first thing is to get into the console app / system log and trace the shutdown cause and timing of the restarts. Then you would look to see if there are hangs or crashes in /Library/Logs/DiagnosticReports prior to those events.


The reason for Previous shutdown cause: -128
Shutdown cause: -104


Depending on your interest in scripting shell to collect matches from log files, here’s an example of using those log files to find events like needles in a very large, long and confusing haystack.


Improvement to &#39;grep -h &quot;BSD process name&quot; /Library/Logs/DiagnosticReports/* | sort | uniq -c&#39;


Most likely, you will see a pattern (or see there is no pattern once you get 25 restarts logged and cataloged) and can remove the hardware, software or look into what is the logged reason.