By Tom Preston-Werner
At Codestarter, we’re on a mission to put a developer-friendly laptop into the hands of every kid that wants to learn how to code. Since we rely on donations to make this happen, the less expensive the laptop, the more of them we can deliver.
With this in mind, I set out to find a laptop that was both low cost AND high quality. My goal was to find a computer that I wouldn’t mind using as my own primary development machine. That meant it had to have an excellent keyboard, good trackpad, solid build quality, fast processor, at least 2GB of RAM, and a nice screen.
After a bit of online research, an unlikely contender emerged: Chromebooks. At first glance these machines didn’t seem suitable, as they run ChromeOS, a browser-based operating system. They also tend to have very little storage space, on the order of 16GB. But they’re cheap. VERY cheap. $199 cheap. That’s enough to warrant a second look. Kids don’t really need a ton of hard drive space, and the specs on some of the machines looked pretty good. What if you could install Linux on these machines? That would leave a few gigs of space free and solve any problems that ChromeOS presented…
A few hours later I was at Best Buy, staring down at a $199 Acer C720 Chromebook (the least expensive model available). It’s a small laptop, only 2.75 pounds, lighter even than my 13” Macbook Air. Picking it up, I expected to find a flimsy, plastic thing, but it felt quite solid in hand, even holding up nicely to a bit of torsion exerted upon the base. The keyboard is eerily similar to an Apple keyboard, so the keys felt quite familiar. The trackpad, while small, is unexpectedly smooth to the touch, and the integrated button is also reminiscent of a Macbook’s. The 11.6” (1366x768 pixel) display is sharp and bright. The familiar HDMI, USB 2.0, USB 3.0, and SD card slots are all present. It even has a built-in camera. With an Intel Celeron 2955U 1.4 GHz processor and 2GB RAM, I was given no reason to think it would be sluggish for common programming tasks.
Here was a $199 laptop that, for its build quality and feature set, could easily have cost twice that. Previous research had shown that others had successfully installed Ubuntu on the C720, and so we embarked on a journey to discover whether we could turn a Chromebook into the perfect learning machine for a kid coder. After perhaps a hundred re-installs of Linux, countless hours reading Stack Overflow posts, and a roller coaster of triumph and failure, I’m proud to say that we’ve landed on an Ubuntu installation script that meets our needs and makes it trivial for us (or you!) to create a Codestarter laptop.
Here are the requirements and what we did to make them possible:
It must run Ubuntu.
Chromebooks fresh from the factory are heavily locked down for enhanced security. But the ChromeOS team members are hackers at heart and have been thoughtful enough to provide a “developer mode” that allows adventurous developers to replace ChromeOS or set up a dual-boot system by enabling “legacy boot” which gives you access to a Coreboot/SeaBIOS setup.
Quite conveniently, ChromeOS is a variant of Linux. When put into developer mode, you gain access to a terminal and a variety of low-level command line tools. With root privileges, you can now partition the SSD to make room for an Ubuntu installation, enable legacy boot and even run a different Linux distribution using `chroot`. This is exactly how we install Ubuntu, and you can find the entire automated process in our open source Ubuntu Chromebook Installer script:
The installer is a fork of eyecreate/ubuntu-chromebook-installer with a bevy of improvements and customizations that transform standard Chromebooks into our Linux-based learning machines right out of the box.
If you’re a savvy developer looking for an inexpensive laptop to travel with, or you know a code-curious youngling in need of their own computer, feel free to use our installer to mint your very own Codestarter laptop.
It must have Google Chrome as the default browser.
Google Chrome is a great browser, and if we’re going with Chromebooks, then it makes sense to keep a consistent browsing experience across operating systems. Chrome also ships with Adobe Flash pre-installed and stays up-to-date as Chrome’s auto-updater runs. Flash support is required for many kid-friendly online coding tools (Like MIT’s Scratch). Google provides Chrome for Linux as a .deb, which can be installed with dpkg.
It must enable kids to learn to program even if they don’t have access to the internet at home.
One of the most popular “languages” for beginners is MIT’s Scratch. The latest version (2.0) is only available online, but an older version (1.4) can be installed on Linux and used offline.
We ship our Codestarter laptops with that version, which produces program files that are still compatible with the online version.
It must have a great, local code editor.
Coders spend a lot of time in their code editor, and as kids get into web technologies and text-based programming languages, they’ll need something that’s easy to use. We install Geany, a simple but powerful open source editor.
For completeness, we also install Vim and Emacs. If we get enough donations from proponents of one side or the other, we’ll remove the losing editor from our laptops. Just kidding! Maybe.
It must be as easy as possible to try out a large variety of programming languages.
A lot of time is wasted at learn-to-code programs just getting a development environment set up. An hour can easily go by as kids try to get Ruby or Python installed. We decided to pre-install Python, Ruby, Node.js (plus npm), and Java. Both Python 2.7 and 3.0 are available, and while we only ship with the latest 2.x Ruby, new versions can easily be installed with `ruby-install` and selected with `chruby`. If another language is needed, the Ubuntu package manager makes hundreds of others available with a few simple commands.
It must support Minecraft.
Kids LOVE Minecraft. Sure, it’s a game, but Minecraft encourages an engineering mindset where kids use their computer to build whatever they can dream.
And, yes, the Acer C720 can run Minecraft smoothly with just slightly reduced quality settings!
Commonly used programs should be prominently featured.
By default, Ubuntu’s launch bar (on the left-hand side of the screen) is filled with applications of little utility to a young developer. Luckily, it can be customized by through the use of dconf overrides. For our Codestarter laptops, we feature Chrome, Geany, Terminal, Minecraft, and the Software Center.
"Function" keys must work as advertised.
Chromebook keyboards are optimized for ChromeOS, and the F-keys are labeled with commands such as back, forward, reload, full screen, brightness, and volume. These keys should do something appropriate in an Ubuntu environment. With a combination of xbindkeys, xdotool, xbacklight, and pactl, all of the F-keys can be mapped to reasonable actions in Ubuntu.
While the above setup gives us a compelling developer machine at an incredibly low price, not everything is quite perfect yet. Both Linux and ChromeOS have some limitations that we’ve had to work around for the time being. In the future, we hope to smooth out these bumps to create a seamless user experience for young developers.
Booting to Ubuntu by default and disabling "SPACE-to-wipe-Linux" require removing the bottom cover of the laptop.
When placed into developer mode, Chromebooks display a scary warning screen when powered on. Here's what it looks like on the Acer C720:
On this screen, you can hit CTRL-D to boot into ChromeOS or CTRL-L to boot into Ubuntu. Sadly, the screen doesn't tell you any of this. In fact, if you follow the advice it gives (to press SPACE to re-enable OS verification), it will disable developer mode and wipe out the Ubuntu installation!
To prevent this from happening, it is possible to flash the BIOS with new settings that do the following:
- Boot to legacy partition by default (Ubuntu).
- Only show the Developer Mode screen for one second.
- Prevent SPACE on Developer Mode screen from doing anything.
Unfortunately, this requires unscrewing the bottom of the laptop, removing a BIOS write-protection screw, running a script to flash the BIOS, and then replace the bottom cover. Which is not the end of the world, but it's time consuming and voids the warranty by cutting through a sticker that covers one of the screw holes.
Despite the downsides, we now do this to every Codestrater laptop that we ship, since it so drastically improves the user experience. If you want to do the same, you can follow these instructions:
Help us make an even better code-learning laptop.
If you have ideas about how to improve our Codestarter laptops, I’d love to hear them. Email me directly at email@example.com. I’d especially love to hear from you if you work on the Linux kernel and can help get the Chromebook module patches merged into upstream, or if you work on the ChromeOS team and can help find a way to present a custom boot screen on startup.
A kid with their very own laptop is a kid with opportunity, and a chance to drastically alter the course of their life. For only $250 we can get a Codestarter laptop into the hands of a child that’s already expressed interest in programming by attending a learn-to-code program like CoderDojo. If you’d enjoy helping to give this opportunity to a great kid, head on over to https://codestarter.org and donate right now. We, and the recipient of the laptop, will be forever grateful. Thank you.
Edit 2014-08-21 - We’re now installing the open source Geany editor instead of Sublime Text. After using it for a little while, Geany has turned out to be an excellent beginners editor and ships with a comprehensive set of syntax highlighters. It should be perfect for beginners and eliminates the concerns that have been expressed about including payware on our Codestarter laptops. Thanks for the feedback, everyone!
Edit 2014-09-15 - All Codestarter laptops now boot to Ubuntu by default, only show the Developer Mode screen for one second, and prevent SPACE on that screen from causing any damage. To do this we flash the BIOS using the process documented in the main article.
Edit 2015-01-08 - We are now installing the 3.17.6 Linux kernel which includes the necessary drivers to support the Acer C720’s trackpad and other hardware. This means we can stop pinning the kernel!