Linux Format

Crouton: Linux on a Chromebook

Looking for something clever to do with your fancy new Chromebook? Neil Mohr takes the latest Asus Flip through a Linux overhaul.

- Neil Mohr has been scaring T3 magazine all week by running Linux terminals on his Chromebook and telling them the darkness is coming to consume all of their MacBooks – that lot will believe anything.

We’ve seen a lot of Chromebook­s in the pages of LinuxForma­t recently and as much as we appreciate the Linux-powered Chrome OS, we often want something with more software power like a fully-featured Linux distributi­on (distro). If you’re considerin­g buying a new Chromebook then consider this: you can easily run Ubuntu on top of Chrome OS within a virtual chroot through the Crouton system. We covered this back in LXF185 [Tutorials, p50] and being honest not much has changed, but we’re going through the latest revision that runs Ubuntu 14.04 (rather than the ageing 12.04 LTS) and we’ll take a look at how you can run this off any available SD card (or USB stick) – so no internal storage is lost – while also looking at dualboot options for running Arch.

So who said Chromebook­s were limited? They don’t sound too limited with this many GNU/Linux install options available, do they? For this install we’re using the new Asus Flip C100P. It’s interestin­g as it uses an ARM Rockchip SoC, has a touchscree­n and retails for around £250 for the version with 4GB of memory, which means it’s perfectly qualified to run a full distro. We’ve chosen this model as the ARM element can cause issues, which we’ll cover in the Arch boxout ( see p83), but otherwise for crouton it’s a solid choice.

Most Chromebook­s tend to opt for the vanilla Intel Celeron processor of the day, currently that’s the Intel Celeron 3205U. It’s a safe bet with good processing power, reasonable battery life, the tested and stable Intel architectu­re, plus the knowledge all that x86-64 software will work and be available for you. So choosing an ARM-based Chromebook would be madness, right? Wrong! Let’s quickly see why…

First off Ubuntu and Debian have ARM builds. There’s not quite as much available in the repositori­es (repos), but you’ll find most big-name programs waiting for you and all the usual tools are available. It’s true the ARM processor isn’t as powerful, our tests in the Chromebook Roundup [see Roundup, p24, LXF202] showed the ARM Asus Flip was about half the speed of the Intel Celeron Acer Chromebook 15, but how much speed do you really need? The major issue for these ARM SoC is that the open source drivers can be terrible, especially lacking 3D accelerati­on.

As we discovered with the Arch build, it’s simply next to impossible to get a desktop environmen­t up and running at the moment with the supplied drivers. Even long-time Arch user and fan-boy Jonni had no luck getting even a basic startx working on it, never mind. Running through Crouton is a different story but there are still limiting issues as you’ll discover. Certainly if you want the best hardware support opting for an Intel Chromebook is the most sensible move, however through Crouton we had Ubuntu 14.04 Xfce up and running with touch support without issue. Happy Days!

Crunching croutons

Before we start we’ll want to enable Developer mode, which if you don’t already have on, will wipe everything off your Chromebook. So back up everything or be happy to have a forcibly cleaned system.

To begin, power off your Chromebook, press and hold the Esc and Refresh keys on the top row of the keyboard, then tap the power button. This fires up a scary message, ignore it, and press Ctrl+d, then press Enter to allow it to wipe and reinstall Chrome OS – this takes about ten minutes. From now on you’ll need to press Ctrl+d to boot your Chromebook (it will self-boot after 30 seconds but who can wait that long), as we’ll see you can press Ctrl+u to boot off an external USB storage device.

Once back into Chrome OS, download the Crouton script using: https://goo.gl/fd3zc to your Download folder. Press Ctrl+Alt+t to open a basic terminal, use the shell command to switch to a full shell.

Crouton normally stores chroots within the /usr/local folder, what we’ll do is create a symbolic link from this to a folder on the SD card, so we’re able to create the Crouton chroot as usual, but with everything stored on the external storage. We’re lucky that we have a 32GB microSD card, so we’re going to be installing any operating systems on to this, which’ll give us plenty of space to play with. Let’s change directory to where the chroot’s live with cd /usr/local then

use lsblk to list the devices and partitions on your device. Look for sda1 on a USB stick/drive or mmcblk1p1 with a SD card and make a note of the name after the /media/

removable/ part. Create a new chroot folder with:

$ sudo mkdir /media/removable/<NAME>/chroots

Then create the symbolic link using:

$ sudo ln -s /media/removable/<NAME>/chroots/ chroots

You’re now ready to use Crouton to install Ubuntu to the new symbolic linked folder. We’re able to use Ubuntu Trusty Tar 14.04, but there’s no 3D accelerati­on so we need the Xfce interface and can take advantage of touch features on the Asus Flip. You can add encryption with a -e switch just after the sh but you might want to just test things out without it: $ sudo sh ~/Downloads/crouton -r trusty -t touch,xfce

After downloadin­g Ubuntu you’re able to enter the chroot and start it with these two commands:

$ sudo enter-chroot $ startxfce4

Once in just log out to drop back to Chrome OS. You can flick between Ubuntu and Chrome OS using the shortcuts in the Quick Tip ( left), we’ll also look at how you’re able to extend the chroot to run it in a Chrome OS window as well as switch between full screen and windowed mode. You’re able to delete the chroot with sudo delete-chroot

<chrootname> the default name is the release name ie trusty. You’re able to get a list of available releases (different distros) and a list of available targets (desktops) using the commands below. One thing to keep in mind: with ARM devices like the Flip Unity 2D is only available under Ubuntu 12.04 as the SoC lacks EGL support.

$ sh ~/Downloads/crouton -r list $ sh ~/Downloads/crouton -t help

How do you keep Crouton and your chroot up to date? To check for updates, download the latest version, and see what’s new by running croutonver­sion -u-d -c from within the chroot (run croutonver­sion -h to see what those parameters actually do). Exit out of the chroot and run

sudo sh ~/Downloads/crouton -u -n <chrootname> to update

all the installed targets.

Find yourself using your chroot a lot? Then you might want to back it up, edit-chroot offers an easy backup and restore feature. It defaults to the ~/Download folder but using the -f switch enables you to add a path, like so: $ sudo edit-chroot -f /media/removable/<card name> -b <name of chroot> To restore just replace the -b with a -r switch. Finally, you can also add an extension to Chrome OS from here https://goo.gl/OVQOEt that enables shared clipboards and accelerate­d windowed use. Once added to Chrome OS itself, use this command to update your existing Trusty chroot with the extension and xiwi targets with: $ sudo sh ~/Downloads/crouton -r trusty -u -t extension,xiwi To then implement the shared clipboard get the Chromium browser installed in the chroot version of Ubuntu and use the same link above to add the same extension within it. Once that’s all done restart the Chromebook and you’ll find the chroot can be run within a Chrome OS window and utilises a shared clipboard. Handy!

 ??  ?? Using the Chrome OS extension enables you to run Linux in a window, just the way God intended.
Using the Chrome OS extension enables you to run Linux in a window, just the way God intended.
 ??  ??
 ??  ?? You may only be able to run Xfce but it makes us so happy and you get access to a whole world of Linux programs that aren’t on Chrome OS.
You may only be able to run Xfce but it makes us so happy and you get access to a whole world of Linux programs that aren’t on Chrome OS.

Newspapers in English

Newspapers from Australia