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

macosscreen-sharing

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?

Best Answer

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.