Introduction
Chromoting, also known as Chrome Remote Desktop, allows one to remotely control a distant machine, all from within the Chromium browser. Its source code is located in the remoting/ folder in the Chromium codebase. For the sake of brevity, we'll assume that you already have a pre-built copy of Chromium (or Chrome) installed on your development computer.
Obtain API keys
Before you can compile the code, you must obtain an API key to allow it to access the federated Chromoting API.
- Join the chromium-dev list, which can be found at https://groups.google.com/a/chromium.org/forum/#!forum/chromium-dev. (This step is required in order to gain access to the Chromoting API.)
- Visit the Google APIs console at https://code.google.com/apis/console.
- Use the API Project dropdown to create a new project with a name of your choice.
- On the Services page, click the button to activate the Chrome Remote Desktop API, and accept the license agreements that appear.
- On the API Access page, select the option to create an OAuth2 client ID, and supply a product name of your choice.
- Choose the Web application type, then click more options.
- Replace the contents of Authorized Redirect URLs with: https://chromoting-oauth.talkgadget.google.com/talkgadget/oauth/chrome-remote-desktop/dev
- Clear the Authorized JavaScript Origins field and click the button to finish creating the client ID.
- Create a file ~/.gyp/include.gypi according to the following format:
{
'variables': {
'google_api_key': '<API key, listed under Simple API Access in the console>',
'google_default_client_id': '<Client ID, listed under Client ID for web applications>',
'google_default_client_secret': '<Client secret, listed under Client ID for web applications>',
},
}(NB: Replace the text in angled braces according the the instructions between them.)
Obtain Chromium code
If you've already checked out a copy of the browser's codebase, you can skip this section, although you'll still need to run gclient runhooks to ensure you build using the API keys you just generated.
- Install the build dependencies, which are listed at http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites.
- Install the depot_tools utilities, a process that is documented at http://dev.chromium.org/developers/how-tos/install-depot-tools.
- Download the Chromium source code by running: $ fetch chromium --nosvn=True
Build and install the Linux host service
If you want to remote into a (Debian-based) GNU/Linux host, follow these steps to compile and install the host service on that system. As of the time of writing, you must compile from source because no official binary package is being distributed.
- Start in the src/ directory that contains your checkout of the Chromium code.
- Build the Chromoting host binaries: $ ninja -C out/Release remoting_me2me_host remoting_start_host remoting_native_messaging_host remoting_native_messaging_manifests
- When the build finishes, move into the installer directory: $ cd remoting/host/installer/
- Generate a DEB package for your system's package manager: $ linux/build-deb.sh
- Install the package on your system: $ sudo dpkg -i *.deb
- The next time you use the Chromoting extension from your browser, it should detect the presence of the host service and offer you the option to Enable remote connections.
- If the Web app doesn't properly detect the host process, you may need to create a symlink to help the plugin find the native messaging host: $ sudo ln -s /etc/opt/chrome /etc/chromium
(NB: If you compile the host service from source and expect to configure it using the browser extension, you must also compile the latter from source. Otherwise, the package signing keys will not match and the Web app's OAuth2 token will not be valid within the host process.)
Build and install the browser extension
The Web app is the Chromoting system's main user interface, and allows you to connect to existing hosts as well as set up the host process on the machine you're currently sitting at. Once built, it must be installed into your browser as an extension.
- Start in the src/ directory that contains your checkout of the Chromium code.
- Build the browser extension: $ GOOGLE_API_KEY=<API key> GOOGLE_CLIENT_ID_REMOTING=<client ID> GOOGLE_CLIENT_SECRET_REMOTING=<client secret> ninja -C out/Release remoting_webapp (Be sure to replace the substitutions denoted by angled braces.)
- Install the extension into your Chromium (or Chrome) browser:
- Visit the settings page [chrome://extensions].
- If it is unchecked, tick the Developer mode box.
- Click Load unpacked extension..., then navigate to out/Release/remoting/remoting.webapp/ within your code checkout.
- Confirm the installation, open a new tab, and click the new app's Chromoting icon.
- Complete the account authorization step, signing into your Google account if you weren't already.
Build and install the Android client
If you want to use your Android device to connect to your Chromoting hosts, follow these steps to install the client app on it. Note that this is in the very early stages of development. At the time of writing, you must compile from source because no official version is being distributed.
- Follow all the instructions under the Getting the code and Install prerequisites sections of: http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
- Move into the src/ directory that contains your checkout of the Chromium code.
- Build the Android app: $ ninja -C out/Release remoting_apk
- Connect your device and set up USB debugging:
- Plug your device in via USB.
- Open the Settings app and look for the Developer options choice.
- If there is no such entry, open About phone, tap Build number 7 times, and look again.
- Under Developer options, toggle the main switch to ON and enable USB debugging.
- On your machine and still in the src/ directory, run: $ build/android/adb_install_apk.py --apk=out/Release/apks/Chromoting.apk
- If your Android device prompts you to accept the host's key, do so.
- The app should now be listed as Chromoting in your app drawer.
See the ChromotingAndroidHacking guide for instructions on viewing the Android app's log and attaching a debugger.
I'm getting the error, when doing the "install linux host service" ninja: error: unknown target 'remoting_native_messaging_host'
any idea why am i getting this? See below my steps and error
root@sambian:~/src# ninja -C out/Release remoting_me2me_host remoting_start_host remoting_native_messaging_host ninja: Entering directory `out/Release' ninja: error: unknown target 'remoting_native_messaging_host'
sandeepmzc: The remoting_native_messaging_host target was only added as of Git commit 52bc9d4df874a2190f6b57497e470438fbdc0152. Either make sure you're building a more recent version than that or compile without native messaging.
Thank u Solb for the reply, I was using not using the latest code(was using the older tar download). This worked for me ninja -C out/Release remoting_me2me_host remoting_start_host remoting_webapp
Hi all, I'm able to start the apk build but it is stopping with error, see the below logs
sam@sambian:~/src$ ninja -C out/Release remoting_apk ninja: Entering directory `out/Release' [11/2519] ACTION Creating jsr_305_javalib jar FAILED: cd ../../third_party/jsr-305; python ../../build/android/gyp/jar.py "--classes-dir=../../out/Release/gen/jsr_305_javalib/classes" "--jar-path=../../out/Release/gen/jsr_305_javalib/jsr_305_javalib.jar" "--excluded-classes=\"/R.class\" \"/R##.class\"" "--ignore=7fbb7b6355a1674ecbd3ec9de91caea4 -" Traceback (most recent call last): OSError: 2? No such file or directory [11/2519] CC obj/third_party/android_tools/ndk/sources/android/cpufeatures/cpu_features.cpu-features.o ninja: build stopped: subcommand failed.
Thank You all, I was able to build the chromoting android app Finally and it's working :)
what is that you did for that error ? Am getting the same error
FAILED: cd ../../third_party/protobuf; python ../../build/android/gyp/jar.py "--classes-dir=../../out/Release/gen/protobuf_lite_javalib/classes" "--jar-path=../../out/Release/lib.java/protobuf_lite_javalib.jar" "--excluded-classes=\"/R.class\" \"/R##.class\"" "--ignore=e96369929f3ea0b5a20d1424699733d6 -" Traceback (most recent call last): OSError: 2? No such file or directory ninja: build stopped: subcommand failed.
@cruser11232@gmail.com
This worked for me.
sudo update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_37/bin/javap" 1
sudo update-alternatives --config javap
I followed @sandeepmzc's instruction, the problem still the same as @cruser11232@gmail.com.
Do these instructions only work if the host is a linux machine?
Anyone hosting an alpha/beta build of the android client anywhere? This is way too much work to build for someone just wanting to kick the tires. 😕
Hey guys, I wanted to try this instruction on a Debian x64 Virtual Machine. Now I got to the step of Building the .deb files. But somehow it fails!
oliver@SpiegelsystemLazyDebian?:~/src/remoting/host/installer$ linux/build-deb.sh Building version 34.0.1761.0 dpkg-buildpackage: source package chrome-remote-desktop dpkg-buildpackage: source version 34.0.1761.0 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by The Chromium Authors <chromium-dev@chromium.org> dpkg-buildpackage: host architecture amd64
dh clean dh build make1?: Entering directory `/home/oliver/src/remoting/host/installer/linux' make1?: Nothing to be done for `all'. make1?: Leaving directory `/home/oliver/src/remoting/host/installer/linux' dh binary make1?: Entering directory `/home/oliver/src/remoting/host/installer/linux' install -d "/home/oliver/src/remoting/host/installer/linux/debian/chrome-remote-desktop/opt/google/chrome-remote-desktop" install -d "/home/oliver/src/remoting/host/installer/linux/debian/chrome-remote-desktop/etc/opt/chrome/native-messaging-hosts" install "../../../../remoting/tools/me2me_virtual_host.py" \ install "../../../../remoting/tools/is-remoting-session" "/home/oliver/src/remoting/host/installer/linux/debian/chrome-remote-desktop/opt/google/chrome-remote-desktop" install "../../../../out/Release/remoting/com.google.chrome.remote_desktop.json" \ install: cannot stat `../../../../out/Release/remoting/com.google.chrome.remote_desktop.json': No such file or directory make1?: install? Error 1 make1?: Leaving directory `/home/oliver/src/remoting/host/installer/linux' dh_auto_install: make -j1 install DESTDIR=/home/oliver/src/remoting/host/installer/linux/debian/chrome-remote-desktop AM_UPDATE_INFO_DIR=no returned exit code 2 make: binary? Error 2 dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2I have searched for the file "com.google.chrome.remote_desktop.json" but somehow it does not even exist on my computer.
Do you know a good solution?
@oliver.tiebe: Can you confirm that you have run $ ninja -C out/Release remoting_me2me_host remoting_start_host remoting_native_messaging_host (not e.g. -C out/Debug) and that it didn't produce any error messages?
Thank you for your quick reply after my reminder:)
Since it is a long time ago I'm not sure, but I think that it compiled without errors. To be sure I will do it again. I will write the report as it finished.
So here I am again. There are some warnings in the libjpeg_turbo package. All of them are like this:
../../third_party/libjpeg_turbo/jdmerge.c:93:39: warning: always_inline function might not be inlinable [-Wattributes]
- efine h2v1_merged_upsample_internal extrgb_h2v1_merged_upsample_internal
../../third_party/libjpeg_turbo/jdmrgext.c:22:1: note: in expansion of macro ‘h2v1_merged_upsample_internal’I tried again to run the build-deb.sh, but the same error as written before appears.
Were you in the src/ directory when you ran the ninja command? The goal is to deposit the files in src/out/Release, not e.g. src/remoting/host/installer/out/Release. Could you verify that there is a remoting directory in the former location (and no out directory in the latter)?
Yes, everything is correct. Here I have the Release folder
oliver@SpiegelsystemLazyDebian?:~/src/out/Release$ ls build.ninja libffmpegsumo.so re2c gen libffmpegsumo.so.TOC remoting_locales genmacro libvpx_obj_int_extract remoting_me2me_host genmodule libyuv.a remoting_native_messaging_host genperf obj remoting_resources_verified.stamp genstring protoc remoting_start_host genversion pyproto yasm
@oliver.tiebe: My apologies! I believe that since Git fd7144ada8809eac45c61cbc9eb32f9aaa94368f, it's been necessary to build the remoting_me2me_native_messaging_manifest target in order to copy that file. I updated the page content to reflect this change.
Thank you! Now I got a big step forward!
I could create the deb package and install it. Running chrome i can now set a pin for the computer. But then I get an error. Running chrome from the console shows this: [0120/115810:WARNING:json_host_config.cc(30)] Failed to read /home/oliver/.config/chrome-remote-desktop/host#4ff5d6a655b9aac0384f17b48d33bd5f.json
@oliver.tiebe: Have you built and installed the Chrome extension (Web app) from source as described on this page? I believe this is still necessary in order for the two to communicate.
I did it now... No change appeard:(
[0120/144653:WARNING:json_host_config.cc(30)] Failed to read /home/oliver/.config/chrome-remote-desktop/host#4ff5d6a655b9aac0384f17b48d33bd5f.json
First, if you have both versions of the plugin installed, verify that you havem't confused them and are using the one you compiled. Now for a few questions: Are you using Chrome (binary is usually called google-chrome) or Chromium (Debiam names the binary chromium-browser)? Do you see a sudo auth prompt when you set the PIN? Also, is there anything at all in ~/.config/chrome-remote-desktop? You might try quitting the browser, deleting the ~/.config/chrome-remote-desktop folder, then repeating the host registration.
Hi, I have tried the instructions and everything went smooth. But when I tried to start the service by sudo service chrome-remote-desktop start I get the following:
Starting Chrome Remote Desktop host for <user>... OK
<user>@<machine>:~$ 2014-01-22 19:44:53,405:INFO:Daemon process started in the background, logging to '/tmp/chrome_remote_desktop_20140122_194453_1iVja6' Using host_id: d109701e-851b-9b36-2dc9-e21ee523dc96
Launching X server and X session.<br> Starting Xvfb on display :20
Xvfb is active.
Launching X session: ['/usr/sbin/lightdm-session', '/usr/bin/gnome-session --session=ubuntu-2d']
Launching host process
['/opt/google/chrome-remote-desktop/chrome-remote-desktop-host', '--host-config=-', '--audio-pipe-name=/home/<user>/.config/chrome-remote-desktop/pulseaudio#7e4d6b70aa/fifo_output', '--signal-parent']
wait() returned (25882,26112)
Host process terminated
Failure count for 'host' is now 1
OAuth credentials are invalid - exiting.
Cleanup.
Terminating Xvfb
Log file: /tmp/chrome_remote_desktop_20140122_194453_1iVja6
What may be the problem here? why my credentials are invalid? I have CRD already installed as a browser extension to chrome from my windows machine.
I am not using the builded webapp.
When I tried my builded webapp it shows invalid client id.
I'm attempting to get the host service running on Arch Linux, but I think I've hit the limits of my ability to diagnose problems (or it's just too late at night).
Whenever the host starts, it immediately crashes and points me to an error file which is reproduced below:
{{{{ Exception IOError: (9, 'Bad file descriptor') in <bound method TemporaryFileWrapper?.del of <closed file '<fdopen>', mode 'w+b' at 0xf880c0>> ignored 2014-02-06 00:42:45,596:INFO:Using host_id: 1e30b73f-dc1d-859b-889b-8198fcda3b73 2014-02-06 00:42:45,598:INFO:Launching X server and X session. 2014-02-06 00:42:45,851:INFO:Starting Xvfb on display :20 Traceback (most recent call last): launch_x_server(x_args) File "/opt/google/chrome-remote-desktop/chrome-remote-desktop", line 354, in launch_x_server File "/usr/lib/python2.7/subprocess.py", line 709, in init File "/usr/lib/python2.7/subprocess.py", line 1326, in execute_child
OSError: 2? No such file or directory 2014-02-06 00:42:45,867:INFO:Cleanup. 2014-02-06 00:42:45,867:INFO:Terminating Xvfb }}}}I can see the OSError near the bottom, but I'm not sure what file or directory it's referring to.
i got the following error , after using "fetch" please, anyone knows how to solve this issue?
Generating gyp files from GN... Traceback (most recent call last):
SyntaxError?: invalid syntax Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /home/snikay/depot_tools Traceback (most recent call last): subprocess.CalledProcessError?: Command '('gclient', 'sync')' returned non-zero exit status 2Running on Fedora:
You may want to adjust the screen resolution on the ExecStart? line depending on how large you want the virtual desktop to be. I connect to it from my chromebook, so I've set it to 1366x768.
You're almost done, but there's one more step. By default, this will try to start your default desktop environment (probably Gnome) which will not work very well if you're already logged in, because the sad fact is that many pieces of the modern linux desktop assume only one instance of themselves is running per user. It may also interfere with audio, etc. - you get the idea, lots of issues.
I found that running a minimal environment worked best. I've set up my chromoting desktop to be based on openbox and lxde, by creating the following .xsession file in my home directory:
This does not seem to affect my default session when I log in directly on the console, only the chromoting session. With all this set up, you can start the service with "systemctl start chromoting", and then enable access to it by going to the chrome remote desktop app and configuring the PIN.
That's it - setup is painful, but the final result is absolutely spectacular. I've used almost all of the remote desktop clients available, and this one is beats everything else by a huge margin.
When running ninja, I seem to not have the remoting_me2me_native_messaging_manifest target:
*@*:~/chromium/src$ ~/chromium/depot_tools/ninja -C out/Release remoting_me2me_host remoting_start_host remoting_native_messaging_host remoting_me2me_native_messaging_manifest ninja: Entering directory `out/Release' ninja: error: unknown target 'remoting_me2me_native_messaging_manifest'
Would appreciate any thoughts on this! Has this been removed by a more recent commit?
The install script does not seem to like it when you have a previous build on the device, sometimes (possibly because the previous build did not include an API key).
You will receive the incorrect assertion "Please build md5sum" when running the script to install the APK to your device.
Simply remove the old APK from your device and rerun the script.
So I've been trying to get CRD setup on Ubuntu 12.10. I've got as far as installing the remote desktop app. I can connect to this machine via access code. When trying to set up remote access to this machine I get stuck with a problem. This is what shows up in the logs.
Anyone with an off the top of their head solution on what might be causing this?
I follow the steps twice to make sure I did not miss any steps, on the latest ubuntu14.04. However host service cannot start, because no host#.....json file is created in ~/.config/chrome-remote-desktop after installing the deb package built from source. Therefore, webapp installed successfully on both Chrome and Chromium built from source, but there is no way to detect host service... Error message as below
[0422/192509:ERROR:daemon_controller_delegate_linux.cc(150)] Failed to run "/opt/google/chrome-remote-desktop/chrome-remote-desktop --get-status". Exit code: 1
It looks like the code was refactored and remoting_native_messaging_host renamed to remoting_me2me_native_messaging_host. It seems the command line to build this with ninja should be:
$ GYP_GENERATORS=ninja ./build/gyp_chromium $ ninja -C out/Release remoting_me2me_host remoting_start_host remoting_me2me_native_messaging_host remoting_native_messaging_manifests
It looks like Ubuntu 14.04 has randr enabled in Xvfb by default and provides no Xvfb-randr, you can link Xvfb to Xvfb-randr if you want the resizing display, but haven't got far enough to see if that even works; see Aquarius's comment above - still affects my build
It appears to me that remoting-webapp is also broken.
remoting-webapp : sh: 0: getcwd() failed: No such file or directory no launch link presented in the extensions page.
remoting-webapp.v2, remoting-webapp-pnacl : launches, "Unexpected error occured, please report this problem to the developers" Console, main.html : "OAuth2 request failed: Service responded with error: 'bad client id: {0}'"
Thinking maybe my creds got invalidated, I created a new project in developers console, generate new web application client id, new key for browser applications, and update my .gyp/include.gypi, rerun gclient sync, it says it updated sources from include.gypi, but again get the same error. Tried creating new projects in the developers console again, twice, same.
I have gotten nosvn fetch to download chromium sources but cannot get chrome sources
nickw.nsw: I think the target has been renamed, so fetch chromium should be the correct command now. I'll update that line of the instructions.
hi
I downloaded the remoting source code on windows8 and compiled it with ninja. I install the remoting_host.exe as service using sc command and redirect the log to file but when i start the service it give me an error "1021/180130:ERROR:daemon_process_win.cc(307)] Failed to open HKLM\SOFTWARE\Chromoting\paired-clients: The system cannot find the file specified. (0x2)". please help me i dont know whats wrong