0

I need TeamViewer on my Mac to work remotely. I installed it via ssh using the command line

brew cask install teamviewer

which worked fine.

However, I seem to be unable to configure TeamViwer from the command line. Due to Corona, I cannot personally access the Mac at the moment, which means I have to do everything via ssh.

I tried

$ /Applications/TeamViewer.app/Contents/MacOS/TeamViewer

which fails with

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Could not find domain for
Could not find domain for
2020-03-23 18:53:18.935 TeamViewer[1695:9920] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted

and then stops until I exit with Ctrl+C.

I also tried this answer, which gave me

$ open /Applications/TeamViewer.app

LSOpenURLsWithRole() failed with error -610 for the file /Applications/TeamViewer.app.

and

$ sudo open /Applications/TeamViewer.app

LSOpenURLsWithRole() failed with error -10810 for the file /Applications/TeamViewer.app.

Furthermore, the path Library/Preferences/com.teamviewer.* does not exist.

What do I have to do next? What else can I try?

3
  • 1
    See apple.stackexchange.com/questions/181026/… [I don't want to vote to close as a duplicate, as I have one-vote-close rights for this tag, so let us know if that helps]
    – Tetsujin
    Mar 25, 2020 at 18:26
  • @Tetsujin Unfortunately, none of the answers work... I suspect it has something to do with the answer of TinyTimZamboni. However, I can obviously not access my Mac right now Mar 25, 2020 at 19:27
  • I think the Mac cannot open a window/the window server because no on is physically logged in; only me via ssh. Mar 25, 2020 at 19:33

1 Answer 1

2

This should work (sudo privs required!)

  • Login with ssh on the remote Mac
  • Enter:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart  -activate -configure -access -on -privs -all -restart -agent 
    

    to enable remote management

  • open Screen Sharing locally (/System/Library/CoreServices/Applications/Screen Sharing.app)

  • Enter the IP of the remote Mac
  • Enter your remote user creds
  • Log in with your remote user creds at the login screen
  • Launch and configure TeamViewer

Depending on the security settings of the remote network (firewall etc.) you have to use the same tunnel/channel as the ssh connection.

The steps above only work for macOS up to High Sierra (10.13.6).


In macOS Mojave and later kickstart only works with managed devices and special profiles, if screen sharing wasn't enabled previously:

Use the kickstart command-line utility in macOS Mojave 10.14 and later

Eventually, you have to access the remote Mac personally and set up screen sharing in System Prefs > Sharing (to access it via VNC) or launch and configure TeamViewer.

4
  • When I try to access the Mac via screen sharing, nothing happens. It seems the mac cannot be reached... Previously, I also tried other methods of Remote Management including access via VNC from Windows 10 and Ubuntu. Neither worked. Mar 25, 2020 at 21:26
  • I checked that when I was still able to access it physically; firewall (at least mac-default one) is disabled. Maybe some firewall somewhere along the network blocks this... Mar 25, 2020 at 21:31
  • I use a VPN to get into the network. Then I ssh into the Mac via its local IP. Mar 25, 2020 at 21:35
  • Side note: If possible I want to be able to connect to the Mac from a Windws 10 machine and VNC (without relying on using my Macbook and RemoteManagement...). This hasn't worked so far... Mar 25, 2020 at 21:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .