MacOS – When Screen Sharing, why does the remote screen continually go black

macosremote desktopscreen-sharing

As an ongoing issue (for at least the past three major OS X versions), I find that when trying to remote to another machine using Screen Sharing, the remote screen gets painted completely black. Moving the mouse will result in the area immediately under the pointer being redrawn correctly, and dragging a window (in the remote session) off screen then back on will redraw that window. Sometimes other areas of the screen will redraw themselves (usually when there is an actual change), but most the screen simply remains black, sometimes even repainting back to full black again.

Network connectivity doesn't seem to be a factor; this happens both on a fast LAN and across the Internet with 400-500ms latency. Hardware doesn't seem a factor either; using a range of Mac Minis and Macbooks. Screen sharing sometimes initiated via Remote Desktop, sometimes just clicking on Share Screen in the Finder. While I can work around this glitch (I tend to just SSH in for maintenance), I thought I'd see if anyone out there has any suggestions!

Best Answer

I'd second the idea that it may be a RAM issue -- I'm noticing that it happens particularly when:

  • I've got huge uptime on the remote system (so... memory leaks, cruft, have accumulated)
  • I switch apps on the remote system (loading things in and out of RAM)

From practical standpoint, I've found that greping for the the screen sharing daemon and killing it forces the remote machine to respawn a new one that isn't blacked out... but that doesn't last for long:

ps aux | grep screensharingd

and then sudo kill XXXX once I know what what procid I'm targeting. But that's a really short term solution (buys another 15-90 seconds, usually).

The finger the I would also point is at mdutil, the spotlight indexer, which just gets out of control, especially on a system with a lot of large drives with a lot of small files. I've had best success clamping down on Spotlight (which, imho, isn't very useful) and restricting it by either marking most of my drives and directories "private".

If the remote system is tight on RAM, it may be because Spotlight is being a pig.