Friday, May 29, 2015

Chromebookery II - Chromebook harder

Continuing from history leading to Chromebooks.

Chromebooks have much the same hardware as any other laptop - most are based on standard x86 CPUs which are also used in other Windows and even Android based systems. Some run ARM - initially this was cheaper, but Intel responded to the competition, and Atom derived CPUs pushed lower pricepoints till sub-$200 devices appeared with x86 hardware.

So now we have cheap as hell laptop like devices with ChromeOSChromeOS has made huge strides and now there's some real offline software available - HTML5/CSS/Javascript based apps - that run offline, but it's still limited. There's no really capable photo app (yet?). Offline storage is limited. There's no Skype. Skype sounds trivial, but it's a big deal since it provides popular free cross platform video chats. Google's hangouts work well too, but the microphone seems to pick up a lot of feedback by comparison, and in todays world no company seems to want to be compatible with another's messaging app.


So - what can I actually do with a Chromebook offline? Well it's perfectly fine for viewing pictures. It's good for several video formats. There's more than a few games available. There's calculators, note taking, word processors, spreadsheet applications, slide show presentation apps, code editors, educational applications, diagram apps, finance...


Hmm, seems like an awful lot is actually already present. Most people are going to be able to get by quite well. 

Let's take a look at a Chromebook:


Here's a new model - the Acer CB3-111. 11.6" 1366x768 matte screen, 16GB EMMC storage and 2GB RAM with a Celeron N2840 (dual core, up to 2.58GHz, Silvermont). This laptop weighs ~2.75lbs and has excellent battery life - it depends on your use but over 6 hours playing videos is pretty good. I've gotten over 8 hours with loads of battery life to spare working on python/shell scripts/browsing taking a few breaks leaving it in sleep mode. This set me back $150 new and has been pleasant enough to work with to become my main computing device on the go.


Simple is beautiful.
Small unobtrusive branding areas and little LED lights are all that mar the surface.


One USB port on either side (one 3.0, one 2.0).
I have my mini PQI drive in this one (3.0).
It's adding another 64GB.


The rear has a charging port and HDMI port.


Headset port on this side, along with the other USB (2.0) port and security slot.


Next to a pencil and penny to illustrate the thickness.


Here's the chicklet keyboard. The Keyboard is actually quite nice, with good feel.
The mic and camera (1.3MP) are actualy quite decent for video calls.


The base of the laptop isn't as unsightly as most regular laptops.
12 screws hold in the base which we'll be popping out later :D

Hardware wise this feels quite solid. Matte plastic throughout add to it's aesthetic. WiFi card is dual channel AC with bluetooth. It's pleasant to type on. Battery lasts a long time. Had adequate power for most applications. There's little flex, and the low weight makes it comfortable to keep on your lap for a long time.


There's NO fan. This runs dead silent. It does not get hot.


So far so good (really good) - but for many people, specific software will be missed (such as skype). Software with more advanced features will be missed (Open Office/Microsoft Office/Gimp/Photoshop/Eclipse  etc), many popular games that exist on several platforms will be missed (browse gog.com or HumbleBundle.com some time...).
ChromeOS is also lacking VPN connectivity options and can't access network shares.

 


So what can be done about that?



2 options - Replace the OS, or add to the OS.

Replacing the OS involves putting the machine into a radically different state - wiping out the harddrive contents, getting drivers that will work with the system etc. It's good, if you know your laptop's components are supported. This is also more difficult to undo.

I'm being vague saying "Add to the OS". To expand, ChromeOS is a custom Linux distribution. The GUI may be Google's browser but the core of the OS is simply 
Linux. That makes very easy to manipulate once you have access to the innards. What we'll do is make a chroot in this host Linux.

Putting the laptop in developer mode will give the necessary access. Once that's done, running the Crouton script will let us download and install our choice of Linux kernel, along with GUI (gnome, KDE, XFCE etc) and we'll run this other Linux setup in parallel with ChromeOS. The other Linux install will run in a chroot - i.e. the environment of that other Linux will see the installed location as the file-system root. Once it's running, it will also be able to access all devices that ChromeOS already connects to - i.e. the video drivers, audio drivers, touchpad, USB etcetera that ChromeOS has access to will just work.


Step 1: Put the laptop in developer mode:

  1. Press and hold escape and refresh. While holding those, press the power button and your laptop will boot into recovery mode.
  2. When the recovery mode screen comes up, press ctrl+D for the developer mode prompt.
  3. Press Enter to continue and give it a little while as the laptop will wipe all local data, and refresh ChromeOS.
  4. On boot, the laptop will show a warning that developer mode is on. Skip it by pressing ctrl+D or wait 30 seconds. We'll make a change to skip that later.
Step 2: Download and run Crouton
  1. Just click on installer and download crouton to your download folder on the Chromebook.
  2. Press ctrl+alt+T in the chrome browser to open a crosh prompt.
  3. Enter "shell" to open bash.
  4. Navigate to the downloaded crouton script (cd ~/Downloads/)
  5. Run crouton (sudo sh ./crouton). If it's not executable, make it so by running chmod +x crouton. Note the options.
    Run sudo sh ./crouton -t help to list supported GUIs. Run sudo sh ./crouton -r help to list supported kernels.
  6. Assuming you're going with gnome on trusty, you can also specify where to install the new Linux install. I installed mines on the USB drive that you can see in the previous pictures. The drive was formatted with ext4 and named OS_DRIVE. I made the "trustychroot" folder to keep the drive organized.
    sudo sh ./crouton -t gnome-desktop -r trusty -p /media/removable/OS_DRIVE/trustychroot/
    Of course, if you're using the default location, it's just
    sudo sh ./crouton -t gnome-desktop -r trusty
  7. Now give it some time (couple hours). This will install Linux on that USB drive if you specified location as above. If you don't specify the location, the default is on the laptop itself (much faster). With only 16GB available on this model, space can be an issue.
  8. Once done, you can open your Linux install by running
    sudo startgnome -c /media/removable/OS_DRIVE/trustychroot/chroots

    Note - if the install didn't specify the location, just run sudo startgnome.
  9. That's it. You're running Ubuntu on your Chromebook. You can copy the files in the chroot folder off tar them up to backup your intall, move them etc. You can have multiple Linux installs as well.
    To switch to
    ChromeOS from Linux - press ctrl+alt+back.
    To switch to Linux from
    ChromeOS -press ctrl+alt+forward. On x86 systems, you also need to press alt+forward again.


Next - get rid of the damn developer mode warning. Undoing all this work just takes an easy keypress in the boot sequence, so let's get rid of that option.

Start by opening up the Chromebook.


The insides look pretty sparse. The only device that can be removed is the wireless module. To the upper right of that module is a screw with what looks like solder contact points all around.



Unscrew it, and put back on the bottom (don't screw it on).

Boot up the Chromebook and open a shell prompt.
run the following:
sudo /usr/share/vboot/bin/set_gbb_flags.sh 0x1  (shorten the bios delay)
sudo /usr/share/vboot/bin/set_gbb_flags.sh 0x8  (force developer mode on)

Or - just use 0x9 for both at once.

That will make it much safer against booting chromebook and accidentally wiping it.

Put back the write protect screw, and screw on the bottom - you're done. Booting now just takes a couple seconds at the BIOS screen.


The Linux/Ubuntu experience is quite good. I've often had problems with drivers on other laptops where Ubuntu was the host OS, but absolutely no problems here. Ubuntu is running with the existing OS sharing the compiled modules and drivers of the ChromeOS host.

The most impressive aspect of this as a linux laptop is the backup and restore functionality.

Backup:
If you did not specify a specific location to install, then backup is just:
sudo edit-chroot -b trusty
Where "trusty" is the chroot default name.
I installed on a USB drive, so the below command specifies the chroot location.
sudo edit-chroot -c /media/removable/OS_DRIVE/trustychroot/chroots -b trusty

Restore:
A basic restore is simply 
sudo edit-chroot -r chrootname
If you haven't specified a location but your laptop is new, or powerwashed, crouton can install directly from the zip file generated:
sudo sh ~/Downloads/crouton -f mybackup.tar.gz
If you did like me and installed to a specific location:
sudo sh ~/Downloads/crouton -p /media/removable/OS_DRIVE/trustychroot/ -f mybackup.tar.gz 

This can be done in the background while using ChromeOS to get work done. It's by far my favorite aspect of using a chromebook to host Linux.

TIP:
Consider putting shell scripts in /usr/local/bin/ to speed up entering Linux, backup/restore scripts etc.
Bottom line:



The Acer CB3-111 Chromebook is light, small, feels well put together and has decent battery life. ChromeOS starts in seconds from off, and standby is done by simply closing the lid. The OS can repair itself of modification easily, has functions for making recovery usb drive, and as of today has enough offline applications for most people. It's unlikely to have virus problems as well. That makes it really good for a casual user.


With Crouton The CB3 Chromebook becomes a rather nice Linux laptop - albeit one with mediocre storage options. The best alternative to using the internal EMMC storage (which can't be upgraded) is using a tiny USB drive (mine is a 64GB PQI [U603V]). Though these drives are USB 3.0 with fast 120MBps+ read speeds but the write speeds are quite slow - perhaps 10-12MBps sustained, so some pauses in multitasking can occur. No ultra tiny USB 3.0 drive currently does any better yet.

Getting into Linux is fast - just open chrome, press ctrl+alt+T for a shell tab, and run your one line command to start - put it in a shell script to automate your life :)


The price and features are an incredible combination, even without Crouton. I'd love a 32GB version where I can use the internal space instead of a slower USB drive, but maybe in the future.

Verdict: A nice laptop for $150. A little elbow grease really makes it shine.

No comments:

Post a Comment