blob: af9a8be21c68ecc076b3e318265083e2a0c7ebd7 [file] [log] [blame] [view]
andybons222c4ee2015-08-25 16:51:031# Chromoting Build Instructions
andybons3322f762015-08-24 21:37:092
andybons222c4ee2015-08-25 16:51:033Chromoting, also known as
4[Chrome Remote Desktop](https://support.google.com/chrome/answer/1649523),
5allows one to remotely control a distant machine, all from within the Chromium
6browser. Its source code is located in the `remoting/` folder in the Chromium
7codebase. For the sake of brevity, we'll assume that you already have a
8pre-built copy of Chromium (or Chrome) installed on your development computer.
andybons3322f762015-08-24 21:37:099
andybons222c4ee2015-08-25 16:51:0310[TOC]
andybons3322f762015-08-24 21:37:0911
andybons222c4ee2015-08-25 16:51:0312## Obtain API keys
andybons3322f762015-08-24 21:37:0913
andybons222c4ee2015-08-25 16:51:0314Before you can compile the code, you must obtain an API key to allow it to
kelvinp0e8254a2015-10-16 18:04:4715access the federated Chrome Remote Desktop API.
andybons222c4ee2015-08-25 16:51:0316
171. Join the chromium-dev list, which can be found at
18 https://groups.google.com/a/chromium.org/forum/#!forum/chromium-dev. (This
19 step is required in order to gain access to the Chromoting API.)
201. Visit the Google APIs console at https://code.google.com/apis/console.
21 1. Use the `API Project` dropdown to create a new project with a name of
22 your choice.
kelvinp0e8254a2015-10-16 18:04:4723 1. Click on `APIs & Auth > APIs`.
24 1. Search for `Chrome Remote Desktop API`.
25 1. Click on the `Chrome Remote Desktop API` search result.
26 1. Click on `Enable API`.
27 1. Click on `APIs & Auth > Credentials`.
28 1. Click on `Add Credentials`.
29 1. Choose `OAuth 2.0 client ID`.
30 1. Choose `Chrome App`.
31 1. Under application id, enter `ljacajndfccfgnfohlgkdphmbnpkjflk`.
andybons3322f762015-08-24 21:37:0932
andybons222c4ee2015-08-25 16:51:0333## Obtain Chromium code
andybons3322f762015-08-24 21:37:0934
andybons222c4ee2015-08-25 16:51:0335If you've already checked out a copy of the browser's codebase, you can skip
36this section, although you'll still need to run `gclient runhooks` to ensure you
37build using the API keys you just generated.
andybons3322f762015-08-24 21:37:0938
andybons222c4ee2015-08-25 16:51:03391. Install the build dependencies, which are listed at
40 http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites.
411. Install the depot\_tools utilities, a process that is documented at
42 http://dev.chromium.org/developers/how-tos/install-depot-tools.
431. Download the Chromium source code by running:
44 `$ fetch chromium --nosvn=True`
andybons3322f762015-08-24 21:37:0945
andybons222c4ee2015-08-25 16:51:0346## Build and install the Linux host service
andybons3322f762015-08-24 21:37:0947
andybons222c4ee2015-08-25 16:51:0348If you want to remote into a (Debian-based) GNU/Linux host, follow these steps
49to compile and install the host service on that system. As of the time of
50writing, you must compile from source because no official binary package is
51being distributed.
andybons3322f762015-08-24 21:37:0952
andybons222c4ee2015-08-25 16:51:03531. Start in the `src/` directory that contains your checkout of the Chromium
54 code.
551. Build the Chromoting host binaries:
andybons3322f762015-08-24 21:37:0956
andybons222c4ee2015-08-25 16:51:0357 ```shell
58 $ ninja -C out/Release remoting_me2me_host remoting_start_host \
59 remoting_native_messaging_host remoting_native_messaging_manifests
60 ```
andybons3322f762015-08-24 21:37:0961
andybons222c4ee2015-08-25 16:51:03621. When the build finishes, move into the installer directory:
63 `$ cd remoting/host/installer/`
641. Generate a DEB package for your system's package manager:
65 `$ linux/build-deb.sh`
661. Install the package on your system: `$ sudo dpkg -i *.deb`
671. The next time you use the Chromoting extension from your browser, it should
68 detect the presence of the host service and offer you the option to
69 `Enable remote connections`.
70 1. If the Web app doesn't properly detect the host process, you may need to
71 create a symlink to help the plugin find the native messaging host:
72 `$ sudo ln -s /etc/opt/chrome /etc/chromium`
andybons3322f762015-08-24 21:37:0973
andybons222c4ee2015-08-25 16:51:0374(NB: If you compile the host service from source and expect to configure it
75using the browser extension, you must also compile the latter from source.
76Otherwise, the package signing keys will not match and the Web app's OAuth2
77token will not be valid within the host process.)
andybons3322f762015-08-24 21:37:0978
kelvinp0e8254a2015-10-16 18:04:4779## Build and install the Chrome packaged app
andybons3322f762015-08-24 21:37:0980
andybons222c4ee2015-08-25 16:51:0381The Web app is the Chromoting system's main user interface, and allows you to
82connect to existing hosts as well as set up the host process on the machine
83you're currently sitting at. Once built, it must be installed into your browser
84as an extension.
andybons3322f762015-08-24 21:37:0985
andybons222c4ee2015-08-25 16:51:03861. Start in the `src/` directory that contains your checkout of the Chromium
87 code.
881. Build the browser extension (Be sure to replace the substitutions denoted by
89 angled braces.):
andybons3322f762015-08-24 21:37:0990
andybons222c4ee2015-08-25 16:51:0391 ```shell
kelvinp0e8254a2015-10-16 18:04:4792 $ GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=<client id> \
andybons222c4ee2015-08-25 16:51:0393 ninja -C out/Release remoting_webapp
kelvinp0e8254a2015-10-16 18:04:4794 ```
andybons3322f762015-08-24 21:37:0995
andybons222c4ee2015-08-25 16:51:03961. Install the extension into your Chromium (or Chrome) browser:
97 1. Visit the settings page [chrome://extensions].
98 1. If it is unchecked, tick the `Developer mode` box.
99 1. Click `Load unpacked extension...`, then navigate to
kelvinp0e8254a2015-10-16 18:04:47100 `out/Release/remoting/remoting.webapp.v2/` within your code checkout.
andybons222c4ee2015-08-25 16:51:03101 1. Confirm the installation, open a new tab, and click the new app's
102 Chromoting icon.
103 1. Complete the account authorization step, signing into your Google
104 account if you weren't already.
105
106## Build and install the Android client
107
108If you want to use your Android device to connect to your Chromoting hosts,
109follow these steps to install the client app on it. Note that this is in the
110very early stages of development. At the time of writing, you must compile from
111source because no official version is being distributed.
112
1131. Follow all the instructions under the `Getting the code` and
114 `Install prerequisites` sections of: TODO: 404
115 http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
1161. Move into the `src/` directory that contains your checkout of the Chromium
117 code.
1181. Build the Android app: `$ ninja -C out/Release remoting_apk`
1191. Connect your device and set up USB debugging:
120 1. Plug your device in via USB.
121 1. Open the Settings app and look for the `Developer options` choice.
122 1. If there is no such entry, open `About phone`, tap `Build number`
123 7 times, and look again.
124 1. Under `Developer options`, toggle the main switch to `ON` and enable
125 `USB debugging`.
1261. On your machine and still in the `src/` directory, run:
127 `$ build/android/adb_install_apk.py --apk=out/Release/apks/Chromoting.apk`
1281. If your Android device prompts you to accept the host's key, do so.
1291. The app should now be listed as Chromoting in your app drawer.
130
131See the [chromoting_android_hacking.md] guide for instructions on viewing the
132Android app's log and attaching a debugger.