Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save XertroV/77357fb6917b822cd9a34e4bb456ee34 to your computer and use it in GitHub Desktop.
Save XertroV/77357fb6917b822cd9a34e4bb456ee34 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# This is a script to download patch/fix the setup and config so you can use
# chrome-remote-desktop via https://remotedesktop.google.com/headless
#
# crd = chrome-remote-desktop where convenient (like binary names)
#
# There are a few issues that need fixing:
# 1. the oauth onboard via the above link requires Google's binaries (i.e. the ones in the .deb)
# 2. paths don't match - fedora installs in /usr/lib64/chrome-remote-desktop instead of /opt/google/chrome-remote-desktop
# 3. the default method of crd script passing the client config to the crd-host binary via stdin didn't work for me; so patch to pass the filepath
# 4. the service will run under root's home instead of the users home and requires patching
# 5. gnome doesn't play nice (esp w/ wayland), so I install lxfc as a default desktop env; can be changed via ~/.crd-session later
#
#
sudo dnf install -y chrome-remote-desktop dpkg
CRD=tmp-crd
CRDDEB=crd.deb
CRD_INSTALL=/usr/lib64/chrome-remote-desktop
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb -O $CRDDEB
mkdir $CRD
dpkg -x $CRDDEB $CRD
# copy over new binaries from deb - allows for using the web headless oauth thing
for _file in start-host chrome-remote-desktop chrome-remote-desktop-host; do
sudo cp -av $CRD/opt/google/chrome-remote-desktop/$_file $CRD_INSTALL/$_file
done
# add symlink to mimic /opt/google install
sudo mkdir -p /opt/google/
sudo ln -f -b -s $CRD_INSTALL/ /opt/google/chrome-remote-desktop
# patch json stdin/file thing
sudo sed -i 's/host\-config=\-"/host-config=" + host_config.path/g' $CRD_INSTALL/chrome-remote-desktop
# whatever you replace this with - I've never had it work with anything using wayland, though your main display can still run wayland if you like.
sudo dnf install -y lxde-common
echo "exec /usr/bin/startlxde" > ~/.chrome-remote-desktop-session
#
# At this point you can run the headless setup and the server will start in the background
#
# TODO
# - patch chrome-remote-desktop to fix host config read
# - fix service to fix user runas and home dir
# - run start-host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment