Linux 我如何知道teamviewer 是否成功执行并获取会话ID 和密码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6968040/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 05:32:56  来源:igfitidea点击:

How do i know if teamviewer executed successfully and get the session id and password?

linuxubuntusshviewer

提问by PJ.

I am trying to run TeamViewer in a headless ubuntu OS. The OS is running as amazon ec2 AMI so I have no physical access to it. Currently, I just type the command "teamviewer" in ssh and the only output I get is something like:

我正在尝试在无头 ubuntu 操作系统中运行 TeamViewer。操作系统作为 amazon ec2 AMI 运行,所以我无法物理访问它。目前,我只是在 ssh 中输入命令“teamviewer”,我得到的唯一输出是这样的:

TeamViewer: 6.0.9258

Profile: /home/ubuntu (ubuntu)

Desktop:

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 10.04.3 LTS

Release: 10.04

Codename: lucid

Checking setup...

Launching c:\Program Files\TeamViewer\Version6\TeamViewer.exe...

团队查看器:6.0.9258

配置文件:/home/ubuntu (ubuntu)

桌面:

没有可用的 LSB 模块。

分销商 ID: Ubuntu

描述:Ubuntu 10.04.3 LTS

版本:10.04

代号:清醒

正在检查设置...

正在启动 c:\Program Files\TeamViewer\Version6\TeamViewer.exe...

Did it launch successfully? If so, how can I know the session id and password so that I can connect to it from another machine?

启动成功了吗?如果是这样,我如何知道会话 ID 和密码以便我可以从另一台机器连接到它?

回答by xmc

teamviewer doesn't work if xorg is not running.

如果 xorg 未运行,teamviewer 将不起作用。

回答by knb

Just an idea for a general strategy:

只是一个总体策略的想法:

You could try to grep the process-list for the ProcessID of wine TeamViewer.exe, take a screenshot of the window belonging to that process, save it to an image with a filename of your choice, and then download that image.

您可以尝试grep wine TeamViewer.exe 的ProcessID 的进程列表,截取属于该进程的窗口的屏幕截图,使用您选择的文件名将其保存为图像,然后下载该图像。

People have attempted to do similar things, (but in this case not with teamviewer, and on windows). How to get window's HWND from it's process handle?

人们曾尝试做类似的事情,(但在这种情况下不是使用 teamviewer,而是在 Windows 上)。 如何从它的进程句柄中获取窗口的 HWND?

回答by Daniel S

Given that you have a running X server (or Xvfb) and DISPLAY and XAUTHORITY are set properly, TeamViewer should start.

鉴于您有一个正在运行的 X 服务器(或 Xvfb)并且正确设置了 DISPLAY 和 XAUTHORITY,TeamViewer 应该会启动。

cat ~/.teamviewer/7/logfiles/TeamViewer7_Logfile.log | grep '^ID:'will give you the ID, but does not work on the first start. (The logfile symlink is created on the second launch). Of course you can also use the logfile to see if it started up properly. Wine problems are logged to ~/.teamviewer/7/logfiles/winelog)

cat ~/.teamviewer/7/logfiles/TeamViewer7_Logfile.log | grep '^ID:'会给你 ID,但在第一次启动时不起作用。(日志文件符号链接是在第二次启动时创建的)。当然,您也可以使用日志文件来查看它是否正常启动。葡萄酒问题被记录到~/.teamviewer/7/logfiles/winelog)

To get ID and password, taking a screenshot really is the simplest solution. Like above, DISPLAY and Xauthority must be properly set. Then,

要获取ID和密码,截图确实是最简单的解决方案。如上所述,必须正确设置 DISPLAY 和 Xauthority。然后,

xwd -name TeamViewer | xwdtopnm | pnmtopng > tvscreen.png

will do the trick.

会做的伎俩。

[Edit]

[编辑]

In TeamViewer 8 and above, the screenshot trick is not needed. From the command line, a password can be set and the ID can be printed See:

在 TeamViewer 8 及更高版本中,不需要截图技巧。从命令行,可以设置密码并打印 ID 参见:

teamviewer --help
teamviewer --info
teamviewer --passwd [PASSWD]