Friday, July 27, 2012

Installing Ubuntu on a Chromebook

As far as I can tell, this post on the Chromium.org site is the most complete set of instructions for installing Ubuntu on the Chromebook.  If you don't have the time or the technical confidence to run through their procedure, Jay Lee has an awesome scripted method to install Ubuntu 12.04.  Sadly, this most recent entry from Jay is meant for a 64-bit system, and although Chromium was 64-bit for some time, Google had to revert back to 32-bit when some problems were reported.  So - what we're left with is an earlier post from Jay Lee to add Ubuntu 11.04 to your Chromebook.  Once installed, you can follow the standard upgrade path within Ubuntu to move to version 11.10, and then on to version 12.04.

Here are the complete steps I followed for the Samsung Series 5
(mostly following the procedure from Jay Lee).

1.  Developer Mode
You'll want to follow this procedure on Chromium.org, but if want to cut to the chase - the's the short of it:

a.  Flip the switch behind the door on the right side of the machine - the switch should be pushed towards the back of the device.


b.  Add the developer BIOS - At the login screen, press Ctrl-Alt-"→" (Ctrl-Alt-F2). This should bring up a shell (terminal) prompt.  Log in with the username 'chronos' and then run this command:
         sudo chromeos-firmwareupdate --mode=todev


2.  Start the Jay Lee script
Again, logged in as "chronos" run this command from the shell prompt:
        "wget http://goo.gl/hnkxo; sudo sh hnkxo"
You'll have to choose a partition size for the Ubuntu file system - 5-10GB.
5 provides very little room for Ubuntu, 10 leaves almost no room for Chrome.
7GB works well for me.
Give this a few mins to run, and wait for the machine to reboot automatically.

3.  Run the script again to start fetching the Ubuntu files
Same process again - log in as "chronos" and kick off the script:
        "wget http://goo.gl/hnkxo; sudo sh hnkxo"
This time through, the script will start downloading 50 something files.
Once this is complete, Ubuntu should start.
Username and password is "user"

4.  Resize the Ubuntu partition
Run this command to ensure the Ubuntu partition is using the full space allocated:
     sudo resize2fs -p /dev/sda7

5.  Upgrade Ubuntu
Hit the "Dash Home" (first slot in the taskbar on the left) and search for "Update Manager"
First "Check" for updates, and then "Install Updates"
Only once the one-off updates are complete should you then click the button to upgrade to 11.10
Follow the same process to upgrade to 12.04

6. Clean as needed
If you start running out of space during the upgrade process, search for a program called "Computer Janitor" to clean up some unnecessary files.


7.  Switch back to Chrome (and back to Ubuntu)

Google will switch back and forth between kernel A and kernel B as it updates your device.  If you've been using your device for some time, you might have a version of Chrome in A and B.  The above process installs Ubuntu in kernel C.  All that's left to do to choose between Chrome and Ubuntu is to choose your boot priority.

In a term window run this to get a look at where your kernels are:
sudo cgpt show /dev/sda

Here are the tags for cgpt
-i is the parition number
-P is the priority
-T is the number of attempts (tries)
-S is the successful flag (1 or 0)


Here's a sample -

Make Ubuntu the priority, but only give it one try, and fallback to kernel A if it doesn't work:
sudo cgpt add -i 6 -P 5 -T 1 -S 0 /dev/sda
sudo cgpt add -i 2 -P 4 -S 1 /dev/sda



8.  If all else fails...
Restore your Chromebook to factory spec.
This procedure should walk you through it.
And you can turn off developer mode with the "Leaving Developer Mode" section of the original how-to.



9.  Ubuntu 12.04 - What next?
Try this.