Chrome Remote Desktop Remote Access into curently opened sesion

I would like to setup remote access to my Ubuntu 20.04 LTS on xorg home pc.

Remote Support feature works fine, but Remote Access feature logs me in a separate session (default gnome or ubuntu) instead of the currently active session on the computer (if i move the client mouse it’s not visible on the host pc screen).

Is there a simple way to change this behavior?

Asked By: dnikic

||

Make a config girectory so that chrome-remote-desktop instalation is recognized in the chrome/chromium/firefox addon:

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

Change specific cofigs to prevents session clobbering:
(Remote will use the same sesion as host.)

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

Disable runing of chrome remote sesion before startup to prevent "stuck at login loop bug":

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

Add Chrome Remote Desktop to startup applications

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

Solution source:
(Steps 6 and later )
https://github.com/GObaddie/ubuntu_chrome_remote_desktop
Thank you GObaddie!

Answered By: dnikic

I got rid of the color profile password prompt by following the information here: https://unix.stackexchange.com/questions/417906/authentication-is-required-to-create-a-color-profile

The other information above was close but those diffs are apparently for an older version of Chrome Remote Desktop. There’s an update here:
https://github.com/GObaddie/ubuntu_chrome_remote_desktop/issues/5#issuecomment-1112305357

But although that diff applies to the latest Chrome Remote Desktop, even with the other information (including disabling wayland) I am still unable to get Chrome Remote Desktop to start up on Ubuntu 22.04. 🙁

Answered By: Steve Lemke

For ubuntu 22.04 the only thing that changed is the launch_session, it should look like this, the rest are like in the original solution:

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)

The rest should be the same

LATER edit:
I have remade this and I managed to find out what I forgot to tell you:
You should search for get_unused_display_number() and replace return display with return 0 (this ensures you get the same session every time)

Answered By: Claudiu T