Running a Mac Remotely Over a LAN I have a Mac Mini that I use as a build platform, from within Visual Studios 2017 for Windows, to write and debug iOS apps.

I've noticed that when I establish a connection between VS and the Mac, I have to log into the Mac remotely (I use TigerVNC) before launching the connection process. If I don't establish a remote desktop session on the Mac, the connection will fail part way through because the Mac has gone back to sleep (i.e., the power LED has gone dark).

This is a different behavior than what I'm used to when accessing a Windows machine remotely. For them, once you establish a connection, the machine stays awake until the connection is closed, and the sleep timeout period expires.

Is this by design for Macs? Is there a setting that I can change to make it stay awake without first creating a desktop session?
You can prevent the Mac from sleeping in the Energy Saver preferences panel. There are a few options, but if you want to simply keep it awake the either:


Dragging the Computer sleep slider to Off.
Checking Prevent computer from sleeping automatically when the display is off.


You can find more options and details in Apple’s Support Document.