Coding on a Chromebook: A How-To Guide, Part 1

How to set up a professional-level developer environment on a $175 Chromebook…no, seriously!

As regular readers know, I graduated from the intensive computer programming school DevBootcamp last summer, and in general have been just fine with both the education I got and how the nine months or so since graduating has gone (except for, you know, still not having a job), although with one big exception; I actually bought my current computer setup years before deciding to make the career change into coding, so is not really set up in a way that’s conducive to the usual type of coding career. Namely, I have a big fancy Mac desktop as my main machine, one that’s way too big and heavy to easily transport anywhere else, then have a cheap Acer running Windows 10 as my laptop for on the go, one that’s almost ten years old at this point, big and bulky and slow, with not enough contemporary guts to do anything meaningful in our modern world of video streaming and Minecraft. And that’s a problem as a coder, even a coder that’s currently looking for a job, because a big part of the job of being a coder is being able to do it on the go — to troubleshoot with a co-worker at a cafe, attend code nights and hackathons, share your code with employers at their offices during job interviews, follow along when attending lectures and tutorials, or simply to look like you know what you’re doing while you’re out and spending time with others.

While technically you can code in Windows, it’s not exactly the easiest thing to do even for an expert, much less a beginner like me who seemingly needs help with every third action I perform in Git or the terminal or at Heroku, and I haven’t been able to hit up my usual go-to friends I made at DevBootcamp with such stuff, because they’re all on Macs and don’t know how to troubleshoot in a Windows environment. And the absolute cheapest Mac laptop on the market is a thousand bucks, the kind of money I expressly went to DevBootcamp in order to try to make, which means I’m a long way off from affording one of those; so for all these months since I graduated DBC, I’ve been without a coding laptop at all, and it’s had a real and concrete effect on my ability to make professional peers and do well in interviews, as I’m sure anyone else knows who has entered into a new coding career under the same circumstances. But recently I came across an online article about a guy who does all his coding on a Chromebook, laptops designed to run the rapidly rising operating system put out by Google that essentially has you run all your apps through a browser and an internet connection, instead of installing them locally on your hard drive; and this made a lot of sense as soon as I read it, because Chrome OS is essentially nothing more than a specialized version of the open-source Linux operating system, which means that the boxes that run Chrome OS can easily have other Linux builds installed on them too, and you can do as much coding as you want once you have a full Linux system like Ubuntu installed, because Linux is where all the super-serious coders of the world hang out and where many of the most famous coding tools available were first invented, before eventually being converted into Mac and Windows versions down the road.

That’s a huge deal, because Chromebooks are ridiculously cheap compared to their competitors; I myself, for example, bought a brand-new ASUS C300 for just $175, which has an Intel Celeron processor, a 13-inch screen, and 2 gigs of RAM, more than enough for the basic things I want to do on it like type text documents, watch streaming video on Netflix, etc. Of course, the key to a system like this is that I have a big powerful computer back home for doing all my heavy-duty stuff like Photoshop, InDesign, video editing, saving all my old photos from over the years, etc.; with only 16 gigs of internal memory, along with an inability to install standalone software, this makes the Chromebook only good in the way that Google has expressly always meant for it to be used, as a perfectly fine portal into the internet, where you use exclusively web apps (from companies where I’m precisely trying to get hired right now), and save all your files to a cloud destination like Google Drive or Dropbox, where you can then retrieve them again on a more powerful computer at a later time (at work, at home, etc) to do more complicated things to them. Or of course you can save files on a removable device too; my ASUS, for example, comes with an SD card slot built right into the side, the same kind of card my Mac uses which is nice and convenient.

But surprisingly, these limitations come with some benefits too; for example, since so little internal memory needs to be provided, most Chromebooks use a solid-state drive (or SSD) instead of a hard drive, and so have no moving parts, generate little heat, break down profoundly less often, and is what allowed that computer to sell for $175 brand-new to begin with. And for coding, such an environment works just fine; in fact, that’s part of the point of coding, that the finished app itself lives on a central server somewhere far away from you, and it’s you and dozens (sometimes hundreds) of others who are remotely sending in tiny changes to that code, through a piece of software like Git that automatically juggles those hundreds of tiny changes and presents a unified version containing them all at its central location. The challenge of coding on a laptop isn’t in its power or memory; it’s simply in whether the command line interface (or “shell”) is easy or difficult to use, whether it has a well-done package manager that lets you easily install things like new languages and plug-ins directly through a terminal window, and whether it’s going to give you enough unfettered access to its guts as a “superuser” (a self-declared expert who subsequently is given the power to accidentally destroy their computer, which is why many operating systems make it so difficult to declare yourself one, and is why people are always telling you to be VERY, VERY CAREFUL when typing any command in a terminal window that starts with “sudo”). And it turns out that Chrome OS has actually been making some great strides in this in the five or so years it’s now been around, including an easy way to run the entire system itself in a special “developer mode,” and thus gain access to Chrome’s very own terminal app and bash shell, and declare superuser commands yourself.

Now, typically what you would do to install another Linux system in this case would be to “partition” off part of your hard drive — essentially separate that section from the other so that they work like two mini-hard drives — then install the other Linux system there, now able to boot into one or the other each time you start up the laptop again. But, since Chrome OS is already a Linux system on its own, you can actually do something much easier here and simply create a “chroot,” short for “change root,” which is essentially just a special little directory within your first Linux system that prevents applications within that directory from opening anything outside that directory. It’s essentially like creating a little jail within your OS, where nothing that happens in there can reach outside and affect anything else; so you can effectively install an entire other operating system in there, just like the open-source app Crouton does, plunking the entire Ubuntu OS into that little pocket of preserved space. And since this is essentially just a folder within your normal Chrome OS, that means that both stay open at the same time, and you simply use the keyboard shortcuts Ctrl+Alt+Back and Ctrl+Alt+Forward to flip back and forth between them. And since both OSes share the same “Downloads” folder, that’s a central place where you can leave files and have them accessible from both systems. And now that you have Ubuntu running, you can install and run anything you would have on an Ubuntu-only system — coding tools, Minecraft, Snowden recommendations like Tor and SecureDrop — while still having all the user-friendly benefits of Chrome, a new-way-of-thinking disguised as an OS that I’m rapidly starting to get into as I use this new Chromebook more and more.

Now, granted, you do have to run your laptop in developer mode all the time, which means a special keyboard press at each startup to remind it that you’re doing so; and it’s pretty easy to wipe out that special little directory where your entire second OS is residing, so you’ll want to make sure not to set up TOO big or tricked-out an Ubuntu system. But this unto itself can be seen as a virtue as well if you want to; a complete wiping-out of that entire Ubuntu system can be done simply by holding the space bar when the computer boots up instead of Ctrl+D, making it easy to get rid of quickly, try again, improve or play around with, etc. For example, even though Ubuntu is just one of a dozen builds of Linux on the market, even that is just the operating system itself; there are also a dozen competing builds for a graphical front-end to Ubuntu, and passionate arguments online for each over the other. I’m starting with the large-memory but intuitive Unity desktop, which is actually the current standard desktop that ships by default with all Ubuntu installs; but after a few months, I might find that I’ll want to switch over to the smaller but less intuitive XFCE, and I think it’s great that that would only be a 15-minute process using chroot, plus another few hours to reinstall all the Linux apps I had been using.

It’s a pretty well-documented process; here are five online guides, for example, that each essentially say the same thing, only with different writing styles and levels of visual aids. This is the process I used to install Ubuntu on my own ASUS Chromebook, and it worked just fine…

Dave Bennett
Android Authority
A New Domain

And here’s a link directly to the Crouton open-source project, which needs the same kind of fresh blood in developers and testers as any open-source project does. (Just graduated and wondering what best to do with your time? Nothing impresses employers faster than diving head-first into helping to improve various open-source projects.) I have to say, I am grateful for learning of this new cheap way to be able to participate in things like coder social meetups, hackathons, cafe nights, etc., and I hope this will inspire a bunch of you out there who are in my boat, unable to afford the ridiculous pricetags of Mac laptops but who need something better and easier than Windows Powershell for coding. In my next writeup, I’ll be leading you through the second half of this process, of installing everything you need to set up your integrated developer environment (or IDE) within your Ubuntu install. (UPDATE: Part 2 now online; visit it through the link below or by clicking here.)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.