Family Best Time >> Electronics

How to build Chrome OS for your netbook or VM

A few weeks ago, Google announced that Chrome OS would be ready for release this fall. Like many Google products, Chrome OS is designed to be a game changer. There are no desktop apps, as we usually think. Instead, the entire user experience takes place in the browser. Naturally, some people think this is ridiculous while others see it as a natural evolution of technology. The success or failure of Chrome OS might even be a major factor in determining whether or not this evolution happens. If you want to find out for yourself, here's how to create the Chrome OS image.

Technically, we're building Chromium OS, but the two terms are interchangeable for the purposes of this guide.

What to expect

We are building a complete operating system, not just an individual application, so you can expect more in terms of the steps involved and the time to completion. That said, it's not a terribly difficult process and most of the time, you'll have to wait for the downloads to finish and the code to compile. It would be helpful to have previous experience compiling software under Linux, such as what is described here. Depending on the internet and processor speed, this process can take anywhere from 1-4 hours, but again most of that time is spent waiting for downloads and compilation.

Prerequisites

To run the build correctly, you will need to run a 64-bit Linux installation. 32-bit is currently not supported as a build environment, but this may change in the future. Google recommends Ubuntu for this purpose, so that's the operating system used for the rest of this guide.

To install all the software needed to build Chrome OS properly, simply run the following from a terminal:

sudo apt-get install bison fakeroot flex g++ g++-multilib gperf libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libdbus-glib-1-dev libgconf2-dev libgl1-mesa-dev libglu1 -mesa-dev libglib2.0-dev libgtk2.0-dev libjpeg62-dev libnspr4-dev libnss3-dev libpam0g-dev libsqlite3-dev libxslt1-dev libxss-dev mesa-common-dev msttcorefonts patch perl pkg-config python python2.6 -dev rpm subversion libcupsys2-dev libgnome-keyring-dev git-core subversion

One thing that isn't in Ubuntu's repositories is Google's repository tools package, but it's a simple download and extract. Click here to get the tar.gz file and extract it to your home directory. You should now have a directory called depot_tools in your house.

Now just add this location to your command path with:

#Add this to your ~/.bashrc file to make it permanentexport PATH=$PATH:~/depot_tools

Get source code

We will create a chrome in your home to contain all the files for this version, then download the source code. It'll download a few hundred megabytes, so it's probably going to take a while.

mkdir ~/chromecd ~/chromegclient config http://src.chromium.org/git/chromiumos.gitgclient sync
How to build Chrome OS for your netbook or VM

And now to perform the real meat of this process, the actual construction.

./setup_board --board=x86-generic #Define architecture ./build_packages --board=x86-generic #This is the real build. Will take a few minutes at least.

If everything went well, you are ready for the last step…

Generate the image

Finally, we need to create an image of this system that we can use on our devices or virtual machines. To create the base image, return to your shell and enter…

./build_image --board=x86-generic

…and sit down for tea while you wait.

When done, you'll get information on the exact location of the image file, as well as handy details on how to automatically generate a more specific type of image for your needs, such as USB, VMWare, or Virtualbox.

How to build Chrome OS for your netbook or VM

Before you can run these scripts, you will need to exit the chroot environment by typing

exit

In this example we will be building for Virtualbox. Be sure to change the directory location to your system location.

./image_to_virtualbox.sh --from=~/chrome/chromiumos.git/src/build/images/x86-generic/YOURIMAGELOCATION --to=~/chromeOS.vdi

Problems?

VMWare / Virtualbox :Unfortunately, there seems to be a bug in some versions of the image_to_vmware script which also affects the image_to_virtualbox script. If you get an error regarding "Could not open /usr/lib/shflags", then you need to do a quick edit of image_to_vmware.sh and change the line

sudo "$TEMP_MNT"/postinst /dev/sda3

to

sudo "$TEMP_MNT"/postinst /dev/sda3 –postcommit

.
USB :It seems the image_to_usb script doesn't like having a tilde (~) in the de flag. If you get errors saying it can't find the image, make sure to use the full path in the of flag.

Will Chrome OS be the next big thing, or is it a step in the wrong direction?