How to Fix Non-Responsive VNC Connection on Your Mac Mini

Hey there


i use VNC to remote into my Mac at home - 2020 Mac Mini, M1, 16GB RAM, 256GB SSD, Ventura 13.2.1. It keeps freezing on me, totally non-responsive and if i close VNC and try to reconnect it never does. This is both inside and outside of my home network. Doesn't matter which VNC client i'm using - Real, Ultra, Tight and Screens (Edovia) is doing the same thing.


After some testing i've found it's the screensharingd process which is crashing. As a workaround i've forwarded the SSH port from my router to SSH in and kill the process, which immediately restarts and i can VNC back in. The

more times i do this the more frequently it crashes and after killing it 6 or 7 times the machine needs restarting because screensharingd is crashing in under a minute.


This has been happening since before i upgraded to Ventura. I've run First Aid on both the disk and partition but that hasn't made a difference.


Aside from the inconvenience of it freezing while i'm in the middle of doing something, leaving the SSH port open on my router is making me a bit nervous.


A wipe and OS reinstall is usually my way of fixing anything i can't figure out straight away, but for various reasons just not possible right now.


Anyone seen this before? any ideas how i can fix it? Can i replace the screensharingd.plist file with one from my MBP?


Any suggestions greatly appreciated



[Re-Titled by Moderator]

Mac mini, macOS 13.2

Posted on Mar 20, 2023 4:57 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 22, 2024 8:28 AM

So, going to response to my own issue here. I revisited this thread about a week ago as I was continuing to have the problem with screensharingd crashing or locking up while in a screen sharing session.


I took note of the message by @Olivier Noma regarding attacks against port 5900. In hindsight, it was of course bad practice but I had port 5900 exposed externally so I could connect to my small home server from work or while traveling. So I decided to just delete the port forwarding rule one my router without any other change to see what happened.


Absolutely stable since. I don't know if this would address everyone's problem in this disscussion thread, but for me the issue was attacks against 5900. Imagine the service was getting overloaded when I was running a session and would crash. I'm not sure how likely Apple is able to fix that (if able).


Here's what I'm doing now when I want to remote into my servers (I have two in different locations).


1) I now use Tailscale, a solution I highly recommend. For those who aren't familiar I suggest you investigate because it's amazing and solves a lot of problems integrating devices across different networks. Essentially, when a I have a device on my Tailscale network it appears and sees all other devices on my Tailscale network a local device regardless of the network it's actually connected to (the mesh networking protocol is pretty amazing). Again, highly recommend this solution as it's free for personal/small scale use.


2) If I'm wanting to use Screen Sharing on a system where I cannot install Tailscale (like at work), I've left SSH service open on the router to the servers. Now, I'll run a tunnel through SSH so the VNC client connection is routed through the SSH tunnel and then once on the server connects 5900. It's an extra step but it works very well (is more secure) and SSH is not as vulnerable to attack as 5900.


Again, since switching to this setup about a week ago screensharingd has be completely stable. So, for me the problem is solved.

Similar questions

31 replies
Question marked as Top-ranking reply

Feb 22, 2024 8:28 AM in response to emptyrepublic

So, going to response to my own issue here. I revisited this thread about a week ago as I was continuing to have the problem with screensharingd crashing or locking up while in a screen sharing session.


I took note of the message by @Olivier Noma regarding attacks against port 5900. In hindsight, it was of course bad practice but I had port 5900 exposed externally so I could connect to my small home server from work or while traveling. So I decided to just delete the port forwarding rule one my router without any other change to see what happened.


Absolutely stable since. I don't know if this would address everyone's problem in this disscussion thread, but for me the issue was attacks against 5900. Imagine the service was getting overloaded when I was running a session and would crash. I'm not sure how likely Apple is able to fix that (if able).


Here's what I'm doing now when I want to remote into my servers (I have two in different locations).


1) I now use Tailscale, a solution I highly recommend. For those who aren't familiar I suggest you investigate because it's amazing and solves a lot of problems integrating devices across different networks. Essentially, when a I have a device on my Tailscale network it appears and sees all other devices on my Tailscale network a local device regardless of the network it's actually connected to (the mesh networking protocol is pretty amazing). Again, highly recommend this solution as it's free for personal/small scale use.


2) If I'm wanting to use Screen Sharing on a system where I cannot install Tailscale (like at work), I've left SSH service open on the router to the servers. Now, I'll run a tunnel through SSH so the VNC client connection is routed through the SSH tunnel and then once on the server connects 5900. It's an extra step but it works very well (is more secure) and SSH is not as vulnerable to attack as 5900.


Again, since switching to this setup about a week ago screensharingd has be completely stable. So, for me the problem is solved.

Jun 21, 2024 8:07 AM in response to M7skipper

I found a solution that works for me: change the VNC port.

I realized that port 5900 is prone to frequent attacks that cause input systems to freeze. I decided to try changing the VNC port.


On the remote computer, I opened the file /etc/services with VI and changed the VNC listening port from 5900 to 5905


rfb 5905/tcp vnc-server # VNC Server

rfb 5905/udp vnc-server # VNC Server


To connect I use the address

vnc://server:5905


The problem has not occurred again since. I hope this can help.


Oct 26, 2023 2:43 AM in response to yanis81

I finally have a way to reproduce the freeze any time.

I start to understand that the issue is about mouse input.

I'm saying that because I can see that the clock is still moving.


Let me explain the steps to reproduce :

1°) Open a pdf file with Preview.app (Aperçu) with multiple pages

2°) Select for example 2 pages

3°) Try to drag the 2 select pages to change the order of the pages in the PDF document

4°) as soon as you try your VNC session is freezed... you can't do anything.. expect restart the service.


Well, the feature is totally broken.


Is someone is able to reproduce the issue ?


Does apple plan to fix this issue ?


Jun 5, 2024 4:23 AM in response to M7skipper

It never happened with my 2011 Mini, it is a pain with the new Mini I bought weeks ago. I spent two hours with the Apple assistance. They made me do all the things I had already done, such as reinstall the OSX, clear all caches, reset SMC etcetera. Still freezing.

The assistance pretended tha sharing screen is a "pro activity" (!?) and proposed me to buy their pro app for screen sharing, about 80 USD, which I obviously did not buy.

I noticed that the problem is only the input devices, if I input from the local keyboard everything is fine and the shared screen works fine.

At the moment the only solution is connecting with SSH and keep reloading the service.


launchctl unload /System/Library/LaunchDaemons/com.apple.screensharing.plist

launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist


PS Since I have to keep the SSH open I moved it to another port for safety reasons.

Oct 26, 2023 5:17 AM in response to yanis81

I don't know what is causing this but I know that it does not happen to everyone. I have been happily screen sharing from my MBP to the Mac Studio in the work office, and it never crashed on me. This worked fine in Ventura and continues to work fine in Sonoma.


It works when I am in the same network and also when connecting from home. The office Mac has a fixed local IP and all I have to do is connect to the office network using VPN.

No third party software is involved. Just setup the VPN in System Settings, connect, and just start the built-in Screen Sharing application; or most of the time I just do it from Safari, by typing vnc://(address-of-mac)


I can't say that there is no issue with screensharingd, but maybe there is something else causing a conflict.


Jan 2, 2024 2:47 AM in response to yanis81

I confirm the same issue with Preview App, unfortunately, I'm with Sonoma 14.2.1 so it's the latest update...


I think there's other reasons because I managed servers and sharing crash even when the Mac is not used by anyone.


for servers, my (dirty) solution is to have a CRON than test the port 5900 and if it's off, restart ARD with kickstart, I used it for a long time.


It seems that at the first version of OS (Ventura an Sonoma), all seems to work normally but after some update 13.1, 14.1, the bug come back, perhaps one developer resolve the issue and another change something for a another issue that reveals the bug again...

Mar 21, 2023 2:48 PM in response to M7skipper

Hey M7skipper,


Thank you for posting in Apple Support Communities and sharing the details of what you are experiencing and the troubleshooting you have done.


We recommend verifying the settings for remote access to verify nothing has changed without your knowledge. Allow a remote computer to access your Mac - Apple Support


From there, we recommend reaching out to Apple Support directly so they can look into this with you further.



Take care!

Mar 6, 2024 11:10 AM in response to M7skipper

After dealing with this same issue for a year or so now, I may have found what fixed it for me. I use "noip.com" for my DNS service and have always used my DNS hostname to VNC into my iMac. I have now tried using my IP address instead and haven't had input freezes yet. I will update if it ends up failing, but hopefully it won't and maybe this can help someone in the same scenario.

Apr 18, 2023 3:56 AM in response to M7skipper

Hey, I have the exact same problem with nearly the exact same setup. The screen sharing service hangs and VNC or the Screen Sharing app in macOS stop being able to connect. I usually reboot the Mac via ssh in order to get back in.


Small nuances on my side. Previously I had a 2014 Mac Mini with Monterrey installed and never had this issue. I switched to an M1 Mac Mini (8GB RAM) and it's been a thing since macOS 13.2 for me.

Mar 23, 2023 2:27 AM in response to M7skipper

to add to this i'm getting 2 crash reports in the console every time it crashes:

1.

rocess: screensharingd [13376]

Path: /System/Library/CoreServices/RemoteManagement/screensharingd.bundle/Contents/MacOS/screensharingd

Identifier: com.apple.screensharing.daemon

Version: 3.9.8 (585.1)

Build Info: RemoteDesktop-585001000000000~381

Code Type: ARM-64 (Native)

Parent Process: launchd [1]

User ID: 0


Date/Time: 2023-03-22 22:57:36.8950 +0000

OS Version: macOS 13.2.1 (22D68)

Report Version: 12

Anonymous UUID: 3B0C3D5D-BF43-497A-413E-9C2A5578EBF6



Time Awake Since Boot: 15000 seconds


System Integrity Protection: enabled


Crashed Thread: 9 Authentication


Exception Type: EXC_GUARD

Exception Codes: GUARD_TYPE_USER

Exception Codes: 0x6000000000000012, 0x0000000000000002


Termination Reason: Namespace LIBSYSTEM, Code 2 Application Triggered Fault


2.:

Process: screensharingd [13376]

Path: /System/Library/CoreServices/RemoteManagement/screensharingd.bundle/Contents/MacOS/screensharingd

Identifier: com.apple.screensharing.daemon

Version: 3.9.8 (585.1)

Build Info: RemoteDesktop-585001000000000~381

Code Type: ARM-64 (Native)

Parent Process: launchd [1]

User ID: 0


Date/Time: 2023-03-22 22:57:36.8981 +0000

OS Version: macOS 13.2.1 (22D68)

Report Version: 12

Anonymous UUID: 3B0C3D5D-BF43-497A-413E-9C2A5578EBF6



Time Awake Since Boot: 15000 seconds


System Integrity Protection: enabled


Crashed Thread: 9 Authentication


Exception Type: EXC_BAD_ACCESS (SIGSEGV)

Exception Codes: KERN_INVALID_ADDRESS at 0x002000015b812e40 -> 0x000000015b812e40 (possible pointer authentication failure)

Exception Codes: 0x0000000000000001, 0x002000015b812e40


Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11

Terminating Process: exc handler [13376]


i don't know what this means! if the full report would help let me know and i'll paste the entire thing



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to Fix Non-Responsive VNC Connection on Your Mac Mini

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.