This is the 2nd post in a 3-part series on using a Chromebook as a power user. Part 1 gave a high-level overview of how I'm using my Chromebook and some basic Chrome OS configuration steps. This post digs deeper to show advanced users how to use crouton to install Debian Linux in a chroot. Part 3 finishes up by configuring LXDE and connecting to a remote FreeBSD desktop running xrdp.
As discussed in Chromebook for Power Users: Part 1, the primary use for my Chromebook is to act as a dumb terminal to remote my FreeBSD desktop. I run xrdp on the desktop, which allows me to securely connect to an X session using a standard RDP client. That's why I was disappointed to find that none of the popular RDP clients for Chrome OS were able to connect to xrdp. In an effort to settle for less, I enabled a VNC server and tried connecting. While VNC "worked," the experience was unacceptable due to keyboard issues related to uppercase/lowercase letters and the shift key. That was a deal breaker for me: if I couldn't remote my desktop with it, a Chromebook would be almost useless—just an oversized tablet weighed down by an attached keyboard. Luckily, crouton came to the rescue by enabling me to install Debian Linux in a chroot on the Chromebook.
Before we begin, there are some critical preparation steps to perform. You'll probably want to plug in since a few of these steps are battery intensive. First and foremost, install the Chromebook Recovery Utility and launch it to create a restoration disk. If things get ugly, you can use that to recover your Chromebook. Don't perform any of the following steps until you have a recovery disk on hand. Second, back up any files that aren't already stored online or on another computer since the next step will wipe the disk. Then turn off your Chromebook using the shut down option on the main menu.
Now you're ready to enable Developer Mode. The exact steps may vary, so refer to Developer Information for Chrome OS Devices for specifics regarding your model. For my Toshiba CB35-B3340 13.3" Chromebook, the following actions taken from step 2 of this article worked:
- Hold Esc and Refresh while pressing the Power button to turn the Chromebook on.
- On the recovery screen, press Ctrl + D to skip the recovery process.
- When prompted, press Enter to turn off OS verification.
- On the screen warning that OS verification is off, press Ctrl + D again. You'll need to press Ctrl + D to bypass this screen every time you boot Chrome OS from this point forward.
- Wait for the changes to be applied. You should see a progress bar during this process.
Installing Debian Linux in a chroot on Chrome OS
Once you're logged back in, it's time to download crouton—just save it to your Downloads folder for now. You may also want to install the crouton extension to enable clipboard synchronization and some other features. Now comes the fun part. Press Ctrl + Alt + T to launch crosh, the Chrome OS developer shell, and type
shell to enter a more full-featured Bash shell. You'll need to pick a Linux release to install (current distro options are Debian, Kali, or Ubuntu) as well as the targets, which are like meta-packages or features installed in the chroot. Use the following commands to view the releases (
-r) and targets (
-t) available for your version of crouton:
sudo sh -e ~/Downloads/crouton -r list Recognized debian releases: potato* woody* sarge* etch* lenny* squeeze* wheezy jessie stretch sid Recognized kali releases: kali* sana Recognized ubuntu releases: warty* hoary* breezy* dapper* edgy* feisty* gutsy* hardy* intrepid* jaunty* karmic* lucid* maverick* natty* oneiric* precise quantal* raring* saucy* trusty utopic* vivid* wily* xenial* Releases marked with * are unsupported, but may work with some effort. sudo sh -e ~/Downloads/crouton -t list Available targets: ... extension Clipboard synchronization and URL handling with Chromium OS. Requires: x11 ... lxde Installs the LXDE desktop environment. (Approx. 200MB) Requires: gtk-extra ...
I wanted a clean, lightweight install since the goal was simply to remote my desktop. I recommend using the latest stable Debian release, which was jessie at the time of this blog post. I chose the lxde target for a desktop environment and the extension target to sync with Chrome OS. Note that you don't need to list the dependencies when specifying targets to install. For example, lxde requires gtk-extra while gtk-extra requires x11, so there's no need to include gtk-extra or x11 in your target list if you're installing lxde. The command on line 1 below installs the jessie release with the lxde and extension targets, so change those values to whatever you'd like to use. You can also add the
-e option to the end of the line to install into an encrypted chroot (yes, it's a 2nd
-e for the crouton command since the 1st is for sh), but I omitted it since no private data will ever be stored in my chroot. The username and password created during this step are for the user inside the Debian chroot.
sudo sh -e ~/Downloads/crouton -r jessie -t lxde,extension Installing jessie-amd64 chroot to /usr/local/chroots/jessie Downloading latest debootstrap... ... Please specify a username for the primary user: chris Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Here's some tips: Audio from the chroot will now be forwarded to CRAS (Chromium OS audio server), through an ALSA plugin. Future Chromium OS upgrades may break compatibility with the installed version of CRAS. Should this happen, simply update your chroot. You can flip through your running chroot desktops and Chromium OS by hitting Ctrl+Alt+Shift+Back and Ctrl+Alt+Shift+Forward. You can start LXDE via the startlxde host command: sudo startlxde You already have the Chromium OS extension installed, so you're good to go! Unmounting /mnt/stateful_partition/crouton/chroots/jessie... Done! You can enter the chroot using enter-chroot.
Be sure to read the usage tips shown at the end. If your installation fails for any reason, simply delete the chroot using
sudo delete-chroot jessie and try again. For the curious, I had 8.7 GB free on my /home partition before the installation and 7.3 GB after, so this chroot used 1.4 GB of disk space.
Managing Your crouton chroot
If you prefer to type shorter commands (who doesn't?), move the crouton script to a folder in your path and make it executable:
sudo mv ~/Downloads/crouton /usr/local/bin/ chmod +x /usr/local/bin/crouton
That allows you to omit
sh -e ~/Downloads/ when calling the crouton script from this point forward.
Updates are a simple 2-step process. Enter the chroot using
sudo enter-chroot and execute the following command:
croutonversion -u -d -c crouton: version 1-20160206234800~master:daa872a0 Retrieving latest version of crouton latest: version 1-20160206234800~master:daa872a0 exit
Then from the local machine (not the chroot), you can update the installed targets:
sudo crouton -u -n jessie /usr/local/chroots/jessie already exists; updating it... Preparing chroot environment... ... Here's some tips: Audio from the chroot will now be forwarded to CRAS (Chromium OS audio server), through an ALSA plugin. Future Chromium OS upgrades may break compatibility with the installed version of CRAS. Should this happen, simply update your chroot. You can flip through your running chroot desktops and Chromium OS by hitting Ctrl+Alt+Shift+Back and Ctrl+Alt+Shift+Forward. You can start LXDE via the startlxde host command: sudo startlxde You already have the Chromium OS extension installed, so you're good to go! Unmounting /mnt/stateful_partition/crouton/chroots/jessie... Done! You can enter the chroot using enter-chroot.
If you run into trouble or want to dig deeper with it, check out the crouton project home page and crouton wiki. Of course, as long as you're not storing anything important in the chroot, you can easily delete it and start over with a clean slate.
Once your chroot is installed, move on to Part 3 in this series to turn LXDE into the perfect environment for remoting a FreeBSD machine.