• chromebook
  • linux

New Life for an old Chromebook

Chromebooks, introduced in 2011 initially for the Business and Education markets found quick success in schools mainly due to lower cost of purchase and ease of maintenance. Google Classroom released in 2014 raised the proposition even further but it was probably Google's planned obsolescence for Chromebooks that was their most genius move. The first bullet point in Google's Auto Update Policy states:

"Every ChromeOS device receives regular updates from Google until it reaches its Auto Update Expiration (AUE) date, listed below, subject to support from component manufacturers. When a device reaches AUE, automatic software updates from Google will no longer be provided."

This policy makes sense for Google and the manufacturers since Google doesn't end up with an unlimited number of devices to support and manufacturers get a great excuse to end-of-life their old models and sell new ones. It also makes a lot of older chromebooks which are still perfectly usable hardware available for cheap. Of course the caveat is that the chromebook will no longer be updated making it a risky proposition to operate as is. 

ASUS C202sa Chromebook

The ASUS C202S (note:Amazon link) that I have is a ruggedized, water resistant 11.6" chromebook released in 2016. I actually have two in the family at this point, and while they're definitely slow they work just fine. This is an Intel based (braswell) device with an N3060 1.6Ghz processor and 4GB ram. The 16GB flash drive means you've got to be sparing with what you store on it, but it has two type A USB ports (I use one for a wireless mouse although the touchpad works as well), and an SD card slot so you can carry around more files if you need to. A 35mm headphone jack may be less than useful these days but its HDMI port makes it possible to run a presentation or just use a big screen if you want. With an AUE date of June, 2022 however, while it still works fine and the battery is still pretty strong ChromeOS is no longer getting updated. You can find these used on amazon for as low as $60 but be aware that unscrupulous folks are still selling this device today as new at full price of $350! 

This machine has served well and I would love to be able to continue using it. Also as a linux fan I'd love to be able to run a full linux OS on it and have often thought about doing so but until a few months ago it was still getting ChromeOS updates frequently. Since I'm a big Firefox fan I'm also interested how usable this would be with Firefox as primary browser as compared to the default Google Chrome.

MrChromebook Firmware

Enter MrChromebox!

Following the excellent guides on https://mrchromebox.tech/ and using the firmware maintained on the associated github: https://github.com/MrChromebox/scripts I was able to load and try out several distributions of Linux.

Turning this post into a how-to is really not necessary because the documentation on that site is really very good. It basically boils down to opening the laptop and removing the write protect screw (newer chromebooks use a different method), booting the machine into developer mode (ESC+Refresh+Power then Ctrl+D). Coreboot Braswell devices like this one did not ship with a legacy boot firmware, but it can be installed with a script. Log in as guest and (CTRL+ALT+T then type "shell") then use the command from the site (curl) to download and run the script. Once you have prepared a live linux USB drive on another machine, reboot with that USB plugged in and we are greeted with a UEFI enabled Coreboot boot screen that you can use to select that USB device and start loading linux!

I tried a few linux distributions before looking on distrowatch and deciding to try EndeavourOS which I really liked and will discuss later.

Ubuntu on Chromebook

Notes from playing with Xubuntu on the Chromebook

It was pretty clear to see that Gnome based systems were not going to be performant on this extremely under-powered device. Xubuntu's XFCE ran well but I wasn't very familiar with it so I ended up taking a lot more notes related on getting things working. This wasn't XFCE's fault and Xubuntu isn't the only distro that offers XFCE out of the box. Eventually I opted for an Arch based distro with XFCE and its maybe slightly quicker than ChromeOS with a LOT more functionality.

Touchpad

The touchpad wasn't working until I removed the synaptics driver - this one uses an Elan touchpad

sudo apt remove xserver-xorg-input-synaptics

ZFS mounts as removable drives

Theres a bug which mounts the ZFS bpool and rpool as drives on the desktop. You can't access these directly so these should be hidden. I found a very similar error report from someone using gnome, but I'm using XFCE. I ended up disabling removable drives in Settings | Desktop | Icons tab to make them go away but of course now other removable drives won't show up as icons. Not a deal killer, but already feeling less welcomed.

Sound

Sound was not working until I ran

sudo alsa force-reload

which did seem to get it working, at first. Sound in this particular installation of Xubuntu was the biggest consistent problem. Sound randomly stopped working entirely and I'd have to either use the reload command or restart whatever app I was using. Youtube audio would stop and then all I would hear was a single tone till I refresh the page. Sadly, this also happened in VLC. It would play a song or two but then end up just playing a tone until I ended the program. Considering how well everything else seems to be working this is sort of a crushing disappointment. There is nothing helpful in the system logs that I see. I really wasted a lot of time on this problem and was getting frustrated.

I found this bug which sounded very similar.

VLC in CLI

I wanted to eliminate XFCE entirely from the issue and found that you can run VLC from the command line. I'd like to say this made up for all the frustration, but sadly no it didn't. I uninstalled lightdm and booted straight to command line, and tested audio with VLC with:

vlc --intf ncurses file:////home/myuser/Music

and had the same exact results. It even happened when I ran alsa's "speaker-test" utility (which blasts "left front" / "right front" over and over again). Ultimately the sound issue made me abandon Xubuntu.

Chromebook Function Keys

Trying to get all the function keys working was a little frustrating. The closest I came in ubuntu based OS was to install the GalliumOS xkb package (a package that dates from 2019 apparently) which provides a lot of alternate layout keyboards and choosing one of those. In the space of time that I was testing, an update removed a bunch of the Chromebook options and replaced them all with just one. This works to enable the mute, volume up and down button with the on screen display and everything, but did NOT make the brightness buttons work. I need to click the power icon and adjust it manually. Brightness doesn't work.

sudo dpkg -i xkb-data_2.23.1-1ubuntu1-galliumos1_all.deb

choosing one from Settings | Keyboard | chromebook

This list of other mappings might be of interest: https://wiki.galliumos.org/Media_keys_and_default_keybindings

Booting into command line

I disabled booting into the GUI login so that I can open the laptop and get an immediate command line.

 sudo systemctl disable lightdm

I can start xubuntu easily enough with startx. This makes booting super quick which is nice in case I meant to boot from USB and forgot. I can log in and do updates and even check a website with elinks or grab a file from my server using sftp with mc. I think the real reason I did this was because Xubuntu's lightdm was just too slow for me. After I moved to Endeavour I decided to keep booting into GUI because it works fine.

sftp in Thunar file manager

To get Thunar to be able to access an sftp share (which is how I access files on my synology)

sudo apt-get install gvfs-fuse gvfs-backends

Applications

Since I had chosen a minimal install of Xubuntu, there wasn't much more than a brower and terminal available. First I installed a bunch of command line applications I normally use:

Then I installed some GUI apps I use alot:

Learning how to customize XFCE desktop

XFCE provides a nice way to create and edit panels and I was soon unhappy with the default panel in Xubuntu. I created a secondary panel set to autohide centered along the bottom and added application launchers for various apps I use commonly. I set that panel to be a bit larger (48) and left the the primary panel at the top of the screen at 22. The top panel had all the normal status indicators you'd expect like date/time, volume (pointing to pavucontrol:amd64), wifi/network, battery power, notifications, an area for window "buttons" for running applications, and a shutdown/restart button launcher.

The lower (applications) panel looked a lot like a Mac (or Windows 11) lower task bar and had launchers for a bunch of commonly used apps.

I created a luncher on the top panel named power which opens:

xfce4-session-logout

This exists in the Whisker menu (something that looks like the Windows start menu which is in the panel by default but which I moved to my secondary panel because I only want to use it rarely. I just wanted to click on an icon and get the options for shutdown, restart, suspend, log out which this does.

Took me a while to figure out that to set a solid color for my background instead of an image you have to set the Style dropdown to None.

Xterm size is set to 150x36, "Show unsafe paste" unchecked in General, Colors tab preset to Xubuntu Dark in preferences.

The right to not workspace

In Settings for XFCE I set only one workspace because I know I would accidentally end up with programs on another workspace and get frustrated trying to figure out where it went (or I'd have to add a workspace switcher on a panel) because I never use them and this device has barely enough memory to run just one anyway.

EndeavourOS

Eventually when I couldn't get sound working in Xubuntu or even get a clue as to why it was happening I started to look around again. I found EndeavourOS on Distrowatch (DW) as second on the list.

EndeavourOS live

EndeavourOS is Arch based (unlike Ubuntu which is debian based) but I've been running Arch on a portable USB drive for many years now and have tried various Arch based distros before (like MX Linux which is currently number one) and liked them. I chose their XFCE variant because I had just spent so much time configuring it and needed something lightweight.

This time sound was the first thing I tested and I did so right from a live USB before installing. If the issue happened in an entirely different OS I'd have to admit it might be a hardware problem (even though I never had any issues in ChromeOS). In EndeavourOS, VLC was able to play audio just fine and not stop and screech, but turned out I couldn't play youtube videos in Firefox without audio and video stutter.

Thankfully I found this post which pointed to two keys to change in Firefox's about:config

media.ffmpeg.vaapi.enabled

was set to false initially so I toggled to true. The other key,

media.rdd-vpx.enabled 

was already true in my case.

Closing and re-opening Firefox allowed videos to play just fine. Basically without this key enabled video processing is all CPU and no GPU. The N3060 does have a GPU which supports 4K/H.265 video acceleration, HD Graphics 400, so might as well use it.

For the most part I'm pretty happy with the default interface of EndeavourOS with only a few tweaks so even though I had saved my XFCE .config settings, I didn't end up using it.

Endeavour is using less memory with the same apps open than Xubuntu did (in some tests almost 800 MB less!) with the added bonus that audio is rock solid which is probably my number one requirement. I removed the default music player, parole and installed vlc which is my preferred player. I removed the default image viewer ristretto and installed nomacs which I had discovered when using Xubuntu and is a little more fully featured. While tilem is in the AUR, installing it given all the dependencies was more of a pain than it was worth to me - I just need a scientific calculator so I installed gnome-calculator and removed the pre-installed galculator.

How good is that battery from 2016?

This helpful post allowed me to gauge the life of the battery. First run:

upower -e

to list the various power devices. Copy the path to your battery:

/org/freedesktop/UPower/devices/battery_BAT0

Then run it again with that path to get more information. You're looking for energy-full and energy-full-design to compare.

upower -i /org/freedesktop/UPower/devices/battery_BAT0
    energy-full:         27.7476 Wh
    energy-full-design:  38 Wh

so back of the sleeve suggests the battery is at about 75% of original capacity.

Fixing the backlight buttons

Thanks to a post by Markov Vladimir on stackexchange I was able to figure out that by using

sudo showkey -k

and hitting the two unmapped brightness keys that their keycodes were 64 and 65. Trying to associate these keys to anything in the XFCE keyboard applications shortcuts tab doesn't work as is - you can press the key but it doesn't recognize it being pressed.

sudo getkeycodes

provides the hexidecimal scancodes associated with various decimal keycodes. 1-83 is just straight mapping, so the hex of 64 is 0x40 and 65 is 0x41.

xmodmap -pke

shows the keycodes I need as 72 and 73 because these are listed as the Brightness down and up respectively, so we use setkeycodes to add an association between the raw scancode 0x40 and kernel keycode 72 for example.

sudo setkeycodes 0x40 72
sudo setkeycodes 0x41 73

Now running showkey will show those keycodes instead and the keyboard application will see the keys. I installed xbacklight with:

sudo pacman -S xorg-xbacklight

and set the buttons in the keyboard applications shortcut tab to:

xbacklight -dec 2

and

xbacklight -inc 2

and the buttons are now working as expected. I imagine we could remap any other non-functional keys the same way.

update 221217

Already moved to KDE

I couldn't help but try out a bunch of different Linux distributions which I won't go into much detail about including Solus a gnome based system which was recommended for chromebooks; but I came back to EndeavourOS but this time trying out the KDE flavour. I didn't have high hopes since I've always thought KDE required far more resources, but it ran very well, was super slick (the last time I tried KDE it was a horribly buggy mess though that was a looong time ago), and amazingly all of the Chromebook keys I care about (brightness and sound) worked out of the box (once I changed keyboard layout to Chromebook). Sleep and resume seem to be working fine, and I really do like the interface a lot. Dolphin (file manager) is going to take some time to get used to but I didn't like Thunar that much anyway. I did install all the basic stuff I mentioned above even though there are perfectly good KDE versions of things, I ripped a lot of them out already.

To swap or not to swap

There really is no question. With as limited RAM as this device has (4GB) you're going to need a swap file at some point. I tried to run without one but found that with demanding tabs open like Google Maps in street view in 3D mode or Reddit after scrolling a while in addition to terminal and dolphin and whatever else I was working on, I could end up locking up the OS entirely. Sure, I could wait 2 hours for the kill command I typed to register but I ended up powering it off hard. Since I had already set the OS up without one, I read that the best idea with flash disks like this have is to designate a swap FILE as opposed to creating a new partition.

I created an empty 1GB file at /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 status=progress

set the permissions on it:

sudo chmod 600 /swapfile

made it into a swap file

sudo mkswap /swapfile

turned the swapfile on

sudo swapon /swapfile

added a line in /etc/fstab so it would get loaded every boot

sudo vim /etc/fstab

/swapfile      none    swap defaults    0 0

note: no UUID required on that line. Then I could use:

swapon --show

to show that it was running and see how much of it was being used. As a test I ran exactly the same demanding stuff that had locked me up the first time and this time it ran fine, and when I checked I could see that there was about 430MB in swap.

NAME      TYPE  SIZE USED PRIO
/swapfile file 1024M 432M   -2

update 221218

Bluetooth

This seems to work fine to connect up to my Nokia android smartphone at least. I did have to manually enable Bluetooth:

sudo systemctl start bluetooth
sudo systemctl enable bluetooth

but then I could pair with no issue. I was able to transfer a file and thats probably the only thing I'll use it for.

update 221220

Mouse two finger scroll in Firefox

It wasn't until I found this comment on bugzilla till I could finally slow the touchpad scroll speed in Firefox down to acceptable. Scrolling worked, but it seemed to jump about 5 lines despite whatever I tried setting in about:config. These settings seemed to work:

kinetic_scroll.enabled

to "false" and

mousewheel.default.delta_multiplier_y

set to something below 50 (initially was 100)

Other posts here that mention chromebooks include: