Linux on ChromeOS (Crostini) is now usable for developers

I tried ChromeOS again and it’s awesome!

I have been using a cheap Chromebook for travelling for a while now. The “Linux on ChromeOS” feature, also called Crostini, was a big step forward for me to use this device for some small development work. I started using it while it was still in the development/beta channel for my device. It already was really useful, but quite unstable. It got better with every update and I got my basic development setup working with some hacks I previously blogged about.

It turns out I missed all the awesome updates and fixes to ChromeOS because I did not really need a laptop for some time now. Recently I worked a bit again on my Chromebook and found many new features that make it a good development device.

What is Linux on ChromeOS?

If you are new to ChromeOS or Linux on ChromeOS this is just a short description. You should find plenty good information about this on the internet.

ChromeOS is built on top of a Linux system but we as a user normally don’t have access to that Linux system. The main selling point to me is that it is a secure and isolated system that you cannot really break like a normal Linux desktop distribution. system. Because of this a Chromebook is easy to set up, wipe, backup and update. This makes it a good travel device for me.

As a developer I want to install software, run Linux tools and more. I cannot normally do that with ChromeOS without developer mode and some drawbacks. When Google added the “Linux on ChromeOS” feature I tried to use the device as a light workstation. Linux on ChromeOS is basically a virtual machine that runs one ore more Linux containers we can almost use like “normal Linux systems”. They are isolated from ChromeOS and can be used without the developer mode that was required previously.

This Linux system works quite well for me. I can run Nodejs, Go, VSCode, even Firefox and they fit nicely into the ChromeOS system. Sometimes you need to take special care because of the way Google designed this but it turned out very good with the recent updates. Let’s get into this.

The annoying boot issues

When I started using this feature one thing drove me crazy. You clicked on the “Terminal” app in ChromeOS and it just showed a little loading circle. It sometimes took minutes to start or didn’t even start at all. Now I noticed that the terminal opens immediately and shows a progress what it’s doing like “starting virtual machine”, “starting container” etc. From my recent experience it now starts much faster and doesn’t have the issues from like a year ago. This is a huge improvement!

Backups

Linux on ChromeOS can create backup images from your Linux system. This is really important and allows you to wipe your Chromebook without worrying about your Linux setup. When I started using this feature, backups barely worked. I mostly got errors when backing up to my Google Drive and they rarely finished successfully. Now backups seem to be much faster and work reliably.

USB support

One thing that was stopping me from considering Crostini a “proper development environment” was USB support. The support for USB storage devices came quite early but I really needed support for my Yubikey and Android USB debugging.

Yubikey

I got SSH with my Yubikey working with this workaround but this was not reliable. Also I would like to have the full GPG support for signing stuff etc. Now I can enable the Yubikey in the USB settings for Linux and it just works. I set up GPG, SSH and everything with this great guide and it works like a normal Debian system.

Attention: If you have the Smart Card Connector App installed you need to remove it first. This app takes over your Yubikey and it won’t work with the Linux system (see more). This caused some trouble at first but now there is a solution.

ADB

I needed to install an APK to my Android phone with the Android Debugging Bridge (adb) and I was pleased this worked smoothly. When connecting the phone ChromeOS asked me if I want to connect it to Linux. I said yes and adb worked almost better than on my “normal” Linux PC. I can now do mobile development as well but the performance of my device might be an issue.

Port Forwarding

If you want to access local servers from your Linux container in Chrome, their ports must be forwarded. Previously there was a fixed list of ports that are automatically forwarded. I always had to look this up on Reddit and had some minor issues. Now you can set this up yourself in the settings which is great.

Conclusion

I haven’t used ChromeOS much for development work but it looks like it is now a good OS with these updates. If you look for “cheap” travel laptop as a developer, a Chromebook now might be an option.