Sunday, 27 November 2022

How to setup a remote desktop using google chrome with headless PC?


ref: https://bytexd.com/install-chrome-remote-desktop-headless/


  • Update the package index and install wget
    sudo apt update
    sudo apt-get install -y wget
  • Download the Debian Linux Chrome Remote Desktop installation package
    sudo wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
  • Install the package you just downloaded and its dependencies
    sudo dpkg --install chrome-remote-desktop_current_amd64.deb
    sudo apt install -y --fix-broken
  • In your SSH session install XFCE by running the following command:
    sudo DEBIAN_FRONTEND=noninteractive apt install -y xfce4 desktop-base
  • 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'
  • 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
  • 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
  • On your local computer, using your Google Chrome browser, go to the remote desktop command line setup page: https://remotedesktop.google.com/headless






  • The code looks something like:
    DISPLAY= /opt/google/chrome-remote-desktop/start-host \
    --code="4/xxxxxxxxxxxxxxxxxxxxxxxx" \
    --redirect-url="https://remotedesktop.google.com/_/oauthredirect" \
    --name=
  • 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:

  • On your local computer visit the Chrome Remote Desktop website.If the setup worked, then you should see your Ubuntu 22.04/20.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:






  • No comments:

    Post a Comment