Tech, Gadgets, Photography, Social Media and Poor Spelling

Dual-Booting your Chromebook

acerc7bookDual-booting is when a computer has two Operating Systems (for example, Mac OS and Windows 7). This is possible on a Chromebook although currently only dual-bootingUbuntu Linux is advisable using the method detailed below.  All credit for the automated script goes to Jay Lee of Chromebook Central. You can read his original blog post here. At the present time the script will install Ubuntu 11.04. Credit for the code to switch easily between ChromeOS and Ubuntu goes to Robby Chen. You can read his original blog posthere.
Warning: This will delete all data from your Chromebook and return it to factory settings so ensure that you have turned on Sync so that all your bookmarks and settings are not lost and have copied off all your files to an SD card or USB drive.
It is highly recommended that you create a recovery USB or SD card before you begin by going to chrome://imageburner on your Chromebook or this page on a computer running Windows, Mac or Linux.
Make sure that your Chromebook is plugged in so that it cannot run out of battery during this procedure.
You can download all the files used in this script to the root of a USB drive or SD card and it will use them instead of downloading again. Just grab all 52 of the “ubuntu-1104.bin??.bz2” files from here.
Installing Ubuntu
  1. The first step is to activate Developer Mode on your Chromebook. Click on the name of your device to view the appropriate instructions.
  2. Make sure you ran the “chromeos-firmwareupdate –mode=todev” command mentioned in the Developer Mode instructions for your device.
  3. Reboot your Cr-48 but don’t login. Make sure you have a WiFi or Ethernet connection ( USB Ethernet for the Cr48) at this point. 3G is not recommended. Press Ctrl+Alt+=> (=> is the forward arrow where the F2 key used to be) to load a command line window.
  4. Login with the username “chronos” and no password.
  5. Type this exactly (without the quotation marks) and then press enter.
    • “wget; sudo sh hnkxo”
      • N.B. If you get a “Not found” error you are not connected to the internet.
  6. You can now allocate space on the Solid State Drive to Ubuntu. You should enter a value between 5GB and 10GB in 1GB increments.
    • N.B.If you use a value of 8GB or greater there is not a great deal of space for storing files from within ChromeOS
    • For approximately 5 to 15 minutes the Chromebook will appear to be doing nothing and will then reboot. It will spend 5 minutes erasing data from the SSD and will then reboot again. This time it will display the welcome screen you saw when you first used your Chromebook.
  7. Go through the setup process on the Chromebook until you get to the Google login page. You’ll need to have a WiFi or Ethernet Connection again at this point. 3G is not recommended. Now follow steps 2 through 4 again. This time the script will see that you’ve already made room for Ubuntu and will start downloading the Ubuntu 11.04image and copying it to the SSD. If you downloaded the files onto a USB drive or SD card it should now detect them and use those instead of downloading the files. If it does not detect it then check that the files are in the root of the drive.
  8. There are 52  files to be downloaded. Each is compressed so the actual download size ranges from less than 1mb in size to 90mb in size. The total size of all the files is about 1.1GB compressed and 5GB uncompressed so the download and install will take awhile. The files are named ubuntu.binXX.bz2 (where XX is aa, ab, ac, ad, ae, af… ba, bb, bc… all the way to bz).
  9. The script keeps track of which of the 52 files have been successfully installed so if you lose Internet connectivity or power you can just re-run  “wget; sudo sh hnkxo”  and it should resume where it left off.
  10. After all 52 files have been downloaded and copied to the SSD, the script will make a few more updates to your Cr-48 and then reboot.
  11. You’ll see Ubuntu 11.04 start up! The username is “user” and the password is “user” if you need to make changes.
    • N.B. If you chose anything other than 5gb for the partition size, you’ll need to “grow” the ext4 file system to fill the partition. Open a command prompt (AKA terminal) either using the search menu or by pressing Ctrl-Alt-T and run: “sudo resize2fs -p /dev/sda7”. This will grow the ext4 partition to fill the free partition space.
You now have Ubuntu installed and running on your Chromebook. The next stage is to control whether you boot into ChromeOS or Ubuntu. Due to the secure nature of the Chromebook there isn’t a standard BIOS so some terminal commands are necessary. Here is how to do it.
Whilst in Ubuntu:
  1. Open the file named .bashrc in the home folder using the text editor ‘gedit’ by right-clicking the file. You will need to show the hidden files by pressing Ctrl+H. Add the following exactly to the very end of the file on a new line (include all quotation marks this time).
    • alias chromeos=’sudo cgpt add -i 6 -P 0 -S 0 /dev/sda;echo “Switched to Chrome OS, restart the machine to take effect”‘
  2. Type “exit” to close the terminal window and then open another one to load your changes. Type “chromeos” (without quotation marks) and then press enter.
  3. Restart your Chromebook and it will boot Chrome OS.
Whilst in ChromeOS:
  1. Press Ctrl+Alt+=> and login as “chronos” again.
  2. Type “vi .profile” and then press enter.
  3. This creates a file called “.profile” in the chronos home folder which achieves the same function as the .bashrc file in Ubuntu.
  4. Add the following exactly to the file on a new line (include all quotation marks this time).
    • alias ubuntu=’sudo cgpt add -i 6 -P 5 -S 1 /dev/sda;echo “Switched to Ubuntu, restart the machine to take effect”‘
  5. To save the file hold down “Ctrl” and type “XX” and agree to save the file.
  6. Type “exit” to close the terminal window and then open another one and log in as chronos to load your changes. Type “ubuntu” (without quotation marks) and then press enter.
  7. Restart your Chromebook and it will boot Ubuntu.
All Done
Now you can switch between Ubuntu and Chrome OS simply by entering the chromeos or ubuntu commands.
If you wish to upgrade Ubuntu then you should allow the automatic updater to do its work. This will not affect your Chrome OS install. Likewise, ChromeOS can update itself without damaging your Ubuntu install.
Chrooting into Debian.
If you don’t want to set your system up as a dual boot and want to stay within Chrome OS but need a test bed for Linux apps, you can easily set up a Debian Chroot.
Warning: This requires that you have an advanced knowledge of Linux and some familiarity with the CLI and CLI based apps.
Items that you shall need:
Another computer with a Linux distro loaded on it, or the ability to boot into Ubuntu on your Chrome Device (though that defeats the purpose of it, I guess).
WiFi, or a SD card/USB stick.
Now on your Linux box, install debootstrap and run
mkdir wheezy
debootstrap —arch i386 wheezy wheezy
tar czvf w.tar.gz wheezy

Now transfer w.tar.gz to your Chrome Device. Dropbox or Google Drive are good methods, or you can use a removable media drive.
Move w.tar.gz to /home and run the following on your Chrome device.

mount -o rw,remount,exec,dev /home
cd /home
tar zxvf w.tar.gz
Create a .sh script and throw it in /usr/local/bin on your Chrome device.
cp /proc/mounts /usr/local/wheezy/etc/mtab
mount -o bind /sys /usr/local/wheezy/sys
mount -o bind /proc /usr/local/wheezy/proc
mount -o bind /dev/ /usr/local/wheezy/dev
mount -o bind /dev/pts /usr/local/wheezy/dev/pts
mount -o bind /tmp /usr/local/wheezy/tmp
mount -o bind /home/chronos/user/ /usr/local/wheezy/root/chronos
cp /home/chronos/.Xauthority /usr/local/wheezy/root/
chroot /usr/local/wheezy/

If you want X binding add the following to the bash.rc file in the Chroot.

export XAUTHORITY=/root/.Xauthority
export DISPLAY=”:0.0”

All Done

To get into the chroot, simply run the script that you created.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


This entry was posted on February 23, 2013 by in Google, howto, ilike, tip and tagged , , , , , , , , , .
%d bloggers like this: