# A Linux laptop on Chromebook for my student

2022-11-08

Recently one of my students came up to me and talked to me about the difficulty she is having accessing a computer with Processing, which we use in the class I'm teaching. She doesn't have her own computer and she told me she didn't qualify for a school loaner laptop. 

If I found a cheap or free laptop that could be a potential solution. I told her I would look for a laptop and try to locate one within a week. I have a few old Raspberry Pi's around, but that wasn't the right fit. I asked friends for suggestions, and I received a suggestion to look in local thrift stores for old Chromebooks. Unfortunately, that's not really a viable option in NYC. There are few thrift stores around, and those that do generally do not sell electronics, much less old Chromebooks.

But Craigslist is thriving here, and I saw a variety of cheap Chromebooks for sale. Would they be powerful enough to run Processing? I looked online. It looked like it was very possible if I could boot into a Debian-based distro, but it was not definitive. There were some listed options for using a chroot to run Ubuntu, but it appeared slow and everything was years old. I wasn't sure the current state. I also saw a variety of difficult options for installing Ubuntu (or another *buntu on top of ChromeOS). 

How hard could it be? I was particularly interested in showing my student how easy it is to install Linux and how easy it is to use. Ideally it should only take 20 minutes to make a USB drive iso and then boot from that drive and install a light Ubuntu variant, right? 

With a little searching I wasn't filled with confidence as it was immediately clear you can't just flash an ISO to a USB, launch an installer and call it a day. No. For this reason, I decided to install it myself in case I got stuck for hours or days in the process.

Here's my convoluted process.

## Acquire laptop

I write an email at 11pm to an ad on Craigslist listing a Chromebook for $50. The person responds several minutes later. We agree to meet Monday at 9am at the main train station next to the clock tower. Things are looking up. Monday morning rolls around. He's running a few minutes late but that's okay. I find him and he tells me the battery is dead but he just erased the computer. I make a split second judgement to trust him. I have 3 twenties. I could go buy a coffee I guess though I don't really drink coffee. No matter, he takes $40. Great! In a second he's gone. I jump on a subway to go home.

## Things that need to happen

I read 30+ websites and fora trying to come up with a plan. It looks like years ago it was pretty easy to flash Ubuntu and there were many options. Now Google has really locked down the computer. The main approach is to:

* Turn on insecure legacy boot
* Update firmware
* Other stuff
* Profit?

## Steps

Start up the Chromebook and connect to WIFI.

I have a Samsung Chromebook 3 which comes withe Braswell firmware. When I looked it up, I read it must be updated.

## Failure to turn off write protection 

I need to open the back of the computer up to remove a hidden screw in a complicated position that could majorly mess things up if I screw up. The screw is responsible for ensuring Write Protection of the firmware. But I need to turn this off if I want to install a new firmware and new OS on top of the old, or so I believe. I have one mini screwdriver but I need two different sizes and so I can't take the back off. Am I dead in the water?

=> https://maxwyb.github.io/linux/2016/11/05/chromebook-write-protection.html Screws on the back of the Chromebook 3

I rack my brain and decide I will try to run Linux off an external drive and see if that's viable.

## Turn off secureboot So we can boot off a USB

Procedure:

1. Enable developer mode
2. Turn off verified boot
3. Enable dev usb boot

Details:

### Boot into recovery mode

Press Escape + Refresh key (3 buttons to the right of escape) + Power button. Let go of power and it'll start up in Recovery Mode.

When it starts up it tells me to insert a USB. Nah, not yet. Press Ctrl-D to turn off verified boot. Wait 10 seconds and when prompted I press enter. It'll reboot and asks me to hit enter again to confirm. I make sure it says OS Verification is OFF. Press Ctrl-D again. It begins reflashing my drive and booting into developer mode. It takes about 5 minutes.

### Enable Dev usb boot

Eventually it starts back up and I see the traditional welcome screen on ChromeOS. I skipped signing in and clicked Sign in as Guest in the bottom left so I don't need to make a Google account. 

When I finally get into the desktop environment I open the Terminal with Ctrl-Alt-T. 

I type shell and enter to get a Linux command line.

I switch to bash with root privileges to make changes to booting by typing sudo bash and hitting enter.

I get the typical warning about sudo 'with great power comes great responsibility' mumbo jumbo. I type enable_dev_usb_boot and enter. A success message appears.

### Set up dev boot legacy

I open the terminal with Ctrl-Alt-F2 (right arrow). I login to 'chronos'. No password. I type sudo crossystem dev_boot_legacy=1 and then my prompt. First weird thing occurs. The prompt tells me instead to try dev_boot_altfw instead. Hmm. I run sudo crossystem dev_boot_altfw=1 and get no error so maybe this is alternative firmware and it worked?

### Update firmware

I'm on a Samsung Chromebook 3 which runs Intel Braswell, so I saw it needed its firmware updated. I ran the update firmware automation script from mrchromebook.tech.

```
cd; curl -LO mrchromebox.tech/firmware-util.sh
sudo install -Dt /usr/local/bin -m 755 firmware-util.sh
sudo firmware-util.sh
```

This brings up a menu.

I tried to select 2 Install/Update UEFI Firmware but I couldn't because WriteProtect was enabled since I wasn't able to take off the back of the machine to remove a screw. But I could do 1) and update the current Legacy BIOS firmware.

## Make a flash drive iso

I downloaded a GalliumOS iso even though it's not maintained anymore. I had been thinking I'd download Lubuntu but against my better judgement I decided to try Gallium since it was built specifically for Chromebook. I used Balena Etcher to write the iso to USB.

=> https://galliumos.org/ GalliumOS (not maintained)

### Start up with your USB drive loaded with linux

Once written to disk, I plugged in the USB drive to the Chromebook and start up in recovery mode by pressing Escape + Refresh + Power to start up. 

Press Ctrl-U to start from the USB. Or was it Ctrl-L?

It starts up and I run the installer, which is self-explanatory like picking keyboard, city and the like. It takes just a few minutes. I shut down and remove the USB installer. Fingers crossed....

## Startup

=> images/chromebook.gif Chromebook booting GalliumOS, displaying Processing, dithered image 

It works! Even despite not turning off WriteProtect? Hmm. Not sure. But I'll go with it since it's working.
 
Each time the computer is turned on we need to run Ctrl-L to escape the regular startup process and boot into Gallium.

Once it's started, I have a really nice looking desktop and the machine (despite being pretty low power) is fast! I opened up the terminal and sudo apt updated and sudo apt upgraded. Then I tried out the package manager App Grid Software Center and installed LibreOffice, Solitaire, Tetris and some other software for my student. There was already a variety of basic apps for playing music, displaying images, file manager, etc. I visited the Processing website and downloaded the latest version, 4.0.1 and downloaded it. I used tar to uncompress and then ran the bash installer file. This installed Processing to the desktop and placed its icon in the launcher menu under Development. I wrote a basic Processing Hello World program, tested it ran, and saved it.

Lastly, I downloaded a picture of my college and set it as the desktop background. 

I'm excited to introduce this machine to my student. And to see what she does with it. I hope it will be useful for her classes, browsing the web, doing homework and practicing coding in Processing. If I get any feedback from her, I'll report back further.


=> ./index.gmi Back to index

### Resources

=> https://mrchromebox.tech/#fwscript mrchromebox.tech site and firmware flashing utilities script
=> https://chromeready.com/7065/boot-from-a-bootable-usb-drive-on-chromebook/ Instructions on making your chromebook be able to load a distro off a USB


---

Leave a comment by emailing lettuce at the current domain and putting comment and the title of this post in the subject. You can also mention what name you'd like listed.
