Although it is not limited to Chrome Remote Desktop, the operating side requires a client application and the operated side requires a host application. This time, I will use Windows on the client side and Linux (Ubuntu 20.04) on the host side.
The host side can be either an actual machine or a VM. You can make a remote desktop connection on the GCP VM in the same way. If you want to use GCP VM, install Ubuntu desktop version first.
Download and install Chrome Remote Desktop Host on the host side (Ubuntu).
$ wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
$ sudo dpkg --install chrome-remote-desktop_current_amd64.deb
$ sudo apt install --assume-yes --fix-broken
You can now install it. Furthermore, change the user account information as follows. (I forgot this when setting it for the first time, and after restarting, I encountered a phenomenon that I could not log in)
$ sudo usermod -a -G chrome-remote-desktop $USER
Once you've done this, you're back to client-side work.
https://remotedesktop.google.com/headless?hl=ja
From this page, select the Google account you want to use to connect. As you proceed with login operations, commands are displayed as shown below.
DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="XXXXXXX_XXXXXXX_-XXXXXXX" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$(hostname)
It comes out like this. Since the host side is Ubuntu this time, enter the command of the "Debian Linux" part as it is into the console of Ubuntu which is the host. You are redirecting screen output.
When you enter this command, you will be prompted to enter a PIN of at least six digits. Set it and don't forget it.
When you enter the Chrome Remote Desktop page again from the client side, the following is displayed.
When connecting for the first time, you will be asked to enter the PIN you requested earlier. Enter the set PIN code and the remote connection is successful.
Trouble experienced.
This is my experience when I entered a Linux VM on GCP with Remote Desktop.
When trying to execute the sudo command from Terminal on the GUI
(User name) is not in the sudoers file. This incident will be reported.
Is rejected, but if you do it from the GCP console, it will pass.
$ sudo usermod -G sudo $(whoami)
Add users from the GCP console.
$ sudo cat /etc/group
After that, if you log out and log in again, you can sudo on the GCP VM.
Events on GCP.
After rebooting from ssh, the VM instance seems to have started, but Chrome Remote Desktop does not work.
Like this.
$ sudo systemctl status chrome-remote-desktop
I check it, but there is no problem. It is Active.
$ sudo usermod -a -G chrome-remote-desktop $USER
I forgot this command.
Occurs on both VMs and actual machines. The following dialogs appear frequently, which is annoying.
--Authentication required to create a color profile --Authentication required to create a color managed device
I wrote an independent article about this, so please refer to that. Clear the dialog that appears when entering Linux with Remote Desktop
Recommended Posts