Score:1

macOS: Open GUI application over SSH not possible

ng flag

I'm working on automating the installation of a macOS application using Ansible. I am installing the application by copying its .app folder from a .dmg image to the /Applications/ directory.

After doing this, I attempt to launch the application via SSH with:

sudo -u buildworker open -a /Applications/Name.app

However, I receive the following error message:

The application /Applications/Name.app cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed."

Strangely, if I log into the machine's GUI and manually start the application once, subsequent attempts to launch it via SSH work perfectly.

Has anyone encountered a similar issue before? Is there any way to "pre-initialize" the application so that it can be launched via SSH without a manual first-time GUI launch?

OS: macOS Monterey (12.6.7)

  • The app is not in com.apple.quarantine
  • I disabled gatekeeper The app
  • The app is completly signed for macOS
Score:0
ug flag

Did you try to login directly as "buildworker" user through SSH using X11 forwarding ?

You will need to enable X11 forwarding on both the server (https://manpages.debian.org/bullseye/openssh-server/sshd_config.5.en.html#X11Forwarding~2) and the client ("-X" cli option).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.