How To Run Linux On Chromebook

How To Run Linux On Chromebook

Reading time1 min
#Linux#Chromebook#Developer#Crostini#Coding#OpenSource

Mastering Linux on Chromebook: Unlocking a Complete Developer Environment

Chromebooks began as cloud-first devices. That assumption is fading—particularly once you know how to leverage Crostini to turn a $200 Chromebook into a web-native Linux workstation. Here’s what works, what to expect, and steps to convert your Chromebook into a fast, reliable dev box.


Problem Statement: Chrome OS—Great for Users, Constraining for Developers

Chrome OS is streamlined for browser workloads and security. Useful, but not enough if your workflow relies on native compilers, Git, Docker, Python, or custom scripts. The Linux (Crostini) subsystem bridges this gap with a Debian-based container, supporting most standard developer tooling—minus some kernel extras and hardware drivers.

Before proceeding, answer: Is your device eligible? Device age and Chrome OS version are dealbreakers.


1. Verify Device Support and OS Currency

Most Chromebooks released 2019+ include Crostini support, but a few odd models still block Linux integration.

Checklist:

  • Go to chrome://settings/help or Settings > About Chrome OS
  • Ensure Chrome OS is at least version 107.0.x for optimal Crostini stability
  • Update if necessary. Crostini occasionally breaks after a major OS update, so note your recovery procedures.

Known issue: Some education-managed Chromebooks may silently disable the Linux (Beta) option.


2. Enable Linux (Beta) [Crostini]

  1. Access SettingsDevelopers
  2. Locate Linux development environment; click Turn On
  3. Choose a username (immutable after creation)
  4. Select disk size—defaults to 10GB, but for Node.js, Docker, or VS Code, 20GB+ is safer. Resizing later can be slow.

Heads up: The underlying VM uses dynamic disk allocation but preallocates to avoid fragmentation. Disk pressure may cause container failures—watch available storage via df -h.

After setup, a Terminal app launches: this is Debian 11 (as of Chrome OS 120+), not Ubuntu.


3. Initial Terminal Hardening

Update core packages immediately:

sudo apt update && sudo apt upgrade -y

If you see errors like Temporary failure resolving 'deb.debian.org', verify the VM’s network bridge in Chrome OS settings.

Customize your shell for productivity:

  • Install zsh, htop, or your preferred editor:

    sudo apt install zsh htop vim -y
    chsh -s /usr/bin/zsh $USER
    
  • Optional: Copy your .dotfiles from git.


4. Install Core Developer Tooling

Chrome OS Crostini defaults to barebones Debian. Augment with required dev tools:

ToolInstall CommandNotes
Gitsudo apt install git -yCheck with git --version
Build Essentialssudo apt install build-essential -yFor C/C++ compiles and native modules
Python3 & pip3sudo apt install python3 python3-pip -yDebian 11 typically ships 3.9.x

For Node.js, avoid the outdated apt repo (Debian ships v12). Use nvm for flexibility:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
. ~/.bashrc
nvm install --lts
node -v && npm -v

VS Code:

Gotcha: First launch can be sluggish as the container’s graphics subsystem initializes. If VS Code won’t render UI, run from shell and check for:

[main 2024-06-05T12:10:22.000Z] [error]: Error: EGL_BAD_ALLOC

In that case, restart the Crostini subsystem.


5. Practical Example: Node.js Project in Crostini

Quick smoke test for project workflow:

mkdir ~/projects/chrome-linux-test
cd ~/projects/chrome-linux-test
npm init -y
echo "console.log('Linux on Chromebook operational');" > index.js
node index.js

Returns:

Linux on Chromebook operational

If node reports “Illegal instruction”, you’re likely on a very old or ARM-based model; Crostini x86_64 containers do not support all hardware.


6. Filesystem Integration & Transfers

Linux containers use a virtual file system, available in Chrome OS Files app as Linux files. Cross-copy via drag and drop.

Caveats:

  • Non-Linux folders (Downloads, Google Drive) are not symlinked by default. Use the “Share with Linux” option to expose required directories.
  • For large assets, command-line copying (cp, mv) is consistently faster than drag-and-drop, particularly for lots of small files.

7. Advanced Workflow Tips & Known Issues

  • Disk Resize: In Settings > Developers > Linux > “Resize”, but extending disks often stalls on low-end Chromebooks.
  • X11 and GUI Apps: Many Linux GUI apps work, but 3D acceleration/integrated GPU support remains limited. Try gnome-calculator or gimp for basic checks.
  • Backup/Restore: Use built-in “Backup & Restore” or snapshot your ~/ via tar. Restores are slow (~5GB = 10min).
  • Persistent SSH Keys: Add SSH keys in the container ~/.ssh, but remember these are not synced to Chrome OS.

Not obvious: Crostini supports port forwarding—map a Linux container port for browser testing (e.g., Webpack dev server).


Partial Conclusion: Trade-offs and Gaps

With Crostini, Chrome OS can handle ~80% of standard web or Python development. However, don’t expect full Docker-in-Docker, hardware-level drivers, or high-performance gaming. Power users may still hit walls: LXD, custom kernel modules, or USB peripherals often aren’t supported.


Final Notes

Skip “Developer Mode” unless you require full root on Chrome OS itself; it downgrades system security and disables verified boot. If a workflow is blocked in Crostini, consider cloud VMs (GCP, AWS EC2) with SSH from the container, keeping the Chromebook’s local OS secure and power-efficient.

Questions arising from edge-cases—such as unsupported hardware, slow IO, or network bugs—are best resolved on Chromium’s issue tracker or dedicated r/Crostini discussions.


If you need walk-throughs for Docker, advanced IDEs, or data science stacks on Crostini, ask for specifics; there’s nuance that goes well beyond the basics covered here.