MacOS — Running It Like a Server When The Lid Is Closed

Shawn Song
1 min readMar 17, 2023

Following my last story about mounting SMB drives on the network, more challenges to unfold when setting up my media server on MacOS.

This time is the USB ethernet adaptor!

In order to ease the traffic from my wireless network, I ordered a USB ethernet dongle for my MBA — it’s fast, stable, and met all my expectations, except MacOS will disconnect the network once you close the lid, regardless of how much you have set up in energy settings telling the machine not to sleep etc.

The USB dongle will go black after 2 mins!

After spending hours of wrestling with ChatGPT / BingAI / Google (tiring) — this cmd eventually saved the night:

sudo pmset -a disablesleep 1 

and you can verify it via:

pmset -g

# output like this
System-wide power settings:
SleepDisabled 1

Done! My 10yrs old MBA is now running quietly as the new media server!

--

--