How to stop display from turning off when I disconnect a Screen Sharing client

I have a Mac which I connect to using Screen Sharing to log in and start a video playing. Since upgrading to El Capitan, when I quit the screen sharing client, the screen on the remote machine turns off. How do I stop this from happening, while still having the screen turn off normally after a few minutes of inactivity?


Run this command in the terminal to fix the external screen going blank on VNC disconnect. Works with Sierra OS.

sudo defaults write /Library/Preferences/com.apple.RemoteManagement RestoreMachineState -bool NO

More context from jabenninghoff on GitHub:

In newer versions of macOS, screen sharing will automatically re-lock the screen when you disconnect if it was locked when you first connected.


Under System Preferences > Sharing, use “Remote Management” instead of “Screen Sharing”, as shown here:

Screenshot of Sharing Preference Pane

As far as I can tell, everything else works the same but the screen no longer turns off when you disconnect a Screen Sharing connection.

edited to add: this is under 10.11.3