Skip to content

Instantly share code, notes, and snippets.

@sjfricke
Last active December 26, 2023 01:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjfricke/873d1a0c3aa2ef7b9712ac8d1cbdb89f to your computer and use it in GitHub Desktop.
Save sjfricke/873d1a0c3aa2ef7b9712ac8d1cbdb89f to your computer and use it in GitHub Desktop.
Configuring Chromebook for Development

These instructions will not work on Chromebooks with an ARM processor. If you have an ARM processor then you cannot install Chromebrew to get git. You'll need to instead install crouton. Here are instructions that you can follow: https://github.com/macton/arch-linux-install-notes/tree/master/arm-chromebook-chroot

@Note: This is a fork from /erikpmp who has left github, here is a fork I took before thankfully

Configuring Chromebook for Development

After a full Sunday of trial and error, and stepping through many semi-complete or dated blog posts explaining how to do this, I was able to get the Chromebook into developer mode, install git, Node.js, and NPM.

Here's what I did...

  1. Enable Developer Mode
  • Press Esc-Refresh-Power keys which will reboot the Chromebook
  • When the warning screen comes up, press the Ctrl-D keys
  • Confirm you want to turn "OS Verification off" by pressing the Enter key
  • Confirm you want to transition to dev mode by again pressing the Ctrl-D keys
  • The system will reboot and you'll see the "Preparing system for Developer Mode" screen for 3-5 minutes.
  • You'll be greeted with an "OS Verification is OFF" warning screen. This is the warning screen you'll see each time going forward after a reboot. Either wait 10 or so seconds for it to pass and goes into dev mode, or click Ctrl-D to bypass the message and go into dev mode. Pressing the space bar will result in OS verification being turned back on, which means all your dev customizations will be lost and the system will be powerwashed (aka - regressing to the factory reset).
  • Pick your WIFI and login using your Google account
  1. Open CROSH (Chromebook shell)
  • Open CROSH by pressing the Ctrl-Alt-T keys
  • Launch GNU BASH by typing shell
  1. Make the file system writable:
  • sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
  • [BTW: to paste into CROSH or shell use Ctrl-Shirt-v]
  • You'll receive a warning and a 5-second count down. Let it continue until you get the message "Successfully re-signed..."
  • Reboot the Chromebook [hold down the power key until it turns off, then turn press the power key to turn it on]
  • Login as normal
  1. Make rootfs writeable
    • Open CROSH (Ctrl-Alt-T) then BASH (shell)
    • Create a script that, when executed, will make the file system writeable. Type the following...
    • sudo vi /sbin/rw (which will open VIM and create the rw file under the /sbin folder). Now, within VIM press the i key to insert text into VIM and then type out the following script...
      #!/bin/bash
      echo "Making FS Read/Write"
      sudo mount -o remount,rw /
      sudo mount -o remount,exec /mnt/stateful_partition
      sudo mount -i -o remount,exec /home/chronos/user
      echo "You should now have full Read/Write access"
      exit
      
    • Press esc then type :wq in VIM to save the file and quit
    • Back in shell, type sudo chmod a+x /sbin/rw to make the rw file executable
    • Now execute the rw file by typing sudo rw. You'll need execute the rw script after after each reboot.
  2. Install Chromebrew (which also installs Ruby and Git)
  • wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | bash
  1. Download Node.js
  • Navigate to nodejs.org
  • Download the most recent "Mature and Dependable" version (for Linux x64, which the webpage should auto-recognize). The file downloads to the Downloads folder.
  • Extract the tar. In shell, navigate to the Downloads folder and run the following command, tar -xf node-v4.3.1-linux-x64.tar.xz (changing the file name to be what you downloaded from nodejs.org)
  1. Move the files out of the download folder and rename the folder to a simply nodejs
  • Back in shell, type mv ~/Downloads/node-v4.2.4-linux-x64 ~/nodejs (Note: change the source directory name as needed)
  1. Make Node.js executable
  • cd ~/nodejs/bin
  • sudo chmod +x node
  1. Link the node binary. This enables you to execute the node command from any directory
  • In shell, type sudo ln -sf /home/chronos/user/nodejs/bin/node /usr/bin/node
  • Type node --version to confirm NodeJs is installed properly
  1. Install NPM (it doesn't come with the Linux distro of Node)
  • curl -L https://npmjs.org/install.sh | sh
  1. Link the NPM binary
  • In shell, type sudo ln -sf /home/chronos/user/nodejs/bin/npm /usr/bin/npm
  • Type npm --version to confirm NPM is installed properly

Optional:

  1. Install Grunt
  • In shell, type npm install -g grunt-cli. That will install Grunt, but you cannot access the global NPM module until you link it.
  • In shell, type sudo ln -sf /home/chronos/user/nodejs/bin/grunt /usr/bin/grunt
  • Type grunt --version to confirm Grunt is installed properly
  1. Install MongoDB (although you could just use a sandbox DB on mlab.com for free)
  • Go to https://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux, hereafter referred to as Mongo Webpage
  • Under Download the binary files for the desired release of MongoDB, copy the curl command.
  • In shell, cd ~/Downloads
  • Execute the curl command copied from Mongo Webpage. That will download the tar to the Downloads folder.
  • Extract the tar by running the step #2 from the Mongo Webpage
  • Move mongo to the home directory and rename it. mv ~/Downloads/mongodb-linux-x86_64-3.2.3 ~/mongodb (rename source folder name as needed)
  • Symlink: sudo ln -sf /home/chronos/user/mongodb/bin/node /usr/bin/node
  • Type mongo --version to confirm mongo is installed properly 13(b). TODO: dump and restore a DB.

Revision Log

  • 1/4/2016 - created
  • 1/17/2016 - updated when I had my Chromebook got accidentially slicked and I had to reset dev mode
  • 2/16/2016 - noticed a few minor missing steps
  • 2/18/2016 - replaced the untarring instructions so that you untar using a linux command
  • 2/22/2016 - added grunt installation instructions
  • 2/25/2016 - added mongo installation instructions
  • 8/12/2018 - Fork of gist uploaded from https://gist.github.com/erikpmp/e4cf127d6c67734d286b

Sources

Listed in order of primary sources first...

  1. Stephen T. Cannon; Chromebooks Ain't Fer Grandmas!
  2. Poking around your Chrome OS Device
  3. https://gist.githubusercontent.com/dshaw/1ab7e70af96d56ea080c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment