Skip to content

Instantly share code, notes, and snippets.

@metaquanta
Last active February 16, 2023 04:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaquanta/30755b1d3d4e44d931fccf012707736d to your computer and use it in GitHub Desktop.
Save metaquanta/30755b1d3d4e44d931fccf012707736d to your computer and use it in GitHub Desktop.
Setup Chromoting/CRD/Chrome Remote Desktop from the command line.
#!/bin/sh
# This assumes the package is installed.
# wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
# sudo apt install ./chrome-remote-desktop_current_amd64.deb
# # And maybe
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo apt install ./google-chrome-stable_current_amd64.deb
# # Fix the likely missing dependencies.
# sudo apt --fix-broken install
# Derived from https://askubuntu.com/a/953269/740127
echo " Open the following in a browser with your Google account:"
echo " https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/chromoting%20https://www.googleapis.com/auth/googletalk%20https://www.googleapis.com/auth/userinfo.email&redirect_uri=https://talkgadget.google.com/talkgadget/blank&response_type=code&client_id=440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.apps.googleusercontent.com&access_type=offline&approval_prompt=force"
# Ex: https://talkgadget.google.com/talkgadget/blank?code=0/XXXXXXxXXXXXXXXXXXXXxxxxXxXXXxXXXXXxx_XxxXX#
echo " Then paste the URL of the resulting blank page here:"
read input
REDIRECT_URL=`echo $input | /bin/grep -ohP '^.*(?=\?)'`
CODE=`echo $input | /bin/grep -ohP '(?<=\?code=).*#'`
NAME=`/bin/hostname`
echo " token found = $CODE"
echo " Now run the following:"
echo /opt/google/chrome-remote-desktop/start-host \
--code="$CODE" \
--redirect-url="$REDIRECT_URL" \
--name="$NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment