Development on a Chromebook: an opinionated guide

April 20 2013, last updated January 6 2017

I started using a
Samsung 550 Chromebook
as my on-the-go machine two semesters ago. It worked nicely for
taking notes, but I remained a skeptic: how could I ever write code
from a glorified web browser?

Fast forward 6 months: today, I love hacking on my Chromebook, and
I have no problems working offline. It took some effort to get
everything set up, so I’ve put together my recommendations to get
other folks up to speed.

First, a disclaimer: the device was given to me as part of the
Google Student Ambassador Program,
and Google pays me for brand advocacy at my school. That said, I’m
not getting paid to write this, and this is my advice, not
Google’s. I’m a hacker, not a shill (and I’ll even save hn the work
of linking
pg’s submarine essay).

Anyway: let’s get started. It’s easiest to work over ssh, so I’ll
cover this first. Later, I’ll get to working offline. I won’t talk
about cloud development webapps (maybe check out Nitrous.IO?).
Also, I don’t have any advice if you prefer heavy IDEs; my usual
tools are a terminal and web browser.

The chromium-hterm mailing list is where
updates are posted. If you need an upcoming feature now, there’s
also a hidden dev channel (you need to be
logged into an account that’s on the mailing list for this link to
work).

A quick tip: set Secure Shell to ‘Open as Window’, otherwise Chrome
will intercept keyboard shortcuts (which e.g. makes Control-W close
your terminal). You’ll probably also want to set TERM to xterm. The
FAQ (linked below) has the details and is worth reading through:

remote desktop

If you need a graphical environment, you can use
Chrome Remote Desktop.
This provides vnc-like functionality across Windows, Mac and Linux,
and can be set up for repeated or one-off access. Note that you
cannot currently remote into a Chromebook.

I rarely need this.

Crosh Window

Crosh, the built-in CrOS shell, can (and should) usually be
avoided. If you find yourself using it,
Crosh Window
takes away some of the pain; it fixes the Control-W problem
mentioned earlier and gets you an up-to-date version of hterm.

For when you’re offline or on a terrible connection

GalliumOS

edit: GalliumOS is a linux distribution that’s designed for Chromebooks.
For example, it supported my Pixel’s keyboard layout and touchscreen out of the box.
If you’re comfortable maintaining your own linux install - or regularly work with VMs - I’d suggest it over crouton.

crouton

For offline work, you’ll want root access to a local Linux install.
crouton is by far the
best way to go about this: it runs Ubuntu in a chroot. This has
security implications (check the README), but you avoid the
performance hit of virtualization, and keep all the CrOS
functionality.

You’ll need to have your Chromebook in developer mode (i.e. rooted)
to use it, which is easy: I just flipped a hardware switch.
The specifics for going about this vary by model, so just
search for instructions. Once in dev mode, you’ll want to hit
Control-D on each boot to skip the “you’re in developer mode”
warning (there’s a 30-second wait otherwise). Have faith: this
isn’t nearly as annoying as it sounds.

The crouton README has all the information you need to get started.
Note that you can run a normal graphical environment (e.g. Xfce)
alongside CrOS. I prefer using Secure Shell to ssh into localhost
so I can keep my terminal customizations and stay in CrOS. If this
sounds appealing, here’s what I did:

used the crouton cli-extra target (eg
crouton -t cli-extra ...).

installed openssh in my chroot

start sshd, then use Secure Shell to connect to
my-user@localhost

To make life a bit easier, I stuck /etc/init.d/ssh start into my
chroot’s /etc/rc.local (which crouton runs upon mounting). Now,
when I want to work locally, I just Control-Alt-Forward to get my
local shell, $ sudo enter-chroot, Control-Alt-Back to CrOS and
then run Secure Shell. You could probably get your chroot to mount
and run sshd on boot if you use it all the time.

mosh

As an alternative to ssh on flaky connections, you can use mosh.
It’ll need to be installed on your server to use it.