Google云虚拟实例:Chrome远程桌面指示远程计算机处于离线状态,但是Google云平台显示实例为运行

Google Cloud virtual instance: Chrome remote desktop indicates remote computer is offline, however Google Cloud Platform shows instance is running

我是 运行 Google 云中的虚拟机。我已经安装了默认的 Debian OS,并配置了远程连接的桌面环境,如下所述:https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine

我已经能够通过 Chrome 远程桌面连接到实例,但是我偶尔会遇到远程桌面显示虚拟机实例在线的问题,但是如果我尝试连接到它,我会得到:

查看Google云控制台,实例明明是运行。通常,如果我重新启动实例,问题就解决了,但是我不想停止实例上的进程 运行。

更新:

遵循 Serhii Rohoza I 的建议 运行

sudo systemctl status chrome-remote-desktop

状态看起来正常,列表:

Active: active (exited) since...

我然后运行

sudo systemctl restart chrome-remote-desktop

这解决了问题,我可以再次登录到远程桌面,但 VM 实例似乎已重新启动,这是一个大问题,因为我在其上的 运行 个进程不应关闭。我想这是一个问题,需要发送给 Google 云服务支持。

更新 2:

我仍然 运行 遇到这个问题。我通常在 VM 上有一个 Jupyter Notebook 运行 - 这个 Notebook 必须保留 运行。当我看到消息说远程计算机离线时,我通过 ssh 登录并检查 Jupyter Notebook 是否 运行:

jupyter notebook list

这返回:

http://localhost:8888/?token=9110bf40789971b5e252a272e9497039b4f3b45e506348df :: /home/qgenixtech

所以笔记本是 运行。然后我 运行:

sudo systemctl restart chrome-remote-desktop

然后又是:

jupyter notebook list

然后它显示没有笔记本 运行。所以重启命令关闭了笔记本(以及桌面上所有其他打开的windows)。

更新 3:

我在 Google 与支持技术人员交谈过。问题出在远程桌面端,而不是虚拟机。根据技术人员的说法,这是一个已知问题,因为他没有解决方案。他向我介绍了来自 Google 支持的这两个链接:

https://support.google.com/chrome/thread/10213547?hl=en

https://support.google.com/chrome/thread/3333421?hl=en

我的下一个选择是查看类似 X2go

的内容

要解决您的问题,您应该遵循文档 Troubleshooting 并使用以下命令检查 Chrome 远程桌面服务的状态:

 sudo systemctl status chrome-remote-desktop 

并检查 /tmp/chrome_remote_desktop_DATE_TIME_* 处的日志消息。

要调查您的 VM 实例重启的原因,您应该在日志中寻找一些线索:

  1. 转到 Compute Engine -> VM instances -> 单击 NAME_OF_YOUR_VM -> 找到部分 Logs -> 点击 Stackdriver Logging。您可以在文档 Viewing logs (Classic)

  2. 中找到更多信息
  3. 转到 Compute Engine -> VM instances -> 单击 NAME_OF_YOUR_VM -> 找到部分 Logs -> 点击 Serial port 1 (console)。文档中的更多信息 Viewing Serial Port Output

您也可以联系Google Cloud Support

此外,请查看文档 Setting instance availability policies

同样的问题。检查日志时我看到:

2021-01-05 14:29:38,319:INFO:Starting Xvfb on display :20
xdpyinfo:  unable to open display ":20".
2021-01-05 14:29:40,837:INFO:X server is active.

重新启动服务甚至虚拟机都不起作用。

我需要删除“客户端”上的连接并使用 /headless 重新授权 link