9

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?

1
  • I fixed a similar issue in 10.14 after a power cut, where the Mac Mini was visible on the network, and advertised its Screen sharing capability, but would not connect. I fixed it by switching my Mac Mini's networking preferences' "Configure IPv4:" from "Using DHCP with manual address" to just "Using DHCP". I guess there was some issue with everything including the router coming back online at the same time, and there was some IP conflict.
    – Cai
    Commented May 15, 2019 at 10:56

6 Answers 6

8

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.

1
  • Still plaguing me on Catalina 10.15.6 -> 10.15.4 (to a Mac mini in a data center) and this fixes the issue promptly. Thanks so much!
    – owenfi
    Commented Aug 8, 2020 at 3:08
2

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.

1

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

1

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.

0

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.

1
  • So far so good. Screen saver password's disabled, and am connecting to the mini via static IP.
    – Julius O
    Commented May 23, 2013 at 18:07
-3

Guys check the Firewall - it need to be disable or create an exception . thats the most common issue and this always works.

You must log in to answer this question.

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