Why I can't open an application with ssh?

故事扮演 提交于 2021-02-05 06:41:27

问题


I have a problem to open an application with the Terminal on mac. I'm using a Macbook (running on High Sierra 10.13.6) and want to open an application on a remote computer using ssh. This remote computer is a Imac (MacOS Catalina).

I try to launch an application using the following command line :

open -a TeamViewer

but it fails to open and returns the following error message:

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

Does anyone have an idea of how to solve this problem ?

Thanks,


回答1:


It is because you are trying to open TeamViewer as root. I'm assuming the root user doesn't have a window manager open.

You could log into the Mac as root via the Mac login screen and then try ssh into the machine as root and try to open TeamViewer again but it would be easier and less bat5h1t if you just used w to see who's logged in, then login [username-thats-logged-in] then open TeamViewer.

hope this helps.




回答2:


You are attempting to run the Teamviewer Gui application, either as a different user to the currently logged in user or no user is logged in at all so the application doesn't have permission or there is no user display server to connect to.

If you've installed TeamViewer it should also install the appropriate LaunchDaemons and start the service when the machine starts.

/Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist

In this file I find the command to start the teamviewer service:

/Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service -Module Full

When I run this command (you may want to background or nohup it) I can see the server process running:

77890 ttys000    0:00.34 /Applications/TeamViewer.app/Contents/MacOS/TeamViewer_Service -Module Full

Depending on how teamviewer is configured on that machine. It may listen for LAN connections and/or establish a connection to the teamviewer cloud servers.

You can use netstat or lsof to verify this.

Mark



来源:https://stackoverflow.com/questions/61104846/why-i-cant-open-an-application-with-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!