chrome-remote-desktop, new X session

Solution 1:

Short answer: yes, but you need to use cinnamon for remote sessions. Local users can use Unity or whatever they want.

Symptoms: in remote session: xterm runs, gnome-terminal/nautilus does not.

Short fix:

sudo DEBIAN_FRONTEND=noninteractive \
    apt install --assume-yes cinnamon-core desktop-base

sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/cinnamon-session-cinnamon2d" > /etc/chrome-remote-desktop-session'

Long answer.

I recently tried to get chrome-remote-desktop on Ubuntu 20.04, and found that most of the instructions either ignore issues with sessions (gnome-terminal does not open, etc); or patch /opt/google/chrome-remote-desktop/chrome-remote-desktop with FIRST_X_DISPLAY_NUMBER = 0, etc, which is not helpful if I want to sign in with multiple accounts at the same time.

There are Google instructions on installing chrome-remote-desktop on virtual instance: https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine which insist on disabling the display manager. I decided to follow that guide but without disabling display manager. And it worked!

Step-by-step:

  1. Create additional [local] user accounts. Account which is used to setup remote access won't be accessible for regular sign in (at some point I was getting an error message from remote desktop where it blamed a bug in display manager; I tried gdm3, lightdm, and sddm with no luck).

Note: if you forgot to create an additional [local] account you can "unlock" it by visiting https://remotedesktop.google.com/ on another machine and deleting remote device you set up.

2.

# Install cinnamon
sudo DEBIAN_FRONTEND=noninteractive \
    apt install --assume-yes cinnamon-core desktop-base

# Select default session
sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/cinnamon-session-cinnamon2d" > /etc/chrome-remote-desktop-session'

# Download remote desktop.
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb

# apt install will install it together with dependencies.
sudo apt install ./chrome-remote-desktop_current_amd64.deb

# Allow this user to setup machine for remote access. 
# You will be logged in by this user when using chrome remote desktop.
# It is possible to list multiple users in this group, and access your machine with multiple remote sessions simultaneously. 
sudo usermod -a -G chrome-remote-desktop $USER

# Install Google Chrome (if not installed yet)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

  1. Go to https://remotedesktop.google.com/, and setup this machine for access.

  2. Reboot.

There are extra steps listed at https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine (like enabling clipboard), but I did not try it.

I was able to login to my machine with two users simultaneously using remote desktop (and run gnome-terminal in the cinnamon session), and third user running Unity desktop directly on machine.