Install Ubuntu with i3wm on a Chromebook
2017-07-22
Table of Contents
- Why Chromebook?
- Why Ubuntu on a Chromebook?
- Why i3wm Instead of a Desktop Environment?
- Installation and Setup
- More Info
Why Chromebook?
Chromebooks are great! They're cheap, they have decent build quality, and they have good battery life. If you get one of the smaller models such as the Samsung Chromebook 3, they're very portable, too. For $169, it's hard to beat.
Why Ubuntu on a Chromebook?
If you like Chrome and only use web applications, you're already done. No need to install Ubuntu. But if you want to run a "traditional" GNU/Linux desktop environment or other software locally, you'll want to explore other options.
While it's possible to remove ChromeOS and install another operating system, using Crouton to create a chroot is quick and easy. Since you're running with the kernel from ChromeOS, you're much more likely to get good hardware support. If you have any problems in your chroot, you can always switch back to ChromeOS for troubleshooting.
Why i3wm Instead of a Desktop Environment?
i3 is a tiling window manager with simple configuration and good documentation. Tiling window managers use screen space efficiently, and that's particularly good for my 11 inch Chromebook. i3 is lightweight and fast, and that's good for my relatively slow Intel Celeron processor. And foregoing the full desktop installation lets me save space on my relatively small 16GB hard drive - I only install the packages I actually use. But the most important reason I'm using i3 on my Chromebook is that I like it!
Installation and Setup
Switch Chromebook to Developer Mode
Visit this Chromium OS wiki page, find your device, and follow the steps to enter developer mode.
Turning on developer mode turns off some security features and wipes the data on your Chromebook. You should use the "-e" option to create an encrypted chroot, and set a strong root user password when prompted during the installation.
Install Crouton and Create a chroot
Short version
Follow the instructions from the Crouton GitHub page to install Crouton.
Long version
-
Download the latest version of Crouton.
-
Install a new chroot without any specific desktop environment.
sudo sh ~/Downloads/crouton -e -t core,keyboard,audio,cli-extra,gtk-extra,extension,x11,xorg -n i3
-
Start your chroot.
sudo enter-chroot -n i3
-
Install i3.
sudo apt install i3
-
Configure i3 to start when X11 starts.
echo "exec i3" > ~/.xinitrc
-
Exit your chroot and add a
starti3
alias to your/home/chronos/user/.bashrc
file.alias starti3="sudo enter-chroot -n i3 xinit"
-
Install the Crouton Chrome extension to synchronize the clipboard between ChromeOS and your chroot and get the keyboard shortcut keys working properly.
-
Restart your Chromebook.
-
Start your chroot with i3 using the
starti3
alias.
Configure i3
If you want to configure i3 yourself or just use the default configuration, you can skip this step. If you want to use my configuration, download the i3 config file, place it at ~/.config/i3/config
, and restart i3 ($mod+Shift+r
).
You'll need to install the following packages
-
feh, for setting the wallpaper
sudo apt install feh
-
ImageMagick, for resizing and transforming wallpaper and lock screen images
sudo apt install imagemagick
-
scrot, for capturing screenshots (used for the lock screen)
sudo apt install scrot
-
Font Awesome, for the i3 status bar icons
sudo apt install fonts-font-awesome
-
Terminus Font, for the window titles and status bar
sudo apt install xfonts-terminus
Next, download the relevant i3 scripts, unzip them, make them executable, and put them in a location on your PATH.
-
i3-set-wallpaper, a helper for setting the wallpaper image. Download
-
i3-lock-screen, a helper for locking the screen with a blured screenshot. Download
-
i3-status, a replacement for i3status which I never could quite configure correctly on the Chromebook. Download
Note: You'll want to adjust the screen resolution inside the i3-set-wallpaper
and i3-lock-screen
scripts if you have a resolution other than 1366x768.
Note: You'll need to adjust some paths in the i3 config file based on your own user's home directory.
Audio Playback
After the default Crouton installation was finished on my Chromebook, the sound didn't work inside of the chroot.
To fix audio in the chroot
-
Create link to PulseAudio configuration in
~/.pulse
mkdir ~/.pulse ln -s /etc/crouton/pulseaudio-default.pa ~/.pulse/default.pa
-
Change group ownership to "audio" for the sound devices.
sudo chgrp audio /dev/snd/*
-
Change group ownership to "audio" for sound cards.
sudo chgrp audio /proc/asound/card*
-
Set default ALSA sound cards to "cras" in
/etc/asound.conf
(create the file if it doesn't exist).pcm.!default { type cras } ctl.!default { type cras }
Extra Stuff
I installed the following extra packages for a graphical file manager, image viewer, and other helpful things. If you use my i3 configuration, you'll notice that the MATE terminal is set as the default terminal.
Extra packages
-
mate-terminal
sudo apt install mate-terminal
-
Caja file manager
sudo apt install caja
-
Eye of MATE image viewer
sudo apt install eom
-
lxappearance for configuring themes and icons
sudo apt install lxappearance
-
Arc GTK theme
sudo apt install arc-theme-solid
-
Paper icon theme
sudo apt install paper-icon-theme
More Info
If you need more information on Crouton or i3, check out the documentation available on the project websites: