The Compendium · Chapter 13 of 20

Installing Brunch/chromeOS

12 min read · 2 sections

Later MacBook Pros do not have an SD card slot and while there are multiple USB-C ports on most models, there aren’t any ultra small USB drives on the market, especially not ones that are flush with the sides, ideally about this size, but with actual storage capability . . . not just a crypto key.  This is the closest thing we can find, but it’s not totally flush, and we’re in the process of testing it.  Therefore, the optimal way to get chromeOS running is through a special framework called “Brunch,” which was developed by someone going by the name Sebanc and then fine-tuned for T-chip Macs by ZProLegend007.  Be sure to thank them both!

The process involves first installing the framework and then installing chromeOS, all within Linux.  Though it can also be done with Windows, we just think it’s easier with Linux, especially because of the post-installation process during which we configure the bootloader to but directly in rEFInd.  Much of the Brunch/chromeOS installation guidance was pulled from here, but it’s cleaned up below for ease of following.

Step 7a: Prepare Brunch/chromeOS and the partition

  • Boot into Linux
  • If on non-T-chip Macs, go to the Brunch Releases Tab and download the latest tar.gz file
    • There should be a note as to which chromeOS image is required
  • If on a T-chip Mac, go to the ZProLegend007’s T2 fork here
    • Download the last stable release - 120.2 (as of 05/01/24)
  • Regardless of the T-chip, go to a chromeOS image repository and find the appropriate build
    • Cros.tech has them linked in a dropdown here
    • Or you can go straight to the source and search for “jinlon”
    • Then find the latest stable build that corresponds with the Brunch build number or close thereto
      • Note: the numbers might not match up, but will be close – Brunch 117 and chromeOS 118, for instance.
  • Prepare Linux Terminal by installing the pv, cgpt, tar and unzip protocols
    • Type “sudo apt update && sudo apt -y install pv cgpt tar unzip” and hit “Enter”
    • The above uses apt, a package manager for Debian and Ubuntu based distros. If you use Arch, you will need vboot-utils for access to cgpt and a different package manager may be needed to install the rest
    • Some Linux releases (such as Ubuntu 23.04) may require the universe repo to install some of the above dependencies. If you get any errors about a dependency being unavailable, add the universe repo with this command, and then try the previous step again afterwards
      • Type “sudo add-apt-repository universe” and hit “Enter”
  • After all protocol dependencies have been installed, “cd” into the directory where your files were downloaded; for most users this will be “Downloads”.
    • Type “cd ~/Downloads” and hit “Enter”
  • Extract the Brunch archive using tar
    • (In Ubuntu you can just double click the file)
    • Type “tar zxvf ” including the space
  • Select and drag the “brunch_filename.tar.gz” file into Terminal
    • Delete everything before the “brunch_filename.tar.gz” file and hit “Enter”
    • Once completed, there will be 4 new files from the brunch archive and a recovery bin from the chromeOS image in your Downloads folder.  Create a folder named “Brunch” and drag these files into it.
  • Extract the chromeOS recovery using unzip
    • Type “unzip ” including the space
  • Select and drag the “chromeos_filename.bin.zip” into Terminal
    • Delete everything before “chromeos_filename.bin.zip” file and hit “Enter”
    • Move the chromeOS bn file to the “Brunch” folder as well
  • Open the Snapd store (if you installed it) or type “sudo apt-get install gparted” in Terminal and install gParted
  • Open gParted and select the area of your internal disk to the right of your Linux partition, which should be free, unformatted space
    • Add a new partition, size it according to your preference (keeping space constraints in mind (you’ll want space for a shared storage partition as well, where you’ll store virtual machines among other things)), and format it as ext4
  • Open Terminal and type:
    • “lsblk -e7” and hit “Enter”
  • You should see your newly created partition (nvme0n1p5) appear (in the sidebar in Ubuntu)
  • Then type:
    • “mkdir -p ~/tmpmount” and hit “Enter”
  • Then type:
    • “sudo mount /dev/nvme0n1p5 ~/tmpmount” and hit “Enter”

NOTE: simply clicking on the partition that shows up in the sidebar after creating nvme0n1p5 will not suffice; it has to be mounted in this fashion

  • Then type:
    • “cd ” including the space
  • Select and drag the “Brunch” folder from your Downloads into Terminal; the command should read something like:
    • “cd ‘/home/username/Downloads/Brunch’”
  • Then type:
    • “sudo bash chromeos-install.sh -src ” including the space
  • Select and drag the “chromeos_filename.bin” from the Brunch folder into Terminal
    • Delete the filepath before the “chromeos_filename.bin” file and type “-dst ” including the space
  • Select and drag the tmpmount folder from you Home folder into Terminal, so that it completes the “/path/to/chromeos.img ” including the space
    • Then type “/chromeos.img -s ###” (the “###” indicates the size of the img file; keep in mind it has to be a whole number and smaller than the fifth partition; for example, if you want a 128GB chromeOS img file, you can put “128,” but you better have made the partition at least 135GB in the steps above, otherwise the install will fail with a sizing error
  • The final command should look something like this:
    • “sudo bash chromeos-install.sh -src chromeos_filename.bin -dst /home/username/tmpmount/chromeos.img -s ###”
  • Hit “Enter”
    • If you get an error regarding limited space, lower size by one and try again
  • If space is not an issue, the script will ask for confirmation; if you're ready to install, type “Yes” into the prompt and hit “Enter”

The installation may take some time depending on the speed of your target disk, please be patient.  There may be a couple of GPT Header errors, which can be safely ignored.  The installation will report that chromeOS was installed when it is finished. Before continuing, make sure that there are no additional errors in the terminal. If there are no errors, then you are good to continue by following the instructions in Terminal.

These next set of instructions may not be needed, as we will be setting Brunch/chromeOS to boot directly from rEFInd.  These instructions may actually be what causes Linux’s grub to not work as before.

  • Copy the lines of code looking something like this:
    • “sudo cat /etc/grub.d/40_custom /home/startsquad/tmpmount//chromeos.img.grub.txt | sudo tee /etc/grub.d/99_brunch; sudo chmod 0755 /etc/grub.d/99_brunch; sudo grub-mkconfig -o /boot/grub/grub.cfg”
  • Paste them into Terminal and hit “Enter”
    • Type “sudo update-grub” and hit “Enter”

You now have Brunch/chromeOS installed; however, it won’t look that way in rEFInd – there will still only be three icons – Windows, Linux, and Apple.  The only way to boot Brunch/chromeOS at this point is to select the Linux icon, then arrow down to “Brunch” in a new grub menu and hit “Enter.”  Sometimes, rEFInd is configured in a way to where you won’t even see the grub menu though.  Thankfully, there is a fix.

This is the only part of this guide that comes purely from Think quadratic. and honestly, while this process could probably be turned into a script, which could run during Brunch/chromeOS’ installation, we haven’t the expertise to make that happen.  It is on the list of improvements for the future though and we’d be grateful for any assistance.  In the meantime, this may be the most difficult part of this guide, but it is worth it to be able to boot all four OS’s directly from rEFInd and have a Quadruple-Booting machine.

Step 7a Continued: Boot Brunch/chromeOS Directly from rEFInd

Open up the Brunch/chromeOS partition and double click the “chromeos.img” file to mount it. Linux should notify you when each partition within the image is mounted; chromeOS has multiple partitions of its own, four or five of which will mount. Now, we’re going to create and/or move files on four different partitions, some visible and some not. For those who don't need the step-by-step, take a Quick Look at the image below for an overview of what needs to be done.

That's main disk EFI in top left, chromeos.img efi in top right, Brunch/chromeOS partition in bottom left, and Root-C from chromeos.img in bottom right, with most of the files being created or moved pointing to the Brunch/Chromeos partition. For the more kinesthetic people out there, or if you just like the nitty gritty details, no worries, a thorough step-by-step is below. It still helps to organize your Files windows in a visually methodical way, like above. To better understand the process, let's start by listing all the partitions on your disk, including the invisible ones. So…

  • Open Terminal and type:
    • “lsblk” and hit “Enter”

You’re going to see “loop” followed by a sequential number a lot. How many times depends on how many apps you've installed on Linux and/or how many other images you have open. But the last "loop" will repeat a number and have a “p” followed by another set of sequential numbers. This is the chromeos.img file as a virtually mounted disk.

The 12th one (loop##p12) is the chromeos.img's EFI partition. Files on that partition tell the system to go to “Root-C” (loop##p7) to find the kernel for chromeOS. Further down the list, you’ll see nvme0n1 or sda0 – the primary drive. We’re going to mimic how your Linux OS boots off of the primary EFI (nvme0n1p1 or sda1) and Linux partition (nvme0n1p4 or sdaX; the "X" being the nth partition where you installed Brunch/chromeOS) on the primary drive. To begin...

  • Type “sudo mkdir ~/ESP” and hit "Enter"
  • Type your password and hit “Enter”
  • Type “sudo mount /dev/nvme0n1p1 ~/ESP” (or sda1 instead of nvme0n1p1)

You won’t receive any messages about the drive successfully mounting; and in Ubuntu, if you open a Files window and simply click on the mounted partition in the sidebar, you’ll get an error. But if you click on “+ Other Locations,” “ESP” will appear at the bottom of another list of mounted partitions.

  • Double click on the “ESP” folder in “+ Other Locations”
    • You will have to enter your password at least once, maybe twice, and you may have to again when you actually move/create files.
    • Keep this Files window (ESP) in the top left corner of the screen
  • Open the EFI folder inside ESP
    • Create a new folder and call it “chromeos”
    • Open the folder of your Linux OS (Ubuntu creates an “ubuntu” folder, for instance)
      • Right click on and copy the “grub.cfg” file
    • Back out of that folder and go into the “chromeos” folder you just created
      • Paste in the “grub.cfg” file and then open it

First thing we need to change is the long chain of letters and numbers making up the “uuid,” but first we have to find the correct uuid of the target partition, the one with Brunch/chromeOS.

  • Go back to Terminal
    • Type “sudo blkid /dev/nvme0n1p5” (or sdaX) and hit “Enter”
    • Type your password and hit “Enter”

You’ll see two possible uuids. We want the one with “UUID” before it, not “PARTUUID” before it. Should be the first one.

  • Copy that first UUID
  • Go back the “grub,cfg” file
    • Paste the UUID in place of the existing uuid in the "grub-cfg" file (be careful to paste correctly)
    • Remove “/grub” on the next line (be sure to leave the apostrophes)
    • Close the file (entering password to save it)

Now you need to mount the virtual EFI partition from the mounted chromeos.img file.

  • Go back to Terminal
    • Type “sudo mkdir ~/ESP2” and hit "Enter"
    • Type your password and hit “Enter”
    • Type “sudo mount /dev/loopXXp12 ~/ESP2” (the “XX” depends on what you determined from "lsblk" command earlier)

Unlike before, you’ll get a message that the partition was mounted, but as “read-only.” That’s OK. Like before, you will have to open the mounted partition from the “+ Other Locations” section of the Files window. From the first Files window (in the top left corner), click the “hamburger” icon and select the “New Window” option.

  • Find “ESP2” in “+ Other Locations,” double click it
    • Put in your password once, maybe twice
    • Place the window in the top right corner of the screen.
  • Open the “EFI” folder inside ESP2
    • Open the “boot” folder
    • Select everything EXCEPT the “grub.cfg” file and drag it into the “chromeos” folder you created in “ESP/EFI” earlier (top left window)

We are finished with creating/moving files on the EFI partitions, but don’t close the Files windows yet. We still need to open two more windows, but we won’t need Terminal to do so.

  • Open a new Files window and navigate to the Brunch/chromeOS partition (accessible from the sidebar in Ubuntu)
    • Drag this window to the bottom left of your screen
    • Create a folder named “boot and then open it
  • Open another Files window and navigate to the virtually mounted “Root-C” partition (easier to find from “+ Other Locations” in Ubuntu)
    • Drag this window to the bottom right of your screen
    • Select and drag everything from “Root-C” (bottom right window) into that newly created “boot” folder (bottom left window)
  • Select and drag the “grub.cfg” file from the chromeos.img efi partition (top right window) into that same “boot” folder (bottom left window)
  • Open the “boot” folder and then open that “grub.cfg” file
    • Leave the top four lines alone for now (you can change the timeout later; see note at end)
  • Go back to the Files window for the Brunch/chromeOS partition (bottom left window), where the “boot” folder should still be open, and navigate up one level
    • Open the file named “chromeos.img.grub.txt”
      • Copy everything
  • Go back to editing the “grub.cfg” file and paste over everything starting from “menuentry” down to the end
    • Remove the lines that read “rmmod tpm” from the menu entries (second line for both entries)

Note: The 2 second timeout in the "grub.cfg" file just above is necessary on the first boot so that you can select the “Brunch settings” option. This is required to patch the Brunch framework according to your hardware before first boot into Brunch/chromeOS. Once you’ve done this, you can edit the "grub.cfg" file to boot Brunch/chromeOS right away by setting that number to “0”.

  • Close both files, being sure to save the “grub.cfg” file

That’s it. No need to unmount any of the partitions.  However, you may wish to clean up your Linux’s grub menu, removing the “Brunch” and “Brunch settings” menu entries, since you can now boot Brunch/chromeOS directly.

  • If you have Grub Customizer installed already, simply open it; if not:
    • Open Terminal and type
      • “sudo add-apt-repository ppa:danielrichter2007/grub-customizer” and hit “Enter”
    • Then type “sudo apt-get update” and hit “Enter”
    • Type “sudo apt install grub-customizer” and hit “Enter”
  • A new "Grub-Customizer" snap will appear in your “Activities” menu; open it
    • Remove the "Brunch" and “Brunch settings” options
    • On the next tab, set the default bootloader to your Linux OS
    • Set the time to “0” and turn off “Look for other OS’s”
    • Click the “Save” button in the upper left
    • Wait for the progress bar to complete
  • Close Grub-Customizer

You can simply reboot and test out your directly booting Brunch/chromeOS partition.  Be sure to select the “Brunch Settings” option for your first boot, as this allows you to implement important features, particularly the ability for chromeOS to read the other internal partitions and external drives.