Monday, October 29, 2012

ARM ChrUbuntu 12.04 Alpha 1 Now Available For New Chromebooks!

Update #3: There's a new version of the ChrUbuntu script that offers much more flexibility. Be sure to check out my latest post at ChrUbuntu: One Script to Rule them All!

Update #2: I've updated the script so that module loading works with beta and dev channel Chrome OS kernels. If you were on beta or dev channel and ChrUbuntu booted but you couldn't connect to WiFi/ethernet, try now. Thanks to not-so-lazy commenter "The Lazy Husband" for the pointer and fix. I've also added a possible fix for some people getting out of space errors. The script below now works with external USB Flash and SD Card ChrUbuntu installs.

Update: Instructions for installing to an external USB or SD Card are up!

Thanks to those who donated to the project, I'm excited to announce the first alpha release of ChrUbuntu 12.04 for the new Google Chromebook with ARM processor! This is an alpha release meaning there's a good bit of stuff that doesn't work yet. Known issues include:
  • Sound does not work in my limited testing
  • The touchpad is somewhat finicky to work with
  • Google Chrome does not exist for ARM Linux distributions except the Chromebook itself. You can install Chromium browser from the universe repository.
  • Graphics are not accelerated. We need to work on ripping Chrome OS binary drivers or wait until Google open sources the full stack for the new Chromebooks.
  • ???
  • success!
What works:
  • WiFi (no problem connecting to my home WPA2-PSK network)
  • Bluetooth (limited testing)
  • Battery monitor
  • USB / SD Card
Installing ChrUbuntu on a new Chromebook is extremely easy, just follow the steps below.
  1. You need to be in developer mode. Start with your Chromebook off. Hold down the ESC and Refresh keys (2 keys at top left of keyboard on either side of the arrow keys) and then press the power button. You'll boot up to the recovery screen prompting you to perform USB recovery. Now hit CTRL+D on the keyboard and then Enter. You should reboot into recovery mode.
  2. After entering developer mode, your Chromebook will wipe and then reboot into the out of box (OOB) setup screen. Proceed to configure WiFi but do not login to a Google account. Press CTRL+ALT+=> (=> is the forward arrow where the F2 key would be on a PC). Do not use the normal CTRL+ALT+T method to get a shell. Use the CTRL+ALT+=> method while no one is logged in.
  3. Login as user chronos, no password is needed.
  4. As the chronos user, run:

    wget; sudo bash 34v87

    Make sure you have the command exactly right. 34v87 is all lowercase letters and would sound like "three four vee eight seven" if you said it out loud (go ahead, try it!). If you get a "not found" error, make sure you have Internet connectivity.
  5. You'll be prompted with some information about your Chromebook. Press Enter to continue.
  6. The Chrome OS stateful partition where your data and settings are stored is just short of 11gb by default, the script shrinks the stateful partition to make room for ChrUbuntu. You can choose to give ChrUbuntu from 5gb up to 10gb in 1gb increments (Note: If you've installed a larger SSD in your Chrome device, your max number and recommended max will be larger). I recommend not going higher than 9 as 10 leaves Chrome OS with very little free space (less than 1gb). Once you've entered a number, your hard drive will be repartitioned. Then the Chromebook reboots, wipes the stateful partition, reboots again and shows you the Welcome screen you got when you first turned on your Chromebook out of the cardboard box.
  7. Go through the Chrome OS setup process again until you get to the Google login page. You'll need to have a WiFi or Ethernet connection again at this point. Now follow steps 2 through 5 again. This time the script will see that you've already made room for Ubuntu and will start downloading the ChrUbuntu image and copying it to the SSD.
  8. There are 52 100mb files to be downloaded. Each is compressed so the actual download size ranges from less than 1mb in size to 99mb in size. The total size of all the files is about 1gb compressed and 5gb uncompressed so the download and install will take awhile. The files are named ubuntu-1204-arm.binXX.bz2 (where XX is aa, ab, ac, ad, ae, af... ba, bb, bc... all the way to bz). If you want to see how big each piece is, take a look here.
  9. The script keeps track of which of the 52 files have been successfully installed so if you lose Internet connectivity, or the battery dies (you should be plugged in BTW), etc, just re-run Step 4 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 ChrUbuntu start up! The username is "user" and the password is "user" if you need to make changes.
  12. Right now, you're in ChrUbuntu but if you reboot, you'll be back in Chrome OS. To make ChrUbuntu the default, run:

    sudo cgpt add -i 6 -P 5 -S 1 /dev/mmcblk0

    (password is "user"). It should be possible to run this from ChrUbuntu or Chrome OS.
  13. To make Chrome OS the default again, either turn off Developer Mode (instructions for doing show are shown at bootup), or run:

    sudo cgpt add -i 6 -P 0 -S 1 /dev/mmcblk0
Thanks again to all the donors! We'll keep working to make ChrUbuntu a great and fun experiment on Chrome hardware!

Wednesday, October 24, 2012

First steps

I've got an Ubuntu rootfs booted. I need to get networking up and running so I can install packages and work towards a graphical desktop. We'll get there!

Friday, October 19, 2012

ChrUbuntu on the ARM-based Chromebook: Let's Do This!

Update: We made it! Thanks to all who donated!

By now, you've probably seen that Google has announced a new $249 Chromebook and if you're reading this blog, no doubt you also know that unlike other Chromebooks, this one is based off of an ARM processor. That means these Chromebooks definitely will not work out of box with my ChrUbuntu 12.04 instructions which assume an x86 Intel processor.

However, I'm fairly confident that Ubuntu will run on these ARM based Chromebooks with a tad bit of work and some Google employees seem to agree with me. I can't really justify purchasing a new Chromebook since at last count, we have 5 Chrome OS devices in the house but I do want to see ChrUbuntu running on these units also. So I'm starting a ChrUbuntu on ARM-based Chromebooks campaign. Here's how it works:

  1. You donate an amount of your choosing to the campaign. Donations are accepted via PayPal so they're simple and secure. I'll keep this blog post updated with the total amount donated so far.
  2. If the donation fund doesn't reach $250 by November 19th (1 month from now), I'll refund all donors via PayPal.
  3. If the donation fund reaches $250, I purchase an ARM-based Chromebook and get to work on ChrUbuntu for ARM-based Chromebooks.
  4. I will do my very best to get ChrUbuntu running on the new Chromebook. If I'm successful, full details and scripts will be posted to this blog as has been the case for ChrUbuntu on the Cr-48, Samsung Series 5, etc. I'll keep the unit in order to maintain ChrUbuntu for ARM-based Chromebooks.
  5. If I fail to get ChrUbuntu for ARM-Chromebooks working by Jan. 1, 2013, I'll donate the unit to someone in need of my choosing (think along the lines of broke college student who has no computer).
If you're still reading, you can donate to the campaign here (goal reached, link removed, please stop giving me money).

Thursday, October 11, 2012

How to run Chrome OS (not Chromium OS) on a Virtual Machine

As part of my job, I often want to be able to demo Chrome OS to clients so that they can see how simple it is or to show them a concept such as enterprise enrollment. However, since Chromebooks aren't compatible with common screen-sharing applications like or WebEx, it's not possible. Google+ Hangouts do work on Chrome OS but you have to have a user logged into the Chromebook, no demoing the login screen or enrollment process.

So I set out to find a way to run Chrome OS (the official code) on a virtual machine. Even before Chromebook hardware was available, Chromium OS, the open source base for Chrome OS has been able to run on virtual machines (see Hexxeh's nice nightly builds) but I didn't want to deal with the rabbit trail of Chromium OS vs. Chrome OS when presenting to clients, I wanted them to see exactly what they'd see on a Chromebook. So with a little scripting, I've managed to get Chrome OS running on VMWare workstation (should work on VMWare Player and Fusion also though I haven't tested). Here are the instructions:

Disclaimer: None of this is official or supported. I'm not responsible if Chrome or Chromium OS breaks your physical or virtual machine, destroys your data or re-elects Obama. The risk is entirely your own.

  1. Download this VMWare image. It's an unofficial, 200mb Chromium OS image. We'll use it as the base image, overwriting the Chromium OS filesystem and kernel with Chrome OS. The image is .tar.bz2 compressed. Windows users may need to download 7-Zip to decompress.
  2. Once decompressed, open the .vmx file in VMWare and boot the machine. You'll see Chromium OS boot up. Your VM should have Ethernet setup so the image automatically has Internet connectivity, no need to run through setup since we'll be blowing things away shortly.
  3. Press CTRL+ALT+spacebar. Release the spacebar but hold CTRL+ALT down and press F2. This switches us to the virtual console on Chromium OS (the spacebar is needed to make sure the VMWare guest and not the host OS pick up the CTRL+ALT key combo).
  4. Login as user chronos password chronos. We'll want Chrome OS to start with a fresh stateful partition as soon as we first boot it so run:

    sudo touch /mnt/stateful_partition/.developer_mode                   (password is chronos again)

    this tells Chrome OS that the system has been in developer mode and should be wiped when it next boots up. Since we're running on a VM, there's really no such thing as a developer switch like there is on a real Chrome OS device but Chrome OS assumes it's not in developer mode so it does the wipe for us.
  5. Now we're ready to download Chrome OS and overwrite Chromium OS. This step is pretty easy. Just run:

    wget; sudo bash 4suhf

    this will download a script and run it. The script takes care of downloading Chrome OS and overwriting your VM with it. You'll be able to choose which specific Chrome OS image you wish to use. All of the models I've tested have worked but if you're low on VM resources (RAM, CPU) then I suggest using Mario. If you want a 64-bit VM, use the Samsung 550 or Series 3 image.

    When the script finishes, you'll be back at the command prompt but attempting to run any commands will crash. This is because you're still booted into Chromium OS but you've overwritten your VM disk with Chrome OS. Just manually reboot the VM with the reset button. Your stateful will quickly be wiped and you'll see Chrome OS boot with that official logo!
  • Auto-updates don't work. You'll need to rerun the script in Step 5 to update. Sometimes the recovery image version lags behind the current stable version of Chrome OS.
  • Enterprise enrollment won't work out of box but it can be made to work. Hit CTRL+space then F2 (let go of space, hit F2 while holding CTRL the entire time). Run:

    sudo su -
    echo 'serial_number="1234567890"' > /tmp/machine-info
    restart ui

    replace 1234567890 with whatever serial you prefer. Then follow the normal CTRL+ALT+E method to enroll. If you have devices already listed in your CPanel you can choose one that's not been enrolled yet, use it's serial and be able to demo auto-enrollment.
  • For some reason I can't figure out, Chrome OS always want's to display at 1280x800 but VMWare only shows 1280x720 cutting off the bottom 80 pixels. It's something to do with the VESA BIOS on VMWare I believe (and the fact that Chrome OS expects an Intel graphics card that's not there on the VM). It's annoying that the bottom part of the screen where the clock, menu, etc are is missing. You can however use CTRL+Windows Key to pull up the menu of apps. If anyone finds a workaround to fix this, I'd love to know it. Update: turning the VM off and setting the monitor to 1024x768 forced in VM settings lets you see the menu bar. I couldn't bump the resolution higher than 1024x768 without cutting off the bottom.
Good luck and post in the comments how Chrome OS works in a VM for you!