Chrome 远程桌面远程访问进入当前打开的会话

Chrome 远程桌面远程访问进入当前打开的会话

我想在 xorg 家用电脑上设置对我的 Ubuntu 20.04 LTS 的远程访问。

远程支持功能运行良好,但远程访问功能将我记录在单独的会话(默认 gnome 或 ubuntu)中,而不是计算机上当前活动的会话(如果我移动客户端鼠标,它在主机电脑屏幕上不可见)。

有没有简单的方法可以改变这种行为?

答案1

创建一个配置目录,以便 chrome/chromium/firefox 插件能够识别 chrome-remote-desktop 的安装:

mkdir ~/.config/chrome-remote-desktop
/opt/google/chrome-remote-desktop/chrome-remote-desktop --stop

更改特定的配置以防止会话破坏:(远程将使用与主机相同的会话。)

sudo nano /opt/google/chrome-remote-desktop/chrome-remote-desktop

DEFAULT_SIZES = "1920x1080"
FIRST_X_DISPLAY_NUMBER = 0
# while os.path.exists(X_LOCK_FILE_TEMPLATE % display):
# display += 1
def launch_session(self, x_args):
self._init_child_env()
self._setup_pulseaudio()
self._setup_gnubby()
#self._launch_x_server(x_args)
#self._launch_x_session()
display = self.get_unused_display_number()
self.child_env["DISPLAY"] = ":%d" % display

在启动前禁用 chrome 远程会话的运行以防止“卡在登录循环错误”:

sudo nano /etc/init.d/chrome-remote-desktop
#!/bin/bash
exit 0
[ rest of file]

将 Chrome 远程桌面添加到启动应用

name: chrome remote desktop
command:/opt/google/chrome-remote-desktop/chrome-remote-desktop --start
description: starts CRD after login

解决方案来源:(步骤6及以后) https://github.com/GObaddie/ubuntu_chrome_remote_desktop 谢谢 GObaddie!

答案2

我按照此处的信息摆脱了颜色配置文件密码提示:https://unix.stackexchange.com/questions/417906/authentication-is-required-to-create-a-color-profile

上面的其他信息很接近,但这些差异显然是针对旧版本的 Chrome 远程桌面。这里有一个更新: https://github.com/GObaddie/ubuntu_chrome_remote_desktop/issues/5#issuecomment-1112305357

但是,尽管该差异适用于最新的 Chrome 远程桌面,即使有了其他信息(包括禁用 wayland),我仍然无法让 Chrome 远程桌面在 Ubuntu 22.04 上启动。:-(

答案3

对于 ubuntu 22.04 唯一改变的是 launch_session,它应该看起来像这样,其余的都像原始解决方案一样:

def launch_session(self, server_args, backoff_time):
   """Launches process required for session and records the backoff time
   for inhibitors so that process restarts are not attempted again until
   that time has passed."""
   logging.info("Setting up and launching session")
   self._init_child_env()
   self.setup_audio()
   self._setup_gnubby()
   display=self.get_unused_display_number()
   self.child_env["DISPLAY"]=":%d" % display

   #self._launch_server(server_args)
   #if not self._launch_pre_session():
     # If there was no pre-session script, launch the session immediately.
   #  self.launch_desktop_session()
   self.server_inhibitor.record_started(MINIMUM_PROCESS_LIFETIME,
                                     backoff_time)
   self.session_inhibitor.record_started(MINIMUM_PROCESS_LIFETIME,
                                    backoff_time)

其余的应该是一样的

后来编辑:我重新做了这个,我设法找出我忘了告诉你的事情:你应该搜索 get_unused_display_number() 并用 return 0 替换 return display (这确保你每次都获得相同的会话)

相关内容