Install Chromium OS on your Netbook

This post explains how to install Chromium OS on a netbook.  Chromium OS is the open source project upon which Google base the Chrome OS operating system.

More specifically, I installed the operating system on my HP Mini 210 and did all the preparation work on a PC and laptop running Ubuntu 12.04/13.04.  The installation will vary depending on the specific hardware used, so your installation process will most likely differ from mine in some ways.

Download the OS

If you are confident in compiling source code, you can download the Chromium OS source code directly from the projects website. Alternatively, you can download a pre-compiled image from a site such as Hexxeh or Arnold The Bat.

My netbook required Broadcom wireless drivers, so I downloaded a specific Broadcom Special Edition Build from Arnold The Bat.

Create Bootable USB Image

After unzipping the image, write it to a USB key, which should be at least 4GB in size. I used usb-imagewriter to create my bootable USB key.  If you are running Windows, you can use Image Writer for Windows.

Sometimes usb-imagewriter can freeze if the image file is buried too deeply in your folder structure.  If you experience any problems, try moving the image file onto your desktop before trying again.

Boot From USB

If your hardware is compatible, after a short boot-up you will be presented with a set-up page, which has just three questions: Language, Keyboard Layout and Wifi Network.  Once answered, you can proceed to login to your Google account.

For those of us with a Broadcom wireless card, Chromium OS will not recognise your card at this point, even using the special Broadcom build of the OS. You will first need to connect your netbook via an ethernet cable so that you can log in to the system. Then bring up a localhost login prompt by pressing Ctrl+Alt+F2.  Log in with username ‘chronos’ and password ‘password’ (this may vary depending on your build).

Now type the following lines and the command prompt (the password for sudo is also ‘password’):


sudo su
mount -o remount, rw /
sudo echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
sudo echo "blacklist b43legacy" >> /etc/modprobe.d/blacklist.conf
sudo echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
sudo echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf
sudo echo "wl" >> /etc/modules
sudo touch /etc/modprobe.d/wl.conf
sudo echo "alias wlan0 wl" >> /etc/modprobe.d/wl.conf
cd /lib/modules/3.4.0/kernel/drivers/net/wireless/
wget http://chromium.arnoldthebat.co.uk/files/fw/lib/modules/3.4.0/kernel/drivers/net/wireless/wl.ko
sudo insmod /lib/modules/3.4.0/kernel/net/wireless/cfg80211.ko
sudo insmod /lib/modules/3.4.0/kernel/net/wireless/lib80211.ko
sudo insmod /lib/modules/3.4.0/kernel/net/wireless/lib80211_crypt_ccmp.ko
sudo insmod /lib/modules/3.4.0/kernel/net/wireless/lib80211_crypt_tkip.ko
sudo insmod /lib/modules/3.4.0/kernel/net/wireless/lib80211_crypt_wep.ko
sudo insmod /lib/modules/3.4.0/kernel/drivers/net/wireless/wl.ko
sudo depmod -a

After this, wifi should start working.

Install to Hard Drive

If Chromium OS is the only operating you intend to run on your netbook, installation is a simple as pressing Ctrl+Alt+T to get to the command prompt, and typing ‘install’. If you intend to dual (or more)  boot, things are a little more complicated.

Firstly, you need to replicate the partitions that are on your USB drive on your hard drive. You can check the partitions on your USB key using GParted.  Make a note of the Partition Name, File System, Label and Size for each partition. Mine looked like this:


Partition     File System     Label          Size
/dev/sdb3     Ext2            ROOT-A     1.21 GiB
/dev/sdb1     Ext4            STATE         1 GiB
/dev/sdb8     Ext4            OEM          16 MiB

Older versions of Chromium OS used partitions C-ROOT and C-STATE, but these have now been changed to ROOT-A and STATE.  You do not need to create an OEM partition on your hard drive.

I created a little more space that was strictly required to get the system running.  I gave 2GB to my ROOT-A partition and 16GB to my STATE partition.  Again, make a note of the ROOT-A  and STATE partitions when you create them on your hard drive.

The next step is to copy the partitions from your USB onto your hard drive.  To do this run:


sudo dd if=/dev/sdb3 of=/dev/sda7 bs=4096
sudo dd if=/dev/sdb1 of=/dev/sda8 bs=4096

The destination partitions (sda7 and sda8 in this case) will vary, depending on how you partition your hard drive.

Assuming you are using Grub2 for your bootloader, you now need to update it so Chromium OS will appear in the menu. Running Grub Customizer should detect your installation as an “unknown Linux distribution”. From GRUB version 1.99 or later, you can add the menu option in the 40_custom file.  Open the file with:

gksudo gedit /etc/grub.d/40_custom

Then add:

menuentry "Chromium OS" {
insmod ext2
set root=(hd0,msdos7)
linux /boot/vmlinuz root=/dev/sda7 rw noresume noswap i915.modeset=1 loglevel=1 quiet
noinitrd
}

Older guides will use the line “initrd /boot/initrd.img” here, but newer versions of the OS don’t use RAM disk, so you need to use “noinitrd” instead.  Also, you will need to change the “set root” line to reflect the hard drive and partition where ROOT-A resides.

After updating the 40_custom file, you should run the following commands to ensure that it is executable and that GRUB updates:

sudo chmod +x /etc/grub.d/40_custom
sudo update-grub

You may find that updating Grub automatically finds your installation.  Mine showed “unkown Linux distribution (on /dev/sda7) four times in in my menu after updating.  You can use grub-customizer to remove the extra menu items and/or amend them.

Okay, so the OS now appears in the Grub menu, but there is still one more thing you will need to do before you can boot into the OS. The problem is that Chromium OS expects the STATE partition to be partition 1, but if you are dual booting it most likely won’t be. To fix this, you need to got to /sbin in your ROOT-A partition and open the chromeos_startup.  Search for the line that says:

STATE_DEV = {$ROOT_DEV}1

Change the number at the end to whatever number your STATE partition is (Gparted can tell you this).  After changing this number to 7, my Chromium OS booted with no problems! And here it is:

ChromeOS-HPMini

 

John