I'm running macOS Mojave on a Mac Mini. Built-in VNC server works perfectly when you connect for the first time after reboot, however if you disconnect from it for more than five minutes you can't connect again - it displays the username that was used for the last session and a spinning wheel. Connecting via ssh and killing screensharingagentd doesn't help, only a reboot does. I've verified all the power saving settings are off. There are two virtual machines with macOS High Sierra and Sierra running on this same Mac Mini and I can connect to them without any issues.
With the iMac at work, we had to turn OFF the option under
System Preferences - Sharing - Screen Sharing - Computer Settings to allow
VNC viewers may control screen with password. Then VNC Viewer prompts for the username & password of the iMac (assuming
Only these users: is selected for
Allow access for). Multiple connections work fine with that setting disabled. Hope this helps.
From this article:
Apple have added a new security layer to macOS 10.14 Mojave. After upgrading your Mac to Mojave, VNC Server will allow only view-only remote access until such time as you've granted access to the vncagent application (installed as part of VNC Server).
To do this, open System Preferences > Security & Privacy > Privacy > Accessibility. Click the lock button to make changes, and + to add a new app to the list allowed to control your computer. Navigate to
/Library/vnc/vncagentand select the Open button
Some more detail, as I'm seeing very similar behaviour, possibly the same.
Using RealVNC client connecting to RealVNC server on Mojave, works perfectly every time. Using this method you are connecting via the cloud using RealVNC to negotiate a session.
Using RealVNC client connecting to Macs own "ScreenShare" utility, via bonjour or local IP address, does not use the RealVNC server, and works for the first few attempts, but leave it for 5 minutes without logging in, then try again and it fails exactly as described, Lockscreen with User's name and picture, but a spinning wheel beneath, with no option to login.
Reconnecting via RealVNC server is still possible whilst in this state.
Stopping and starting ScreenSharing only kills the window with the spinning wheel, it has no other effect.
A reboot of the MAC, and it works again....for a while.
Worked fine on High Sierra.
Apologies that this is as an answer but I lack enough reputation to add it as a comment.
I had exactly the same issue so I took to contacting Apple for support. After a lot of back and forth trying to explain the issue I was eventually given this response.
So, regarding this specific setup, this is something outside of normal consumer support that we can assist with. I can, however get you in contact with our business department who works with remote server access and can help provide you with more details moving forward. For those steps, this would require contacting our phone support. Would you like for me to schedule a time for you, or would you prefer the phone number to get in contact with them at your leisure?
Give me the number and I'll see when I can get a call done.
Sure thing - here is the main AppleCare support number: 1-800-275-2273 I will also email you our case number as well. When you contact them, you can let them know that you are looking to speak with our business support team regarding a remote server issue, and they will get you route you to the right place.
and so we're totally clear remote screen sharing is not supported for normal users only for businesses?
That is correct
So from that if you are an end user who isn't prepared to go through business support good luck.
This seems to be a Mojave bug.
sudo pkill loginwindow work-around will logout the current user on the machine and kill all it's processes.
sudo defaults write /Library/Preferences/com.apple.RemoteManagement VNCAlwaysStartOnConsole -bool true
It takes effect immediately (without reboot), and lets you connect directly to the current session, with only the VNC password.