Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ephemient/ede65b2e848a2f246cd9412e9e7b7917 to your computer and use it in GitHub Desktop.
Save ephemient/ede65b2e848a2f246cd9412e9e7b7917 to your computer and use it in GitHub Desktop.
Chrome Remote Desktop - DISPLAY=:0 sharing
[Unit]
Description=Chromoting Server for X11
Requires=display-manager.service
Wants=network-online.target user@%i.service
After=display-manager.service network-online.target
[Service]
User=%I
Group=chrome-remote-desktop
PermissionsStartOnly=true
Environment=DISPLAY=:0 XAUTHORITY=%t/x11chromoting@%i/.Xauthority
ExecStartPre=/bin/sh -ec ' \
su sddm -s /bin/sh -c \' \
set -e; \
for i in /var/run/sddm/*; do \
xauth -f "$$i" -q -i nlist; \
done\' | \
su "$(getent passwd "%I" | awk -F: \'{print$$1}\')" -g chrome-remote-desktop -s /bin/sh -c \'xauth nmerge -\''
ExecStart=/opt/google/chrome-remote-desktop/chrome-remote-desktop-host --host-config="${HOME}/.config/chrome-remote-desktop/host#????????????????????????????????.json"
RuntimeDirectory=x11chromoting@%i
Restart=always
StartLimitInterval=0
RestartSec=1
[Install]
WantedBy=graphical.target
@ephemient
Copy link
Author

Notes:

  • Assumes it can grab xauth MIT-MAGIC-COOKIE from SDDM session manager's private runtime directory. Needs adjusting for other display managers.
  • Replace host#????????????????????????????????.json with the correct path generated after you set up the CRD host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment