Setting Up A Chromebook Development LaptopBy @zachfeldman
Ruby and Windows have some trouble getting along, especially with novice developers at the helm. In the classes that I teach at NYCDA, we’ve had many problems in the past with students who choose to use Windows as a development environment for our Ruby/Rails based classes. Typically, things are fine until they have trouble compiling certain gems and libraries later on in the class. There’s also the small differences between the Windows and Unix command line to contend with that make it harder to follow along with the rest of the class.
In an effort to solve this problem with an alternative, I first created a few USB drives with bootable customized builds of Ubuntu. They each included Sublime Text 2, Google Chrome, and the stock Unity/GNOME Terminal locked to the launcher along with a flashy NYCDA background.
This was a pretty fun excercise for me, but this semester we had 2 students who had issues with the LiveUSB version of Ubuntu (although it worked fine for one of our other Windows students). Considering I tested it on an old Windows 7 beater I purchased from a pawnshop, I wasn’t too surprised!
Enter the $200 Chromebook
I’m not one to force my students to go out and drop $1000+ on a laptop from Apple just to solve the issue, so I wanted to find a more affordable solution. Enter the Acer C7 Google Chromebook. I read that there was an easy way to dual-boot Ubuntu on this tiny $200 laptop and now was the time to learn.
My first attempt involved using Chrbuntu. It didn’t seem to work though, so I moved on to using Crouton instead. One caveat is that since I had tried using Chrbuntu, it partioned a huge 9GB partition of by 16GB drive (see Github issue I had to file here to understand my stupid move). I had to do a hard reset of the Chromebook in order to recover the original partition scheme.
I <3 Crouton
Crouton is amazing for many reasons, including that it’s not technically a dual boot, but rather runs in a container on your existing system, giving you the ability to easily switch between ChromeOS and Ubuntu. It uses what’s called a chroot, which “provides the guest OS with [its] own, segregated file system to run in” according to the Crouton README.md file.
After downloading Crouton from ChromeOS, I opened up a new
crosh terminal with
Control+Alt+T then typed
shell to get to a shell prompt. If you’re in developer mode on a Chromebook, you can also get to a full on shell with
Control + Alt + F2, but the author of Crouton advises you to use the Crosh shell. I proceeded to change directory to my downloads folder, where Crouton now resided. I ran it with the option to install the Unity desktop:
sudo sh -e crouton -t unity
The script will take 20-30 minutes to run and install everything you need for your very own easily switched on version of Ubuntu! The only thing you have to do is follow the prompts, with the only one I saw instructing me to enter a root user partition name, a user name, and password. Once everything is setup, and assuming you didn’t have any errors, you can enter your system from the
crosh shell using:
Bingo! After a second or two, I booted into a wonderful clean install of Ubuntu with the Unity/GNOME window manager. Now it was time to make this Chromebook into a true Devbook!
Installing Development Tools and Ruby in Ubuntu
I opened up xterm and installed Ubuntu Software Center to easily get GNOME Terminal and Chromium up and running:
sudo apt-get install software-center
After installing GNOME Terminal and Chromium with the newly minted software center, I hit up the RVM website to install RVM and the latest version of Ruby. I had to set the “Run command as a login shell” option in GNOME Terminal to use RVM properly, which was located in the Edit -> Profile Preferences -> Title and Command menu of GNOME Terminal. Once that was set, I was able to set the Ruby version using the trusty:
rvm use 2.0.0-p247
Next up on my shopping list was my favorite text editor (and the one I’m writing this blog post from), Sublime Text 2. For that task, I referred to this handy article.
Finally, it was time to install my old friend, Git:
sudo apt-get install git
At this point, I’ve got a $200 laptop setup with Chromium, GNOME Terminal, Sublime Text 2, and the latest version of Ruby! I learned that to switch between this sick new Ubuntu setup and ChromeOS, I’d just need to press
The Final Build
Overall, the laptop seems to have served its purpose. One of my students tried it out for a 3 hour lesson last night and said that it was a joy, the only issue being that the trackpad wasn’t really super responsive. I’d also imagine that as the complexity of the Ruby programs it runs increases, the slow-ish RAM and processor would make everything take a speed hit. Most of all, I was just glad that we have a backup in case students have a Windows machine and don’t want to drop a ton of dough on a Mac.
Sign up for our e-mail list to hear about new posts.