Application Firewall is blocking Screen Sharing
I found that I have run into a bug on my M1 Mac.
Steps to reproduce:
- Enable Screen Sharing under System Preferences -> Sharing -> Screen Sharing
- Allow anyone, open settings up as wide as possible
- Enable Firewall under System Preferences -> Security & Privacy -> Firewall
- Make firewall as permissive as possible, Uncheck block all incoming connections, allow built-in software.
- Try to connect to MacBook Pro from another MacBook Pro, and it will fail. The connection times out.
Turning off the firewall solves this issue, but is insecure.
Notes:
- I also have Remote Login (SSH) turned on, and followed the exact same steps, and it has no problems. There seems to be something different about port 5900 or with the Screen Sharing app itself.
- I have taken network traces to confirm that the TCP packets are reaching my MacBook Pro, the SYN TCP packet is sent, but my MacBook Pro never replies.
- I have taken Console traces, however there does not appear to be any logs that would hint at what the root cause is.
- I have checked /var/log/appfirewall.log for messages, however this file is empty. I suppose it would only log blocked connections, which is interesting because this would indicate there is another firewall or bug that is blocking this connection, but not logging it anywhere that I could find.
It seems that others are having the same exact issue, please reference these two threads here:
Screen Sharing Blocked by Firewall Despit… - Apple Community
Firewall is blocking Screen Sharing - Apple Community
MacBook Pro 16″, macOS 12.4