Copyright Brian Starkey 2012-2014
Valid HTML 4.01 Transitional

Valid CSS!
iconARM Chromebook + Raspberry Pi = Ultrabook?max, min, close
February 2013
Overview(top)

Back in October (2012) I bought myself the new Samsung (ARM) Chromebook as a replacement for my ageing and more or less useless Eee 1000H. The laptop is great (if I can be permitted to call it a laptop), however there are of course several drawbacks to using a machine which is essentially a glorified web-browser. The first thing I did was put the Chromebook in developer-mode to see just how limited the console is. Spoiler Alert: It's limited. There's meant to be the possibility to install additional software through "emerge" though I never managed to get it to work, plus I'd rather not modify the rootfs and keep the Chrome OS install as clean as possible.

Using the great instructions that Olof Johansson posted, I was able to get a Linaro release booting from a USB stick in less than an hour, but the proprietary armsoc graphics driver (and its awkward library requirements) meant that I wasn't really satisfied with the "Other OS" performance. Also, Chrome OS's stupidly fast boot and complete optimisation makes it an obvious choice for the main operating system, so it stays.

Chrome Web Store has many "Apps" which are capable of all sorts of tasks, however most are just web-pages, requiring an internet connection to work. The most annoying thing I found is a complete dearth of a decent text-editor. Google Docs will run offline, but refuses to open anything as plain-text. If you try to open .txt, .py, .c, whatever, you get a pop-up telling you to look in the Chrome store for a suitable application to open the file. I also wanted a Python interpreter, as I use it all the time as a calculator, coding scratchpad and more or less everything else short of making my food.


A (partial) Solution(top)
ARM Battery Life WIN!ARM Battery Life WIN!

As I mentioned, the built-in shell is pretty limited, but it does have SSH and vim. I had never bothered to learn vim, preferring nano for quick config-file changes, but after spending Christmas Eve running through vimtutor, I was convinced that vim was definitely the way to go for all my editor needs. Problem 1: Decent editor, Solved.

For the other problem of applications available, I stumbled across this article about living (and working) in the cloud from an iPad, using it more or less as a dumb terminal for a Linode. This had potential! Plus the added bonus that the Chromebook runs an X-server, making X-forwarding of proper desktop applications a real possibility. I can't afford a Linode, so I've replaced it with a Raspberry-Pi, as a low-power always-on portal to my home network.

When I need to work on something, I SSH to the Raspberry Pi, using a screen session if necessary. If I want something with a bit more grunt, I use Wake on LAN to bring my desktop out of suspend (from the Pi) and SSH tunnel through the Pi to it. Incase someone wants to do something similar, I've detailed the steps below.

As ever, there are limitations. The setup requires that I have an internet connection. I guess that's par for the course for a Chromebook, but I think the trade-off is worth it. I have a MiFi 3G modem if necessary, but most of the time there's a Wifi network available. Also, X-forwarding is slow at the best of times. Over the internet, it can be painfully slow, but I've found it usable most of the time. The advantages of using the Chromebook however are great - the battery lasts forever as far as I can tell, it weighs nothing and it boots from cold in less than 10 seconds (less than 2 from suspend).


Setting up the Pi(top)
Have a nice day :)Have a nice day :)

I'm exposing the Raspberry Pi to the big-bad internet, so there's a few precautions you want to take. I am not even close to a security expert, in fact I might not even make novice. From some reading on the internet (here seemed like a good start) I've done what I can.

Next you want to configure your router to actually allow connections to the Pi. I gave it a static IP and forwarded port 22 (SSH) to it. Your router will vary, but you should be able to configure port forwarding.

Finally, you need to know your WAN IP so you can actually connect. My ISP don't offer a static IP, it doesn't change often, but you can't guarantee it won't change. There are dynamic DNS services, but I didn't really want to use one, so I wrote a script to email me whenever the IP changes, which runs every day on a CRON job:

            #!/bin/sh
            WAN=`wget -qO - http://ipecho.net/plain` 
            OLDWAN=`cat ~/.util/wanip`
            if [ "$WAN" != "$OLDWAN" ]
            then
            ~/.util/emailme "My IP is now $WAN" "Have a nice day :)"
                echo $WAN > ~/.util/wanip
            fi
            
The actual emailing is done by sendEmail:
            #!/bin/sh
            sendEmail -f raspberrypi@home -s smtp.gmail.com:587 -xu username -xp password -t me@myself.com -o tls=yes -u $1 -m $2
            
This means the IP address is always in my gmail inbox, and it changes infrequently enough for me not to mind updating my ssh_config when it does.


Setting up the Desktop(top)

I always suspend my desktop when I go out, but the network interface supports Wake on LAN from any state. You just have to enable it in the BIOS and OS, and I had to hack the network driver's suspend script to keep it powered during S3 suspend.

Now I can send the magic packet from the Pi, the desktop will come out of suspend, and I can open a new SSH connection tunnelled through the Pi:

            ssh -YX -ttt user@raspberrypi "ssh -YX desktop"
            


Using the System(top)
Running Applications in MetacityRunning Applications in Metacity

Although Chrome OS runs an X-server, there is no window manager. This makes X-forwarding buggy to the point of being unusable. The solution is to run a window manager on the remote machine.

This puts Chrome's "Aura" interface into a window, and any other programs you run will open a new one. The mouse only works within the confines of the Aura window, so be careful not to get yourself into a mess by moving the Aura window.

Other issues are buggy graphics in the browser (flickering screen) and delayed update of local windows (seems to only happen on mouse move). The latter means that it's best to open up a terminal on the remote machine, which updates on every keypress. I've also not found a way to shut down the WM cleanly, but this really isn't an issue when a clean reboot takes 10 seconds tops.


Wrap Up(top)

All in all, the system suits me just fine. I can carry just the Chromebook with me, but still get things done if I want to. OK I'm dependant on an internet connection, but I'm also completely independant of the machine I'm working on. I can just as easily SSH in from any old computer and re-attach my screen sessions. Down the line I'll probably get a Linodex, I actually like living in the cloud a lot!