Linux on Chromebooks
Booting Persistent USB
It is possible to boot into a 3.1 USB stick with persistent data saved between sessions. There are plenty of cheap options out there for ultra portable USBs that you'll hardly notice due to their low-profiles. Even better, if you have a chromebook with USB C ports. The main limiter on your system will often be read/write speed, as you are funnelling all of your data through a USB device opposed to internal storage. Be careful to choose the port on your device with the best speed, you will be glad you did later on.
If you boot this way, you won't have to run or use crouton, or even boot into ChromeOS (CrOS). You'll need to enable developer mode, and press CTRL+L
when rebooting the chromebook and the warning for 'OS Detection' being disabled. This is ok, and a needed result of turning on developer mode. To boot into CrOS instead, press CTRL+D
. If you press nothing, a loud BEEP will happen and it will boot into CrOS.
If you have a windows machine handy, check out the links below to see how you can create a persistent USB for booting. This method does not install linux onto the USB, but rather creates a Live USB (Installation media) of your selected distribution. On this Live USB, if created following these directions, there exists a persistent filesystem, which allows you to retain settings and application data between reboots.
Normally, on a Live USB there is no persistence and all data will be lost between reboots, so be careful to follow the steps carefully when creating your USB.
Consider how much you plan to store on your system, for me 30GB storage is plenty to do all my programming and server administration from a Lubuntu installation.
My Toshiba 2 Chromebook is running on a massive 2GB of RAM, paired with a generation 6 Intel Duo ~2GhZ and 16GB internal storage. It ran me $100 in 2015 used off ebay and is still running strong. I run Lubuntu booting into a 3.1 USB, which uses i3wm and the bare minimum for packages installed / running. I have no issues in VS Code, Pycharm, LaTeX editors, and all office applications work fine. The main issue to note is web browsing. Chrome or any derivitive will consume nearly all of your RAM. Firefox does ok, and if you visit about:memory
in your address bar it will allow you to 'Minimize Memory Usage' by clicking a button. Midori is my preferred browser when not dealing with personal accounts and just reading documentation.
Once you have the USB stick made, you can start your chromebook and open a terminal. For me, this is CTRL+ALT+t
. Once in the console window, you'll see a crosh>
prompt. Type the commands below and read the output.
crosh> shell
chronos@localhost / $ sudo crossystem -h
Password:
Usage:
crossystem [--all]
Prints all parameters with descriptions and current values.
If --all is specified, prints even normally hidden fields.
crossystem [param1 [param2 [...]]]
Prints the current value(s) of the parameter(s).
crossystem [param1=value1] [param2=value2 [...]]]
Sets the parameter(s) to the specified value(s).
crossystem [param1?value1] [param2?value2 [...]]]
Checks if the parameter(s) all contain the specified value(s).
Stops at the first error.
Valid parameters:
arch [RO/str] Platform architecture
backup_nvram_request [RW/int] Backup the nvram somewhere at the next boot. Cleared on success.
battery_cutoff_request [RW/int] Cut off battery and shutdown on next boot
block_devmode [RW/int] Block all use of developer mode
clear_tpm_owner_done [RW/int] Clear TPM owner done
clear_tpm_owner_request [RW/int] Clear TPM owner on next boot
cros_debug [RO/int] OS should allow debug features
dbg_reset [RW/int] Debug reset mode request
debug_build [RO/int] OS image built for debug features
dev_boot_altfw [RW/int] Enable developer mode alternate bootloader
dev_boot_signed_only [RW/int] Enable developer mode boot only from official kernels
dev_boot_usb [RW/int] Enable developer mode boot from external disk (USB/SD)
dev_default_boot [RW/str] Default boot from disk, altfw or usb
dev_enable_udc [RW/int] Enable USB Device Controller
devsw_boot [RO/int] Developer switch position at boot
devsw_cur [RO/int] Developer switch current position
diagnostic_request [RW/int] Request diagnostic rom run on next boot
disable_dev_request [RW/int] Disable virtual dev-mode on next boot
ecfw_act [RO/str] Active EC firmware
post_ec_sync_delay [RW/int] Short delay after EC software sync (persistent, writable, eve only)
fw_prev_result [RO/str] Firmware result of previous boot (vboot2)
fw_prev_tried [RO/str] Firmware tried on previous boot (vboot2)
fw_result [RW/str] Firmware result this boot (vboot2)
fw_tried [RO/str] Firmware tried this boot (vboot2)
fw_try_count [RW/int] Number of times to try fw_try_next
fw_try_next [RW/str] Firmware to try next (vboot2)
fw_vboot2 [RO/int] 1 if firmware was selected by vboot2 or 0 otherwise
fwb_tries [RW/int] Try firmware B count
fwid [RO/str] Active firmware ID
fwupdate_tries [RW/int] Times to try OS firmware update (inside kern_nv)
hwid [RO/str] Hardware ID
inside_vm [RO/int] Running in a VM?
kern_nv [RO/int] Non-volatile field for kernel use
kernel_max_rollforward [RW/int] Max kernel version to store into TPM
kernkey_vfy [RO/str] Type of verification done on kernel keyblock
loc_idx [RW/int] Localization index for firmware screens
mainfw_act [RO/str] Active main firmware
mainfw_type [RO/str] Active main firmware type
nvram_cleared [RW/int] Have NV settings been lost? Write 0 to clear
display_request [RW/int] Should we initialize the display at boot?
phase_enforcement [RO/int] Board should have full security settings applied
recovery_reason [RO/int] Recovery mode reason for current boot
recovery_request [RW/int] Recovery mode request
recovery_subcode [RW/int] Recovery reason subcode
recoverysw_boot [RO/int] Recovery switch position at boot
recoverysw_cur [RO/int] Recovery switch current position
recoverysw_ec_boot [RO/int] Recovery switch position at EC boot
ro_fwid [RO/str] Read-only firmware ID
tpm_attack [RW/int] TPM was interrupted since this flag was cleared
tpm_fwver [RO/int] Firmware version stored in TPM
tpm_kernver [RO/int] Kernel version stored in TPM
tpm_rebooted [RO/int] TPM requesting repeated reboot (vboot2)
tried_fwb [RO/int] Tried firmware B before A this boot
try_ro_sync [RO/int] try read only software sync
vdat_flags [RO/int] Flags from VbSharedData
vdat_lfdebug [RO/str] LoadFirmware() debug data (not in print-all)
wipeout_request [RW/int] Firmware requested factory reset (wipeout)
wpsw_cur [RO/int] Firmware write protect hardware switch current position
The setting we are interested in is dev_boot_usb
, so run sudo crossystem dev_boot_usb
to see the current setting.
chronos@localhost / $ sudo crossystem dev_boot_usb
0
And to enable, run the following command.
chronos@localhost / $ sudo crossystem dev_boot_usb=1
Now plug in the USB and reboot the chromebook. When you see the white screen warning about thrid party operating systems, press CTRL+ALT+L
and you'll see a prompt to select the USB device to boot from.
Using Crouton
Crouton allows you to install linux alongside ChromeOS on a chromebook. Click here to grab the latest crouton installer directly, or alternatively visit Crouton's Repository and click the goo link in the description for the same.
To sync your Chromebook's local clipboard with your Linux install, grab the Crouton extension from the Chrome Web Store.
Once you have this file, be sure it is found in your Chromebook's ~/Downloads
directory using the file browser and run the commands below to install Linux -
# Install the crouton binary for use within your chromebook's shell
sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
# Passing -e for encryption, we install all the dependencies for X11 and name(-n) it i3
sudo crouton -e -t core,keyboard,audio,cli-extra,gtk-extra,extension,x11,xorg -n i3
# Enter the chroot
sudo enter-chroot -n i3
# Install i3
sudo apt install i3
# Tell Xorg to start i3 automatically
echo "exec i3" > ~/.xinitrc
# Exit the chroot
# Add an alias for starting i3 in crouton using X
sudo echo "alias starti3='sudo enter-chroot -n i3 xinit'" >> /home/chronos/user/.bashrc
Want i3-gaps instead? See the i3-gaps GitHub for instructions, or run the commands below.
sudo apt-get install software-properties-common
If you're unsure which Distro or DE to install, see the below commands for lists of supported versions.
# List supported Linux releases
sudo crouton -r list
# List supported Linux desktop environments
sudo crouton -t list
# Update chroot (you will need this eventually)
sudo crouton -u -n chrootname
Removing / editing chroots is done via the edit-chroot
CLI -
# Print help text
sudo edit-chroot
# Remove chroot named i3
sudo edit-chroot -d i3
# Backup chroot
sudo edit-chroot -b chrootname
# Restore chroot from most recent tarball
sudo edit-chroot -r chrootname
# Restore from specific tarball (new machine?)
sudo edit-chroot -f mybackup.tar.gz
https://github.com/dnschneid/crouton https://github.com/pasiegel/i3-gaps-install-ubuntu/blob/master/i3-gaps https://launchpad.net/~simon-monette/+archive/ubuntu/i3-gaps https://stackoverflow.com/questions/53800051/repository-does-not-have-a-release-file-error