Skip to content

Speedier screen sharing startup in Sonoma

macOS Sonoma introduces a revised Screen Sharing application that lives in the Applications → Utilities folder1Though that's not really where it is, but that's not important…. It presents a list of recently-connected devices:

Select one, and you'll see the username and password dialog for that machine. While the GUI is nice to have, it's also slower than the old method: In Ventura and earlier, you could launch the (not in Utilities) Screen Sharing application, and start typing the IP address:

Select the host from the list, and you were done. This is much quicker than launching an app and waiting for the GUI, then navigating and selecting the desired machine. After just a bit of digging, I found a much quicker way to connect to my Macs in Sonoma (and earlier versions of macOS): The "vnc" URL scheme.

Paired with Keyboard Maestro or similar tool of your choosing, remote access can be incredibly easy and fast (and possibly insecure, if you so choose).

Connecting to a Mac (or other machine) on your network can be done via Terminal or AppleScript very easily. In Terminal, you can connect with this command:

open vnc://user@host

Replace user with your user's short username (i.e. the name on your home folder in Finder), and host with the IP address of the other machine. When you press Return, you'll be greeted by the username/password prompt to connect to the remote machine.

And if you don't care about passwords in plain text and onscreen, you can even skip that step with this format:

open vnc://user:password@host

Do that, and you'll directly connect without any dialog. But as noted, the password(s) for your other Mac(s) is now in plain text, logged, and possibly stored in a script if you choose to go that route. It's up to you as to whether that's worth saving press Return or not—for me, it's not.

In AppleScript, you could do the above with a do shell script action, or directly via the Screen Sharing application:

tell application "Screen Sharing"
    GetURL "vnc://user@host"
end tell

As before, you can make this instantaneous and insecure by using user:password to skip the login dialog box.

Because I use this feature a lot, I wrote a quick Keyboard Maestro macro to make it simple to connect to any of my three Macs.

When I press the macro's defined hot keys, I see the pop-up menu at right; I've posted the macro over on the Keyboard Maestro forums, but it's ridiculously simple—just a Prompt With List action with the IP addresses encoded, and then pass the chosen entry's IP address to a Shell Script action with the open vnc... bits in it.

I did add a bit of logic so you can't select the Mac you're currently using, but that was also very simple and added no steps, just a couple of conditions, to the macro.

These timesavers won't help when I need to connect to a relative's Mac for tech support, but they make my in-home screen sharing sessions much quicker to launch.

2 thoughts on “Speedier screen sharing startup in Sonoma”

  1. I use ScreenSharingMenulet by Stefan Klieme which sits in the Menubar and is a quick and handy way to launch Screen Sharing sessions. Default is systems on your local networt advertising via mDNS but there is alo the ability to add systems to a My Computers list for those that don't use mDNS. Nice, simple and hany app.

  2. > When you press Return, you'll be greeted by the username/password prompt to connect to the remote machine.

    Maybe I'm missing something, but when the credentials of my remote Mac are stored in the keychain of my local Mac, I do not get the username/password prompt when I run "open vnc://user@host". Instead, Screen Sharing shows me the remote screen right away. So there would be absolutely no benefit in including the plain text password in that command (which really would be a terrible idea anyway).

    Keyboard Maestro tells me that I've used similar quick connect macros for a little over 8 years. Up until now, those KM macros were based on using Finder's "Connect to Server…" menu command, which works fine, but your solution is so much more elegant and about a second faster, so thank you very much for this hint!

Leave a Reply

Your email address will not be published. Required fields are marked *