Coding on a Chromebook: I’m all in with Crostini and the Pixel Slate

One of the most read posts on About Chromebooks is from last April when I detailed how I was coding with my Pixelbook. Technically, I wasn’t coding on the Pixelbook, because my solution was to remotely access a Raspberry Pi that had Python installed on my local network. Thanks to the addition of Linux containers through Project Crostini in Chrome OS, I don’t have to rely on — or be limited to — another computing device for my coding.

Note that my “coding” needs are rather meager: I’m not a full-time developer but I am enrolled in a Computer Science certificate program at my local community college. Depending on your coding needs, a Chromebook may or not work for you. And there are other options out there to make this work; I stayed away from the main one called Crouton for these reasons I specified last year:

I should note that there are several ways to do this. I wanted a method that didn’t require using Developer Mode and Crouton scripts — which does slightly water down Chrome OS security — nor the cloud since most of those solutions can add up as you might pay for processing time. So for me the best option was something more localized, didn’t require any Chrome OS modifications and would have a set, low cost.

Last semester, I relied on a Microsoft Surface Pro for class; this semester, I’m all in on the Pixel Slate, thanks to Crostini, which runs the Debian distro of Linux in a secure container. It’s seamless and appears native, alongside the Chrome browser and Android apps on my Pixel Slate, as shown above.

Since Crostini supports a full Linux command line environment and GUI apps, using my Pixel Slate for development is not very different from using a traditional PC with Linux installed. For example, to install IntelliJ IDEA or Sublime Text, I use the same Linux installation instructions as any other Linux user.

Coding and running Java in IntelliJ IDEA
Editing code in the Sublime Text editor

In our first class, we also used a student-friendly IDE called jGRASP, which is an open source program. It has some of the best debugging tools, so I’ve also installed it on my Pixel Slate. Here I’m using the debugging tool to step through my code and can see the characters in an external text file I’ve read in:

Python is already installed by default, so there’s nothing do to there. For Java, I also need the JDK, or Java Developers Kit, which is available from Oracle, although there’s an open source version called OpenJDK also available. Essentially, if there’s a Linux tool available, you should be able to install it on your Crostini-supported Chrome OS device, and that includes Git if you need version control.

This isn’t quite a perfect solution, however, since there are some features and functions not yet available in Crostini. If you’re developing an app that relies heavily on graphics rendering, GPU acceleration isn’t in Crostini. However, it’s likely coming soon based on recent developments by the Chromium team. There’s no audio support in the Linux container yet, and if you need to read or write files to a connected device, say over USB, that’s still in the works too.

And there are instances where an installed Linux package doesn’t create a shortcut in the Chrome OS launcher; for those, I simply open up the Terminal app and start the package from a command line.

Starting jGRASP from the command line

Typically, if you can download a Debian package from the web in Chrome OS, you can install it from the native Files app and that generally gets you the shortcut.

One other nice feature that’s built into Chrome OS and Crostini is the ability to share files and folders between the two platforms. When I need to download a Linux package, for example, I can simply do that in Chrome OS; I have my Downloads folder mounted as a share in Linux so there’s no need to move files around. And the Dev Channel of Chrome OS 73 provides access to Google Drive as a Linux mount as well, which is a handy way to read and write files in the cloud.

Again, there are multiple ways to create code on a Chromebook and there’s no “best” way since we all have different requirements. However, I get the “how do I code on a Chromebook” question on nearly a week basis through email and social networks, so it made sense to create “version 2” of my approach.

4 thoughts on “Coding on a Chromebook: I’m all in with Crostini and the Pixel Slate

  • January 23, 2019 at 7:54 am

    I fairly happy with my pixelbook, however I’m disappointed that I cannot use serial ports to work on CircuitPython.

  • January 25, 2019 at 8:47 am

    Another good option, at least for Python, is Pydroid 3 in the Google Play store. It works great and supports tkinter, Kivy and other UI frameworks.

    • January 25, 2019 at 11:10 am

      I neglected to mention only because I’m not using it on a daily basis, but yup, it works, as does Eclipse and Android Studio. I’d guess that your IDE of choice should work. 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.