I have a 2008 MacBook pro (running El Capitan with the latest updates) that I want to use as a media center/server.

It will be controlled exclusively via Screen Sharing and remote control apps (like Kodi/XBMC, Airfoil, etc). It's stored underneath my TV, which doesn't allow enough room for the laptop to stay open, so it has to be closed. I know that MacBooks can get hot if run while closed; it's not covered on any side where it sits, so it should be able to stay cool.

The laptop will always be connected to HDMI and speakers. The TV and speakers may not always be on; sometimes just the speakers will be on (e.g. for audio streaming).

It will be constantly connected to wired internet/Ethernet. My shared wireless connection is spotty, so it will often not be connected to WiFi.


I need the laptop to stay on without going to sleep. There are reams of advice on the internet for how to enable clamshell mode. However, in my case, there's no external dock, mouse, keyboard, or thunderbolt peripheral connected.

How do I prevent a closed, disconnected-from-everything MacBook running OSX 10.11 from going to sleep?

There are lots of similar questions on StackExchange and the internet, but none of them that I've seen deal with laptops that will be disconnected from everything but internet and speakers; most other questioners seem to want to use an external monitor or dock-like device.

What I've tried:

I zapped the PRAM/PMU before starting tweaking stuff to ensure that there were no stale settings lingering around.

  • Disabling sleep entirely while on AC/battery.
  • I tried various nvram commands to disable the internal display. While the internal display then didn't stay lit up during other attempts in this section, this did not seem to change sleep behavior.
  • Temporarily connecting a Bluetooth keyboard, so there's at least a disconnected Bluetooth peripheral to make it consider clamshell mode. I don't want to use a Bluetooth device to control the media center in the long term; screen sharing other apps only. No luck; with the TV disconnected or off, even a connected Bluetooth accessory seems to make it go to sleep as soon as Screen Sharing is disabled.
  • Enabling Internet Sharing, File Sharing, and the Bluetooth PAN. This doesn't consistently work; it seems to work more consistently when a WiFi connection is available, but my apartment's WiFi is flaky and is often not connectible.
  • Installing InsomniaX and configuring various modes with it; this occasionally keeps the MacBook on while the TV is on and connected and a Screen Sharing session has ended, but does not seem to work for audio-only streaming.
  • Have you tried Caffeine on the Mac App Store? It cost $1 but it has good reviews for preventing the Mac from sleeping.
    – fsb
    May 10, 2016 at 12:17
  • 1
    @fbara There's an app called "KeepingYouAwake", and it's the successor to Caffeine. It's free, and open source: KeepingYouAwake May 10, 2016 at 12:19

2 Answers 2


I use a program called "NoSleep". It allows me to do exactly that - helps me download updates, for example, while I go home from work.

You can get it from here: http://www.macupdate.com/app/mac/37991/nosleep

  • 1
    Welcome to Ask Different. While this is technically an answer, it's not really helpful because you say "there is no link." See apple.stackexchange.com/help/how-to-answer on how to write a good answer.
    – Allan
    May 10, 2016 at 13:29
  • NoSleep, like several other solutions I've tried, seems to work for awhile and then stop working.
    – Zac B
    May 16, 2016 at 20:47

There is a command line program called caffeinate that will prevent the machine from sleeping, that is a free alternative to the available applications in the store.

You can run it without any options and it will stay awake for as long as caffeinate is running, or you can specify a -t (timeout in seconds) that it will hold the machine awake for.

There are a few other useful options that are described in the man page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .