How to Set Up Linux Development Environment (Crostini) and Port Forwarding on Chrome OS

Chrome OS has evolved from a lightweight web-centric platform into an operating system capable of running production-grade software development stacks. Through Crostini—Google’s containerised Linux development environment—Chromebook users can run standard Debian Linux terminal tools, install graphical IDEs (such as Visual Studio Code and JetBrains fleet tools), compile code, and run containerised microservices directly alongside standard Chrome OS web apps.

Because the Linux environment operates inside a secured, hardware-isolated virtual machine (crosvm) managed by the Termina VM layer, web servers or Node.js development endpoints running inside the Debian container are shielded behind container network address translation (NAT). To access local development servers from the native Chrome browser or test Android apps against local APIs, developers must configure Chrome OS Port Forwarding. This technical guide explains how to enable Crostini, resize virtual disks, configure local port forwarding, and install GUI development applications.

Crostini Architectural Model Overview

Understanding the virtualization boundary explains how networking and file isolation operate on Chrome OS:

Layer Technical Component Security & Operational Function
Host Kernel Chrome OS Linux Kernel Manages base hardware, display compositing (Wayland/Exosphere), and peripheral access.
Virtual Machine crosvm (Termina VM) Provides hardware-enforced hypervisor isolation between the host OS and Linux containers.
Container Debian LXC Container (penguin) The user-accessible filesystem where apt packages, Python runtimes, and Docker daemons execute.
Networking veth virtual Ethernet bridge Assigns an internal 100.115.92.x IP address to the container, requiring port forwarding for host loopback.

Step 1: Enabling the Linux Development Environment

Before launching Linux tools, initialize the Crostini subsystem within system settings:

  1. Open the Settings app on your Chromebook.
  2. In the left-hand navigation menu, select Advanced, then click Developers.
  3. Beside the Linux development environment heading, click Turn on.
  4. In the setup wizard, click Next.
  5. Choose a Linux username (defaults to your Google account handle).
  6. Specify the virtual disk size allocation. While the system suggests a 10 GB default, allocate 20 GB to 40 GB if you intend to install Node.js, Python libraries, Docker, or heavy IDEs.
  7. Click Install. Chrome OS downloads the Termina VM image, bootstraps the Debian container, and opens the native Terminal app.

Step 2: Updating the Debian Container and Installing Development Tools

Once the terminal window appears, update the apt package indices and install fundamental compilation utilities:

# Update Debian repositories and upgrade packages
sudo apt update && sudo apt dist-upgrade -y

# Install build essentials, git, and curl
sudo apt install -y build-essential git curl wget libssl-dev

Installing Visual Studio Code

To run modern graphical code editors natively:

  1. Open the Chrome browser and download the official .deb package from the Visual Studio Code website (ensure you choose .deb (ARM64) or .deb (x64) matching your Chromebook processor).
  2. Open the Chrome OS Files app, locate the downloaded .deb file in your Downloads folder.
  3. Right-click the file and select Install with Linux.
  4. Once installed, VS Code appears in the Chrome OS App Launcher inside the Linux apps folder and integrates natively with the Chrome OS window manager.

Step 3: Configuring Port Forwarding in Chrome OS

When running a local web development server (such as an Express, Django, or React development server on port 3000 or 8080) inside the Linux container, you may need to access it from the host Chrome browser, test it across an Android emulation session, or share it across your local Wi-Fi subnet:

  1. Open Chrome OS Settings and navigate to Advanced > Developers > Linux development environment.
  2. Select Port forwarding.
  3. Click Add port.
  4. In the dialogue box:
    • Port number: Enter the target port (e.g., 3000 or 8080).
    • Protocol: Select TCP (or UDP depending on your application).
    • Label: Assign an identifier (e.g., ReactDevServer).
  5. Click Add. Chrome OS establishes a low-latency forwarding bridge connecting host loopback requests directly to the container’s virtual ethernet interface.
  6. Open the Chrome browser on your Chromebook and navigate to http://localhost:3000 to view your containerized web application.

Step 4: Sharing Host Files and USB Devices with Linux

To permit Linux command-line utilities to read host Chrome OS downloads or connect to hardware development microcontrollers:

  • Sharing Folders: Open the Files app, right-click any folder (such as Downloads or a cloud Drive directory), and choose Share with Linux. The folder mounts inside the container under:
    /mnt/chromeos/MyFiles/Downloads
  • USB Serial Devices: When connecting an Arduino, Raspberry Pi Pico, or Android phone for ADB debugging, open Settings > Developers > Linux development environment > Manage USB devices, and toggle the physical device to route its USB endpoint into the container.

Backup and Restoration Best Practices

Because the Linux environment lives inside a single container image, backing up your complete development environment takes moments:

  1. Navigate to Settings > Developers > Linux > Backup & restore.
  2. Click Backup and choose a secure storage destination (such as Google Drive or an external SSD).
  3. Chrome OS packages the entire container filesystem into a .tini backup archive. If your container ever experiences package corruption, clicking Restore recovers your entire environment in minutes.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.