logo

Accessing Linux Remotely via Chrome and Solutions to the Black Screen Issue 📂Programing

Accessing Linux Remotely via Chrome and Solutions to the Black Screen Issue

Overview

In the case of Linux, Chrome Remote Desktop is not as straightforward as it is on Windows. There is an issue where only a black screen and cursor are visible, making it unusable. Let’s explore ways to resolve this. Although it’s not a simple task, this guide is written to be as easy to follow as possible, even for beginners.

Guide

We will refer to the client attempting to connect as the “origin” and the server allowing the connection as the “remote.”

1. Install Remote Desktop App

Perform this on the remote side.

https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb

On the remote side, click the link above to download the chrome-remote-desktop_current_amd64.deb file and install the package1. Nowadays, it is easy to install by double-clicking through the Debian file manager in Linux.

alt text

2. Configure Remote Desktop via SSH

Perform this on the origin side.

alt text

The Remote Desktop page may guide you to go to the g.co/crd/headless page or https://remotedesktop.google.com/headless link. Upon accessing it from the origin side, you will see guidance as follows:

alt text

By clicking buttons like Approve/Next, you will eventually reach a page that provides a long and complex command. Click the button marked with a red box to copy the command to the clipboard.

alt text

After connecting to the remote via SSH, paste the copied command. You will be prompted to set a PIN (password) of at least 6 digits. If you don’t know how to connect via SSH, refer to the post on how to connect to an SSH server via CLI.

alt text

Lastly, after entering the password on the remote side, you will see a message indicating that the host has started successfully.

3. Modify Script 2

Perform this on the remote side. This is where it starts to get really difficult.

3-1. Stop the App

alt text

sudo cp /opt/google/chrome-remote-desktop/chrome-remote-desktop /opt/google/chrome-remote-desktop/chrome-remote-desktop.orig
/opt/google/chrome-remote-desktop/chrome-remote-desktop --stop

On the remote side, the Remote Desktop page will show that the remote device has been added instead of the setup guide for ’this device’. Before modifying the script, first, run the above command to back up the script and stop the running Chrome Remote.


3-2. Display Number

echo $DISPLAY
sudo gedit /opt/google/chrome-remote-desktop/chrome-remote-desktop

alt text

Check the display number (it is likely 0) and open the script file with gedit.

alt text

Change FIRST_X_DISPLAY_NUMBER to the confirmed display number. The default value is 20.


3-3. Modify get_unused_display_number

alt text

while os.path.exists(X_LOCK_FILE_TEMPLATE % display):
    display += 1

Find the get_unused_display_number function and comment out the while loop as shown above.


3-4. Modify launch_session

alt text

    display = self.get_unused_display_number()       
    self.child_env["DISPLAY"] = ":%d" % display

Find the launch_session function and comment out the section from self._setup_gnubby() to self.launch_x_session() or self.launch_desktop_session(). Then, insert the above code right below the comments.

4. Verify Connection

/opt/google/chrome-remote-desktop/chrome-remote-desktop --start

Restart the Chrome Remote Desktop app.

alt text

Verify that you are able to connect successfully from the origin to the Linux remote.

Environment

  • Linux Mint 21.2 Cinnamon v5.8.4
  • NAVER Whale v3.26.244.21