Chromium on Chromium OS uses Linux Chromium as a base, but adds a large number of features to the code. For example, the login UI, window manager and system UI are part of the Chromium code base and built into the chrome binary.
Fortunately, most Chromium changes that affect Chromium OS can be built and tested on a Linux workstation. This build is called “linux-chromeos”. In this configuration most system services (like the power manager, bluetooth daemon, etc.) are stubbed out. The entire system UI runs in a single X11 window on your desktop.
First, follow the normal Linux build instructions as usual to get a Chromium checkout.
Chromium OS builds of Chromium require some additional build dependencies which can be synced by adding
'chromeos' to the
target_os list in your
.gclient configuration. This file is located one level up from your Chromium checkout's
If you don't already have a
target_os line present, simply add this to the end of the
target_os = ['chromeos']
If you already have a
target_os line present in your
.gclient file, you can simply append
'chromeos' to the existing list there. For example:
target_os = ['android', 'chromeos']
.gclient file is updated, you will need to run
gclient sync once before proceeding with the rest of these instructions.
Run the following in your chromium checkout:
$ gn gen out/Default --args='target_os="chromeos"' $ autoninja -C out/Default chrome $ out/Default/chrome
Some additional options you may wish to set by passing in
gn gen or running
gn args out/Default:
use_goma = true # Googlers: Use build farm, compiles faster. is_component_build = true # Links faster. is_debug = false # Release build, runs faster. dcheck_always_on = true # Enables DCHECK despite release build. enable_nacl = false # Skips native client build, compiles faster. # Set the following true to create a Chrome (instead of Chromium) build. # This requires a src-internal checkout. is_chrome_branded = false # Adds internal features and branded art assets. is_official_build = false # Turns on many optimizations, slower build.
NOTE: You may wish to replace ‘Default’ with something like ‘Cros’ if you switch back and forth between Linux and Chromium OS builds, or ‘Debug’ if you want to differentiate between Debug and Release builds (see below).
See GN Build Configuration for more information about configuring your build.
You can also build and run test targets like
By default this build signs in with a stub user. To specify a real user:
--user-data-dir=/tmp/chrome --bwsi --incognito --login-user='$guest' --login-profile=user
Signing in as a specific user is useful for debugging features like sync that require a logged in user.
The Chromium OS build requires a functioning GL so if you plan on testing it through Chromium Remote Desktop you might face drawing problems (e.g. Aura window not painting anything). Possible remedies:
--use-gl=osmesa, but it‘s ultra slow, and you’ll have to build osmesa yourself.
To more closely match the UI used on devices, you can install fonts used by Chrome OS, such as Roboto, on your Linux distro.
See Building Chromium for a Chromium OS device for information about building and testing Chromium for Chromium OS.