How to get Chrome Remote Desktop to Start on Boot

I use Chrome Remote Desktop as a convenient way to access my desktop while traveling. From time to time it will have issues that require restarting the PC remotely. However, Chrome Remote Desktop will not start automatically after rebooting. Thankfully I can SSH into the PC and start it manually with CRD --restart but I would like to avoid that process as it depends on a VPN connection and a few extra steps.

I know this issue might be trivial but for me I am lost. Unless I missed it, it doesn’t seem like there is a lot of Arch specific documentation on setting up Chrome-Remote-Desktop. I managed to find this page:

https://aur.archlinux.org/packages/chrome-remote-desktop/

From what I gather, systemd is supposed to start Chrome Remote Desktop if you enable it. It has something to do with this command:

systemctl --user {enable,start} chrome-remote-desktop

It looks like this will start it as a service for a user but is that dependent on the user needing to login to the desktop first?

How would I get Chrome Remote Desktop to start as a service on boot so any user could connect to it?

If there is no such a service in /usr/lib/systemd/system, you might want to create a chrome-remote-desktop.service in /etc/systemd/system with the following content:

[Unit]
Description="Chrome Remote Desktop host daemon"
ConditionDirectoryNotEmpty=%h/.config/chrome-remote-desktop
ConditionPathExistsGlob=%h/.config/chrome-remote-desktop/host#*.json

[Service]
Type=forking
ExecStart=/usr/bin/crd --start
ExecStop=/usr/bin/crd --stop
ExecReload=/usr/bin/crd --restart

[Install]
Alias=chromoting.service
WantedBy=default.target

See:

https://aur.archlinux.org/cgit/aur.git/tree/chrome-remote-desktop.service?h=chrome-remote-desktop

Hope this helps!

Disclaimer: I don’t use chrome-remote-desktop, so I haven’t tested the above but it looks like it should work.

Edit: I had a quick look at the PKGBUILD for chrome-remote-desktop. It looks like you should have a service already installed in /usr/lib/systemd/system so I guess the below should do the job:

sudo systemctl enable --now chrome-remote-desktop.service

2 Likes

Thanks! I will give these a try.