Configuring Chrome Remote Desktop with Ubuntu Gnome 14.04

45

49

I am trying to install Chrome Remote Desktop and I'm reading the FAQ on how to install it, but it says nothing much AFAIK.

With Ubuntu Gnome 14.04, what should be the content of the .chrome-remote-desktop-session file?

* Edit *

I created the required .chrome-remote-desktop-session file with a single line :

gnome-session

Howerver, starting a remote desktiop session only result with a blank screen. I have tried searching for a solution, but none of them are up-to-date, or gives a helpful hint for a solution. I also tried gnome-session-classic, but without luck, too.

Yanick Rochon

Posted 2014-07-07T16:52:33.667

Reputation: 932

Answers

72

This answer originates from Rob Calistri's comment in François Beaufort's G+ post. Due credit to the source. If you've updated Ubuntu (or Ubuntu Gnome) recently, instead of a blank screen, you likely see just wallpaper without any panels when connecting via Chrome Remote Desktop. This modification forces Chrome Remote Desktop to use the existing X Server instead of creating new desktops.

After installing the Debian package chrome-remote-desktop_current_amd64.deb, make sure the current user is part of the chrome-remote-desktop group:

sudo usermod -a -G chrome-remote-desktop username

Stop Chrome Remote Desktop:

/opt/google/chrome-remote-desktop/chrome-remote-desktop --stop

Backup the original configuration:

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

Edit the config file (sudo vim, gksudo gedit, etc):

gksudo gedit /opt/google/chrome-remote-desktop/chrome-remote-desktop

Find DEFAULT_SIZES and amend to the remote desktop resolution. For example:

DEFAULT_SIZES = "1920x1080"

Set the X display number to the current display number (obtain it with echo $DISPLAY from any terminal). On Ubuntu 17.10 and lower, this is usually 0, and on Ubuntu 18.04, this is usually 1:

FIRST_X_DISPLAY_NUMBER = 0

Comment out sections that look for additional displays, as shown here:

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

Reuse the existing X session instead of launching a new one. Alter launch_session() by commenting out launch_x_server() and launch_x_session() and instead setting the display environment variable, so that the function definition ultimately looks like the following:

  def launch_session(self, x_args):
    self._init_child_env()
    self._setup_pulseaudio()
    self._setup_gnubby()
    #self._launch_x_server(x_args)
    #self._launch_x_session()
    display = self.get_unused_display_number()
    self.child_env["DISPLAY"] = ":%d" % display

Save and exit the editor. Start Chrome Remote Desktop:

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

Caution: When this answer was originally written for Ubuntu (Gnome) 14.04 in February 2015, there existed an issue where Chrome Remote Desktop somehow caused deja-dup-monitor to go wild and consume all of your system memory (see launchpad bug). This made Ubuntu essentially unusable after connecting/disconnecting via Chrome Remote Desktop.

Update November 2016: The instructions have been amended based on further updates by Rob Calistri in the above-linked G+ post comments. With Ubuntu 16.04, the deja-dup-monitor bug appears to be resolved (it never exceeded 2.8 MiB of memory usage in my last test).

MDMower

Posted 2014-07-07T16:52:33.667

Reputation: 873

Awesome solution, worked perfectly. A note on the warning, I had to remove deja-dup-monitor. You can find it in the software center, search backup. – aw04 – 2015-01-02T22:26:08.513

I have priviously successfully used this method on Ubuntu 12.04. Now on a clean install of Ubuntu 14.04(32 bit), I have broken the installation(twice) by doing this and nothing else. -Ubuntu restarts in complete white screen with no login screen or desktop (default console Ctrl-Alt-F7). – hpekristiansen – 2015-10-22T10:54:28.203

Had this problem after replacing the horrible Unity interface with xfce, this solution worked perfectly, thanks! – klogd – 2016-03-02T14:29:14.100

3Solution working with Ubuntu 16.04! – Vitor Abella – 2016-06-14T02:21:01.530

Along with @CrandellWS answer below, I got this working on Lubuntu 16.04. Thank you so much! – Alex P. Miller – 2017-01-06T17:52:17.487

Thanks, this solution makes chrome remote desktop work much better with Unity in Ubuntu 16.04 – Jon Onstott – 2017-01-15T19:41:23.123

is the resolution required to be set to something specific or is this just a preference? – evan54 – 2017-05-28T19:00:43.243

I cannot get this to work, I'm not sure I'm editing the file 100% correctly - does anyone have a copy of the corrected file I can use? – mcmillab – 2017-06-13T23:35:40.340

will this still work if the system is rebooted, and no-one is logged in? In that case isn't there no session for it to use? – mcmillab – 2017-06-14T04:06:47.583

Worked for me on the up-to-date version of Debian 8.9 jessie, chrome remote desktop 63. Did not change the DEFAULT_SIZES variable. Thanks a lot! – denis-sumin – 2017-11-19T13:34:58.853

still effectively works in 17.10 LXDE -- for some reason it's not finding ARANDR but you can muck with that variable as well. Who the hell doesn't have a 1920x1080 monitor today.... – Ron Thompson – 2018-02-09T00:21:23.993

3

I'm still having issues with this in 18.04. I followed this blog post (authored on 2018.05.03, pretty recently) - https://medium.com/@akarpo/hi-vicken-c1fcea4514d6

My feedback along with a sample config is at the bottom. After I enter a PIN and attempt to enable Remote Connections, it spins and spins saying 'Enabling Remote Connections' but nothing ever finishes/takes.

My config file - https://www.dropbox.com/s/6w2nepbm4pmtc9l/chrome-remote-desktop?dl=0

Any ideas?

– Alex Karpowitsch – 2018-05-03T14:51:59.650

3@AlexKarpowitsch I tested this on Ubuntu 18.04 and the logfile under /tmp was clear on the problem: the X display number is not correct. I've updated the answer to reflect that a user should obtain the current X display number instead of assuming it is zero. Hope this helps. – MDMower – 2018-05-04T16:04:45.213

2

@MDMower - that worked! Thank you so much. For anyone who might have found this via Google, I've included a link to my revised config (I only have a single monitor, 1920x1080 resolution) - https://www.dropbox.com/s/8opz5dhq2umjn4c/chrome-remote-desktop-v2?dl=0

– Alex Karpowitsch – 2018-05-05T15:40:12.653

@MDMower I change the FIRST_X_DISPLAY_NUMBER to 1 in Ubuntu 18.04, but it is still not working. After waiting Enabling remote connections for this computer... for 20 mins, I got an error message saying Failed to start remote access service.. Can you help me? – Haozhe Xie – 2018-06-04T13:07:49.687

Successful attempt in Ubuntu 18.04 using this method, but now all I get is blank screen. – Hendra Anggrian – 2018-09-29T10:28:55.180

Works perfectly in Ubuntu 18.04! Note that echo $DISPLAY for me does indeed return :0, however. Also, what if I do not want to control the active desktop? I'd really like to be able to work in a background session on the host PC while my wife works simultaneously on that pc in the main foreground session. Any way to make this happen? The problem is that without doing your changes you specify above, every time I go to log in to the remote session, it loads the Ubuntu gnome login screen, but then when I type in my password, the session won't show up.It just stays on the gnome login screen. – Gabriel Staples – 2019-03-31T16:49:14.123

12019, Ubuntu 19.04 and it still works beautifully. Without this mod I was having serious issues with some apps like the terminal going into the remote screen despite me being on the host rendering the PC unusable. This is perfect, thanks. – Ahdee – 2019-07-18T14:51:46.887

Please explain what you're asking us to do here. I don't understand what you're telling us to do in this step: Find DEFAULT_SIZES and amend to the remote desktop resolution. – Gabriel Staples – 2019-09-15T05:59:13.177

FYI; related: https://support.google.com/chrome/thread/2067278?hl=en

– Gabriel Staples – 2019-09-15T06:11:07.383

Also, good write-up on Medium.com referencing this answer: https://medium.com/@vsimon/how-to-install-chrome-remote-desktop-on-ubuntu-18-04-52d99980d83e

– Gabriel Staples – 2019-09-15T07:04:47.097

2019, Ubuntu 16.04 and it still works beautifully. – tyumru – 2019-09-29T18:18:59.333

It no longer seems to work on Ubuntu 18 after latest chrome remote desktop update came through recently :(: https://askubuntu.com/questions/1189710/cant-connect-to-chrome-remote-desktop-on-ubuntu-18

– Gabriel Staples – 2019-11-18T08:50:37.010

This worked for me on Ubuntu 18 with latest version of chrome remote desktop (installed today). – Timtech – 2019-12-03T03:06:05.753

Note that if you ever find you can no longer click on an external hard drive in your GUI file manager anymore to automatically mount the drive, Chrome Remote Desktop could be to blame. See here: https://askubuntu.com/questions/1196248/automount-when-clicking-on-disks-in-gui-file-manager-suddenly-stopped-working-in/1196273#1196273.

– Gabriel Staples – 2019-12-15T06:24:27.670

hit the same problem and stuck for days~! After the suffer, I would say, if Google Remote Desktop is not a must-to-have, remove it. This is the easiest way to fix the problem. – Franva – 2019-12-20T23:27:11.850

9

The chrome-remote-desktop application works just fine with linux generally and Ubuntu specifically. It however does NOT play nice with LightDM and Unity. Ubuntu Bug #1274013, and the related bug in comment #3 shed some light on this: gnome-session is broken without 3d acceleration.

To resolve this I added LXDE to my ubuntu installation on my desktop:

sudo apt-get install lxde

I still am able to use the standard Unity Desktop when accessing my desktop locally, but the I have the LXDE desktop to use via chrome-remote-desktop remotely.

This is accomplished by creating (or altering) the ~/.chrome-remote-desktop-session file to read

exec /usr/bin/startlxde

Then, to shutdown and restart the Chromoting service, run from terminal

sudo service chrome-remote-desktop restart

Now attempt to remote in from another computer. This should start a virtual session in LXDE even if the remote computer is currently logged in under Unity/LightDM.

Vinny

Posted 2014-07-07T16:52:33.667

Reputation: 91

Had OP's problem, and this solution worked great for me. – CompEcon – 2014-11-22T12:10:56.903

Can you be more specific about adding the startlxde command? I put it in, and it made the Google app glitch like an error. I can't get it to start lxde, even when I boot up with lxde, remote desktop still goes to unity. – Jim Maguire – 2015-10-24T20:38:14.083

Worked as a charm. – Thomas – 2016-02-19T12:56:37.703

1

Here is my story of how I enabled it on ubuntu 16.04 server:

  1. installed the remote desktop deb
  2. installed xorg dummy drivers apt-get install xserver-xorg-video-dummy xserver-xorg-input-void
  3. added to /etc/environment:

.

CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES=1920x1080
CHROME_REMOTE_DESKTOP_USE_XORG=1
CHROME_REMOTE_DESKTOP_LOG_FILE=/tmp/crd.log
  1. reboot
  2. added group chrome-remote-desktop and added my user to this group
  3. added xfce: apt-get install xfce4 and

.

cat > ~/.chrome-remote-desktop-session
exec /usr/bin/startxfce4
  1. enabled debug in the chrome remote desktop extension by opening its "main.html" page and made sure everything is okay there

this works as a terminal server with separate desktop for each user with auto-resizing of the desktop as expected

grandrew

Posted 2014-07-07T16:52:33.667

Reputation: 148

0

In my case, because I already had the session and X running, I was losing the connection after a while. Looking to the logs, it stops after 15 attempts because was already running. So I had to comment another line.

In sum, on /opt/google/chrome-remote-desktop/chrome-remote-desktop:

Set the display number to 0:

FIRST_X_DISPLAY_NUMBER = 0

Comment:

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

And in my case, I also commented this:

#relaunch_times.append(x_server_inhibitor.earliest_relaunch_time)

I don't fully understand the issue but works like a charm.


@Andrew You can use the CRD as host/server on linux. Try this: Check your xsession (lubuntu example):

grep '^Exec=' /usr/share/xsessions/Lubuntu.desktop

And put that on the chrome-remote-desktop-session file:

cat > ~/.chrome-remote-desktop-session
exec /usr/bin/lxsession -s Lubuntu -e LXDE

After this the option to add you machine as host becomes available on CRD.

Running Lubuntu (Ubuntu 15.10)

Luis Pereira

Posted 2014-07-07T16:52:33.667

Reputation: 131

0

As far as I'm aware, Chrome remote desktop cannot be a host/server on linux/ubuntu - it can only be used as a client to view instances of remote-desktop on Mac / Windows / Chrome machines.

I've only ever used it for that use case - to connect to OSX / Windows boxes from my Ubuntu work laptop. In those instances, the viewer is just accessed by installing via the chrome extension located here: https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en

EDIT: Since the remote-desktop host feature is currently in beta, it's not accessible in the chrome-stable installation, which is why I've not seen it listed and there is no option to enable remote connections in the stable installation, as far as I can tell.

Andrew

Posted 2014-07-07T16:52:33.667

Reputation: 479

1What about the .deb package it requires to install; chrome-remote-desktop? Where does it say, in the FAQ, or anywhere on Google, that Google Remote Desktop cannot be used as a host on Ubuntu? – Yanick Rochon – 2014-07-13T19:46:58.067

When opening the remote-desktop app on chrome on Ubuntu (latest stable), there is no option to add the current machine as a host, whereas on OSX this option is present. Although this is an older article, there is mention here that there is no host support for linux yet: https://productforums.google.com/d/msg/chrome/VT2_wLZ3ppc/QcVbd1o24F8J

– Andrew – 2014-07-14T06:48:09.853

My apologies, turns out it's currently in beta, and not available in chrome-stable, as far as I can tell. – Andrew – 2014-07-14T06:57:07.123

if you follow the FAQ that I posted in the question, in instructs how to configure it (it doesn't say Chrome stable or Chromium), and it is possible to add the current machine as host. However, the end result is what I explained in the question as well. I understand the beta nature of the plugin and, for this reason, I'll leave this question open until a solution, or otherwise a stable release, makes it work. – Yanick Rochon – 2014-07-14T09:41:55.333

1Fair enough :) I'll see if I can give it a go at some point as well, and let you know how I get on - I've been waiting for the host capability of the remote desktop extension for some time, and I'm keen to give it a spin. – Andrew – 2014-07-14T10:42:16.120

0

As the desktop environment on my computer is LXDE and not gnome, I am using the following:

#/usr/bin/openbox-session
#/usr/bin/lxsession -s Lubuntu-Netbook -e LXDE
#/usr/bin/lxsession -s Lubuntu -e LXDE

## This session was created for other purposes such as a non shared desktop 
#/usr/bin/lxsession -s ChromeDesk -e LXDE

######
## For Desktop Sharing
######

/etc/X11/Xsession

I followed the guide found here: https://support.google.com/chrome/answer/1649523?hl=en under the heading

Set up Chrome Remote Desktop |subheading>Enable Remote Access to Your computer | minor heading > Linux

Create a file called .chrome-remote-desktop-session in your home directory. This should be a shell script that starts your preferred desktop environment. Find the correct command to start the desktop by looking in /usr/share/xsessions/ for the desktop entry.

For example, the ubuntu-2d.desktop file has the line:

Exec=gnome-session --session=ubuntu-2d

The text after ‘Exec=’ is the command to start the session. It should be passed (using quotes if necessary) as a parameter to the lightdm-session script. In this case, the correct command would be:

exec /usr/sbin/lightdm-session "gnome-session --session=ubuntu-2d"

Including a couple of links one to another thread on the subject and also linking to an article write up created for my own reference...

https://productforums.google.com/d/msg/chrome/8PMxG69VJ6o/CVr0AgTCWm8J

CrandellWS

Posted 2014-07-07T16:52:33.667

Reputation: 111