Skip to content

(CIF001) Get back your sudo in crosh by installing Chromebrew

CroutonIsFun edited this page May 11, 2024 · 1 revision

Preliminaries

First, backup anything you want to keep. And before continuing on this journey, hop over to VT-2, login as chronos, and clean up any corrupted chroots, or any which didn't install properly, with sudo delete-chroot -a

Next, prepare the local data are for Chromebrew, with sudo rm -r /usr/local/* (if you don't do this, Chromebrew will ask you).

Install Chromebrew

Copy and paste these aliases into ~/.bashrc:

alias InstallCrouton="sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton"
alias Crouton="sudo CROUTON_BRANCH=silence /usr/local/bin/crouton"
alias ChromebrewInstall="bash <(curl -L git.io/vddgY) && . /.bashrc"
alias LegacyBoot="cd; curl -LO mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh"

The .bashrc file can be edited with vi ~/.bashrc in the crosh shell.

Copy the above commands into the space below # Put your fun stuff here

Log out of the crosh shell with ctrl-d. Type "shell" and press Enter. Now zoom over to VT-2 (ctrl-alt-f2) and login as chronos. Start typing the command ChromebrewInstall. After the first 3 or 4 characters, you can press tab to autocomplete. Press Enter to activate the install: it takes about 10-15 minutes depending on your Internet connection.

After Chromebrew install completes, log out of VT-2 with ctrl-d, and return to the main screen with ctrl-alt-f1.

Now, at the crosh shell, type the command, crew install crew_sudo

After crew_sudo installs, flip back over to VT-2 and login as chronos. This will autostart the daemon which allows you to use sudo in the crosh shell. Every time you boot up, you need to login as chronos in VT-2 to autostart the daemon. Then you can log out of VT-2 with ctrl-d, and flip back to the main screen with ctrl-alt-f1.

The aliases include commands to help you install and use crouton:

*The InstallCrouton command makes the crouton script executable after you download it.

*The Crouton command takes care of installing only the silence branch of any chroot. The Crouton command can be used just like the original crouton command, only you don't have to use "sudo" because it's included.

For example: Crouton -t xfce will install the xfce4 desktop using the xenial release. When the downloads complete, you can run the desktop with sudo startxfce4

*The LegacyBoot command is an extra bonus command. It configures your Chromebook to be able to boot off a USB stick, for example, for installing a standard Linux distro to a USB stick, or even the built-in SSD of the Chromebook.

None of the commands require you to type "sudo", as the sudo is built-in to the commands.

Clone this wiki locally