Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have chronic problems connecting to my headless Mac Mini using Mac OS X's builtin screen sharing. Usually it works fine, but sometimes it will not connect.

It goes like this:

I initiate a connection (either by clicking the Mac Mini in the sidebar in a Finder window and choosing the "Share Screen..." button, or else by launching /System/Library/CoreServices/Screen Sharing.app and enter the Bonjour name "macmini.local"), the throbber appears with the word "connecting", then the throbber disappears. If it's going to connect successfully, it does so at this point. Often, however the throbber disappears and nothing replaces it. The Screen Sharing app remains active, no message appears, and nothing happens, no matter how long I leave it. No connection seems to occur.

I cannot cause the issue to occur reliably, but once it does occur, it can be observed from several different mac clients. If I reboot the remote machine (via shutdown over ssh), it goes away and I connect without problem, but I'm seeking a better solution.

Checking the processes running on the remote Mac Mini via ssh, I see two processes, /System/Library/CoreServices/RemoteManagement/screensharingd.bundle/Contents/MacOS/screensharingd owned by root, and a child process /System/Library/CoreServices/RemoteManagement/ScreensharingAgent.bundle/Contents/MacOS/ScreensharingAgent. If I try to kill either of these processes, they change their PID but remain running, and it does not allow me to connect.

From this thread Restart Screen Sharing Service on Mac mini Server I learned how to properly restart the screen sharing daemon. Or actually two methods. Not sure which one is proper, so I do them both. Does not help, still cannot connect.

From this thread Why is Mac-to-Mac screen sharing just hanging? I learned the suggestion to connect by IP address instead of bonjour name. Upon trying this, I get the login window, instead of the "connecting" throbber. Still no connection, though. And quitting Screen Sharing on the local machine doesn't get rid of the stuck login window. The only way to rid yourself of it is to kill NetAuthAgent, as I learned in this thread: How to kill stuck Screen sharing authentication dialogue?

Both machines run Lion (10.7.4), though I've been observing this behavior since 10.6, perhaps 10.5 I can't remember. Remote machine is a 2009 Mac Mini, and the local machine is a MacBook Pro (this behavior has been duplicated on many different client machines though).

Surely there must be some process, server, daemon on the remote machine that I can bounce? Something short of rebooting?

share|improve this question

5 Answers 5

I'm in a similar situation, and am never confident to run my 2010 mini headless for this very reason since Lion, or even before that.

Running Mountain Lion (10.8.3), Remote Management is turned off, and I think the problem may stem from issues with authentication. When I can't connect through Screen Sharing, I turn on the projector to see what it's doing. After I enter the screen saver password and get to the desktop, Screen Sharing works again.

I'm going to try running the mini without any screen saver password to see what happens.

I'm also running Rowmote Pro and Little Snitch, and am inclined to think the former would be more problematic as it's an additional input method.

I'll report back later with my findings.

share|improve this answer
    
So far so good. Screen saver password's disabled, and am connecting to the mini via static IP. –  Julius O May 23 '13 at 18:07

Screen sharing by itself worked perfectly well when enabled in my Mac Mini sharing preferences. However, as soon as I enabled Remote management, it removed Screen sharing and stopped working claiming that Screen sharing is handled by Remote management … what ever that is. I just disabled Remote management and used Screen sharing to get around the problem.

share|improve this answer

ssh into the remote Mac and kill the screensharingd daemon.

$ ps ax | grep screen
1234   ??  Ss     0:00.02 /System/Library/CoreServices/RemoteManagement/screensharingd.bundle/Contents/MacOS/screensharingd
$ sudo kill 1234 

It works for me. I have Mac OS X Lion on both local and remote computers.

share|improve this answer

Logging out of MobileMe in System Preferences instantly fixed the issue for 2 coworkers who were having the same issue. They were both on 10.7.4- not sure if it affects lower versions. My system on 10.8 obviously was not affected as the MobileMe settings have been removed from System Preferences.

share|improve this answer

Logging out of MobileMe on the client machine solved this problem for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.