Install Chrome Remote Desktop on a Headless Ubuntu 22.04 Server

Install on Chrome Remote Desktop on a Headless Ubuntu 20.04 Machine (1)

Chrome Remote Desktop is a remote desktop tool developed by Google. It uses a proprietary protocol, unofficially called Chromoting.

In this tutorial, we’ll install Chrome Remote Desktop on a headless remote machine (typically a server) running Ubuntu 22.04, along with the XFCE desktop environment, then connect to it via Google Chrome browser and use it as a remote desktop.

When a machine/computer is headless, it means it operates without a monitor, GUI (Graphical User Interface), or peripherals (keyboard, mouse).

This tutorial should work for regular computers as well.

Should you be interested in other remote desktop technologies for Ubuntu, we also have written detailed tutorials for VNC, Remote Desktop Protocol (RDP via a software called xRDP), NX (via a software called X2Go), or Xpra. They all have similar goals; however, their methods for achieving them differ.

Prerequisites

  • A Ubuntu 22.04 machine with a recommended minimum of 2GB RAM. (I use a cheap 12GB RAM VPS from Contabo as a remote desktop and for various development tasks. You can check out my review of Contabo here.)
  • A non-root sudo user. Being logged in as root isn’t recommended because you can risk harming your system if you’re not careful.

Step 1 – Install Chrome Remote Desktop on Ubuntu 22.04

  1. Update the package index and install wget
    sudo apt update
    sudo apt-get install -y wget
  2. Download the Debian Linux Chrome Remote Desktop installation package
    sudo wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
  3. Install the package you just downloaded and its dependencies
    sudo dpkg --install chrome-remote-desktop_current_amd64.deb
    sudo apt install -y --fix-broken

Step 2 – Install an X Windows System Desktop Environment

You need to install an X Windows System desktop environment and window manager to be able to use Chrome Remote Desktop.

Some of the most popular ones include:

  • XFCE
  • Cinnamon
  • LXDE
  • LXQt
  • GNOME
  • MATE Desktop
  • KDE Plasma 5

For this example, we’ll install XFCE.

  1. In your SSH session, install XFCE by running the following command:
    sudo DEBIAN_FRONTEND=noninteractive apt install -y xfce4 desktop-base
  2. Configure Chrome Remote Desktop to use XFCE by default: The DEBIAN_FRONTEND=noninteractive parameter suppresses a prompt that would have asked you to configure the keyboard layout.
    sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/xfce4-session" > /etc/chrome-remote-desktop-session'
  3. XFCE’s default screen locker, called Light Locker, doesn’t work well with Chrome Remote Desktop. The screen goes blank and can’t be unlocked. We’ll install XScreenSaver as an alternative:
    sudo apt install -y xscreensaver
  4. (Optional) So far we installed the minimal installation of XFCE. If you’d like to install the full suite of software that comes with XFCE desktop, run the following:
    sudo apt install -y task-xfce-desktop

Switching Desktop Environments for Chrome Remote Desktop

If you’d like to install multiple desktop environments and switch between them, then you can check this very short write-up on switching the desktop environment from the command line for Chrome Remote Desktop.

Step 3 – Configure Chrome Remote Desktop

  1. In your SSH session, run the following command to add your user to the chrome-remote-desktop group:
    sudo usermod -a -G chrome-remote-desktop $USER
  2. On your local computer, using your Google Chrome browser, go to the remote desktop command line setup page: https://remotedesktop.google.com/headlessThis is how it looks like at the time of writing.word image 8
  3. In the Set up another computer section, click Begin.
  4. In the next page, we’re presented with options to download links for Chrome Remote Desktop. Since we’ve already installed it on our remote machine, click Next.word image 9
  5. On the next screen, click Authorize. This means that you allow Chrome Remote Desktop to access your account. If you’re logged into multiple accounts, then you’ll have to select which account you want to allow access to.word image 10
  6. After that, the page displays the command that you’ll have to run, depending on your OS (Windows/Debian) and your command line shell:word image 11The code looks something like this:
    DISPLAY= /opt/google/chrome-remote-desktop/start-host \
    --code="4/xxxxxxxxxxxxxxxxxxxxxxxx" \
    --redirect-url="https://remotedesktop.google.com/_/oauthredirect" \
    --name=

    The command links your remote machine with your Google Account using the authorization code. The authorization code is the parameter that looks like 4/xxxxxxxxxxxxxxxxxxxxxxxx

    We’re using Ubuntu 22.04, which is Debian based, so we’ll use the Debian Linux command.

    Copy and run the command on your remote machine.

  7. Run the command in your SSH window.
    • If you’re prompted to enter a name for the computer, you can enter anything you like
    • When prompted to enter a PIN with at least 6 digits, enter any PIN you’d like to use. You’ll use this PIN as a password when connecting to the remote desktop in Google Chrome.

    Here is the command I ran:

    DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/0AY0e-g5vJrJF7iw3I9Kc5tO8KFRZ3GPfKBPP61at LWvyczaP0sF9mhX4BizyZmICAUR7yg" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$(hostname)

    Here is my output:

    Enter a PIN of at least six digits:
    Enter the same PIN again:
    
    [0318/171746.983120:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
    [0318/171747.062520:INFO:host_stopper.cc(38)] Stopping existing host: 610ad6c6-9078-424d-8938-b099d965c5ac. This may take a few seconds.
    [0318/171747.075063:ERROR:cert_verify_proc_builtin.cc(559)] No net_fetcher for performing AIA chasing.
    [0318/171747.110841:ERROR:service_client.cc(132)] Received error code: 7, message: The caller does not have permission[0318/171747.820448:INFO:daemon_controller_delegate_linux.cc(99)] Killing process 18032
    [0318/171748.612246:INFO:daemon_controller_delegate_linux.cc(99)] 2021-03-18 17:17:48,603:INFO:User 'edxd' is already a member of 'chrome-remote-desktop'.
    [0318/171750.087701:INFO:daemon_controller_delegate_linux.cc(99)] [0318/171748.719199:INFO:remoting_user_session.cc(754)] Daemon process started in the background, logging to '/tmp/chrome_remote_desktop_20210318_171748_coqBUz'
    
    WARNING: This system uses GDM. Some GDM versions have a bug that prevents local login while Chrome Remote Desktop is running. If you run into this issue, you can stop Chrome Remote Desktop by visiting https://remotedesktop.google.com/access on another machine and clicking the delete icon next to this machine. It may take up to five minutes for the Chrome Remote Desktop to exit on this machine and for local login to start working again.
    
    Using host_id: 1198f230-a125-4836-84ee-9af63fd22b8d
    Launching X server and X session.
    Starting Xvfb on display :20
    X server is active.
    Launching X session: ['/bin/sh', '/etc/chrome-remote-desktop-session']
    Launching host process
    ['/opt/google/chrome-remote-desktop/chrome-remote-desktop-host', '--host-config=-', '--audio-pipe-name=/home/edxd/.config/chrome-remote-desktop/pulseaudio#d68353f7c2/fifo_output', '--server-supports-exact-resize', '--ssh-auth-sockname=/tmp/chromoting.edxd.ssh_auth_sock', '--signal-parent']
    
    Host ready to receive connections.
    Log file: /tmp/chrome_remote_desktop_20210318_171748_coqBUz

Step 4 – Connect to the Remote Machine via Chrome Remote Desktop

Now, you should be able to connect to the remote machine using the Chrome Remote Desktop web application.

  1. On your local computer, visit the Chrome Remote Desktop website. If the setup worked, then you should see your Ubuntu 22.04 machine’s name listed in the Remote devices section of the page. I have a remote server with the hostname rdp that I created for this tutorial. Here is how the page looks like to me:word image 12
  2. Click the name of your remote machine. It should load for a few seconds, then show a form where you’ll have to enter the PIN you set on the remote machine earlier:word image 13
  3. Enter your PIN and click on the blue arrow.
  4. Now, you should be connected to your Ubuntu 22.04 remote machine via Chrome Remote Desktop. If you see a black screen with animations, that’s the screensaver. Just click somewhere, and it should disappear.word image 14
  5. You can check some additional options that Chrome Remote Desktop offers, such as sharing your clipboard from your local machine to your remote machine, and others, by clicking on the small arrow at the right of the screen.
    word image

Well done. Now, you should have an easily accessible Ubuntu 22.04 remote desktop by using Google Remote Desktop.

We also recommend you check out the Google Cloud docs for Chrome Remote Desktop under:

Frequently Asked Questions

Does Chrome Remote Desktop work on Debian?

Yes, Chrome Remote Desktop works on Debian, as well as Debian-based systems.

What OS is Chrome Remote Desktop compatible with?

Chrome Remote Desktop is compatible with Windows, macOS, Linux (including Ubuntu, Debian, and other Debian-based distros), and ChromeOS, and there is also support for Android and iOS through mobile apps.

Is Chrome Remote Desktop better than AnyDesk?

Whether Chrome Remote Desktop is better than AnyDesk depends on your requirements. Chrome Remote Desktop is simple and integrates well with Google services, while AnyDesk generally offers lower latency, better performance, and more features for professional use.

Conclusion

If you’ve encountered any issues, then feel free to let us know in the comments or contact us, and we’ll get back to you as soon as we can.

0 Shares:
Subscribe
Notify of
guest
Receive notifications when your comment receives a reply. (Optional)
Your username will link to your website. (Optional)

12 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Gãs
Gãs
2 years ago

OMG! this is awesome. thank you for your explanation. it worked very well

oscar
oscar
1 year ago

i have ubuntu 22 desktop i skipped the gui setting up part but everything else worked. but when i logged into the computer remotely it asked what gui i wanted to use it had gnome classic and like 5 other choices. i chose gnome-classic and now when i log in i get a dark screen with an x how can i change the desktop choice again?

Jimi
Jimi
1 year ago

Thanks for sharing. It worked perfectly. I am running the full Ubuntu desktop version. Now that I got it working using XFCE I am wondering how I can alter your instructions to utilize the GNOME desktop since that is the default for Ubuntu desktop.

Easy55
Easy55
1 year ago

I am stuck on: usermod: group ‘chrome-remote-desktop’ does not exist
At Step 3.1

colemarc
colemarc
1 year ago
Reply to  Easy55

Of course, because installing the pakage [chrome-remote-desktop_current_amd64.deb] is only the first part of the install procedure for Chrome Desktop. That group does not exist yet. The rest of the procedure is explained here: https://remotedesktop.google.com/headless
I believe EdXD forgot that he already did the installation once.

Kevin
Kevin
1 year ago
Reply to  colemarc

The rest of the procedure is not really explained there. Once I copy and paste the command from there to assign a host, I still can’t run the usermod command as it still does not exist

Kevin
Kevin
1 year ago
Reply to  colemarc

I did get it working though, using https://cloud.google.com/architecture/chrome-desktop-remote-on-compute-engine#gnome.

I did not have to add the user to the group and the command still does not work.

CRD does work, but now it disables my monitor. Is there a way to enable both?

Thank you

Clarence
Clarence
1 year ago

How do you stop Chrome Remote Desktop?
I can disconnect, but I only use the GUI occasionally, so I don’t want to leave it running.

David
David
1 year ago

Hi there! I’m new to Ubuntu and wanted to monitor my laptop from my iphone so i find your toutorial to make chrome remote desktop work on linux. Did all your steps and made it work BUT i don’t see the same things happening in mi laptop on my iphone… i just see a different desktop wth some icons…

  1. Do you know how can i see a mirror version of my screen?
You May Also Like