andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 1 | # Chromoting Build Instructions |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 2 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 3 | Chromoting, also known as |
| 4 | [Chrome Remote Desktop](https://support.google.com/chrome/answer/1649523), |
| 5 | allows one to remotely control a distant machine, all from within the Chromium |
| 6 | browser. Its source code is located in the `remoting/` folder in the Chromium |
| 7 | codebase. For the sake of brevity, we'll assume that you already have a |
| 8 | pre-built copy of Chromium (or Chrome) installed on your development computer. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 9 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 10 | [TOC] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 11 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 12 | ## Obtain API keys |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 13 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 14 | Before you can compile the code, you must obtain an API key to allow it to |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 15 | access the federated Chrome Remote Desktop API. |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 16 | |
| 17 | 1. 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.) |
| 20 | 1. 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. |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 23 | 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`. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 32 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 33 | ## Obtain Chromium code |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 34 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 35 | If you've already checked out a copy of the browser's codebase, you can skip |
| 36 | this section, although you'll still need to run `gclient runhooks` to ensure you |
| 37 | build using the API keys you just generated. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 38 | |
sbc | 9f033f8 | 2015-11-26 00:50:52 | [diff] [blame] | 39 | 1. [Install the build dependencies](linux_build_instructions_prerequisites.md). |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 40 | 1. Install the depot\_tools utilities, a process that is documented at |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 41 | https://dev.chromium.org/developers/how-tos/install-depot-tools. |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 42 | 1. Download the Chromium source code by running: |
| 43 | `$ fetch chromium --nosvn=True` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 44 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 45 | ## Build and install the Linux host service |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 46 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 47 | If you want to remote into a (Debian-based) GNU/Linux host, follow these steps |
| 48 | to compile and install the host service on that system. As of the time of |
| 49 | writing, you must compile from source because no official binary package is |
| 50 | being distributed. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 51 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 52 | 1. Start in the `src/` directory that contains your checkout of the Chromium |
| 53 | code. |
| 54 | 1. Build the Chromoting host binaries: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 55 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 56 | ```shell |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 57 | $ autoninja -C out/Release remoting_me2me_host remoting_start_host \ |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 58 | remoting_native_messaging_host remoting_native_messaging_manifests |
| 59 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 60 | |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 61 | (`autoninja` is a wrapper that automatically provides optimal values for the |
| 62 | arguments passed to `ninja`.) |
| 63 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 64 | 1. When the build finishes, move into the installer directory: |
| 65 | `$ cd remoting/host/installer/` |
| 66 | 1. Generate a DEB package for your system's package manager: |
| 67 | `$ linux/build-deb.sh` |
| 68 | 1. Install the package on your system: `$ sudo dpkg -i *.deb` |
| 69 | 1. The next time you use the Chromoting extension from your browser, it should |
| 70 | detect the presence of the host service and offer you the option to |
| 71 | `Enable remote connections`. |
| 72 | 1. If the Web app doesn't properly detect the host process, you may need to |
| 73 | create a symlink to help the plugin find the native messaging host: |
| 74 | `$ sudo ln -s /etc/opt/chrome /etc/chromium` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 75 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 76 | (NB: If you compile the host service from source and expect to configure it |
| 77 | using the browser extension, you must also compile the latter from source. |
| 78 | Otherwise, the package signing keys will not match and the Web app's OAuth2 |
| 79 | token will not be valid within the host process.) |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 80 | |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 81 | ## Build and install the Chrome packaged app |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 82 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 83 | The Web app is the Chromoting system's main user interface, and allows you to |
| 84 | connect to existing hosts as well as set up the host process on the machine |
| 85 | you're currently sitting at. Once built, it must be installed into your browser |
| 86 | as an extension. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 87 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 88 | 1. Start in the `src/` directory that contains your checkout of the Chromium |
| 89 | code. |
| 90 | 1. Build the browser extension (Be sure to replace the substitutions denoted by |
| 91 | angled braces.): |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 92 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 93 | ```shell |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 94 | $ GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=<client id> \ |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 95 | autoninja -C out/Release remoting_webapp |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 96 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 97 | |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 98 | 1. Install the extension into your Chromium (or Chrome) browser: |
| 99 | 1. Visit the settings page [chrome://extensions]. |
| 100 | 1. If it is unchecked, tick the `Developer mode` box. |
| 101 | 1. Click `Load unpacked extension...`, then navigate to |
kelvinp | 0e8254a | 2015-10-16 18:04:47 | [diff] [blame] | 102 | `out/Release/remoting/remoting.webapp.v2/` within your code checkout. |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 103 | 1. Confirm the installation, open a new tab, and click the new app's |
| 104 | Chromoting icon. |
| 105 | 1. Complete the account authorization step, signing into your Google |
| 106 | account if you weren't already. |
| 107 | |
| 108 | ## Build and install the Android client |
| 109 | |
| 110 | If you want to use your Android device to connect to your Chromoting hosts, |
| 111 | follow these steps to install the client app on it. Note that this is in the |
| 112 | very early stages of development. At the time of writing, you must compile from |
| 113 | source because no official version is being distributed. |
| 114 | |
| 115 | 1. Follow all the instructions under the `Getting the code` and |
sbc | 9f033f8 | 2015-11-26 00:50:52 | [diff] [blame] | 116 | `Install prerequisites` sections of: |
| 117 | https://www.chromium.org/developers/how-tos/android-build-instructions |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 118 | 1. Move into the `src/` directory that contains your checkout of the Chromium |
| 119 | code. |
Dirk Pranke | 8bd55f2 | 2018-10-24 21:22:10 | [diff] [blame] | 120 | 1. Build the Android app: `$ autoninja -C out/Release remoting_apk` |
andybons | 222c4ee | 2015-08-25 16:51:03 | [diff] [blame] | 121 | 1. Connect your device and set up USB debugging: |
| 122 | 1. Plug your device in via USB. |
| 123 | 1. Open the Settings app and look for the `Developer options` choice. |
| 124 | 1. If there is no such entry, open `About phone`, tap `Build number` |
| 125 | 7 times, and look again. |
| 126 | 1. Under `Developer options`, toggle the main switch to `ON` and enable |
| 127 | `USB debugging`. |
| 128 | 1. On your machine and still in the `src/` directory, run: |
| 129 | `$ build/android/adb_install_apk.py --apk=out/Release/apks/Chromoting.apk` |
| 130 | 1. If your Android device prompts you to accept the host's key, do so. |
| 131 | 1. The app should now be listed as Chromoting in your app drawer. |
| 132 | |
| 133 | See the [chromoting_android_hacking.md] guide for instructions on viewing the |
| 134 | Android app's log and attaching a debugger. |