This how I set up my chromebook, I do some development work, mainly front end and quantitative programming. I share this because some of it is hard to find out. This page owes a lot to a sources, I mention them in the text. All the work on crouton is borowed from David Schneider, but there other sources as well.
Go into developer modeDepends on the machine on the Asus chromebox depress the reset button (next to the Kensignton lock) and the start the machine, nex release the reset button. After that pres Ctrl-D at the prompt (there is no hint on the screen). A good source for developer mode is: http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
Install the crouton extensionCrouton is an easy way to get access to a full linux setup on your chromebook, you will find everything you need here: https://github.com/dnschneid/crouton
First install the crouton extension, this is for integration with your browser. You can get it by this link: crouton extension.
Setup croutonDownload crouton (it is a script). You can get it here: https://goo.gl/fd3zc
Install crouton via these commands:
shell sudo sh ~/Downloads/crouton -r trusty -t core,xiwi,keyboard,x11,cli-extra,extension,
After it runs you can enter the chroot with sudo enter-chroot, this will get you into Ubuntu.
audio,chrome,xorg //add ,xfce if you want a desktop
Setup software in UbuntuThis section is borrowed from this website: https://medium.com/@martinmalinda/ultimate-guide-for-web-development-on-chromebook-part-1-crouton-2ec2e6bb2a2d#.mdjctop47 however the setup for nodejs is not functional if you want to use gulp. I have changed that section in the part below.
This part of the set up is done in the chroot, see above.
You may, of course choose, what you want to install, this is just what I figured out and wanted to share.
Using version control is quite essential.
sudo apt-get install git
NPM + NodeJS
Check your version with node -v, you can check you have the most recent on NodeJS.org.
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
For other nodejs versions, for example 0.12 use in stead:
curl -L http://deb.nodesource.com/setup_0.12 | sudo bash -
and then to compile and install native addons from npm you may also need to install build tools:
sudo apt-get install nodejs
To be able to install packages into global directory, we need to move it under home:
sudo apt-get install -y build-essential
npm config set prefix '~/.npm-packages' echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> ~/.bashrc //this should work now: npm install -g bower grunt gulp ember-cli babel
Web starter kitThis is not really software the web starter kit from github on google/web-starter-kit is a template for web (apps). The dowload version of 0.6.3 does not seem to work well the cloned version does.
I found gulp with web starter kit (from google) does not run well with the latest gulp (3.9.1) so you may want to downgrade to 3.9.0. with
This is a solution from Yeoman, see http://stackoverflow.com/questions/35832739/error-with-gulp-serve-requiring-external-module-babel-register/36475122#36475122
npm install -g firstname.lastname@example.org
Sublime Text 3Sublime is very popular, I am not a fan, I prefer Zed, a native app for chrome, you can get it here: https://chrome.google.com/webstore/detail/zed-code-editor/pfmjnmeipppmcebplngmhfkleiinphhp?utm_source=chrome-app-launcher
For sublime follow this section.
At this it is reccomend installing Nautilus (a file browser) to get full support of gtk windowing system. Sublime fails to launch without it and on top of it, you get a GUI for file browsing. That maye be handy sometimes.
sudo apt-get install software-properties-common python-software-properties -y sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt-get install sublime-text-installer
Now you can launch Sublime with:
sudo apt-get install nautilus
xiwi -t subl
You can now launch terminator in a window with:
sudo apt-get install terminator
sudo xiwi -t terminator
Set up for virtual boxYou may also want to run virtual box. I took these from the ubuntu/debian ppa for chromebook kernel headers. You can find it here: https://github.com/divx118/crouton-packages
- Kernel 3.4.0 Architecture arm, i386 and am64 ==> These all need
- Kernel 3.8.11 Architecture arm, i386 and am64 ==> amd64 is
tested. i386 and arm needs testing.
- Kernel 3.10.18 Architecture arm
and amd64 ==> amd64 is tested. i386 and arm needs testing.
Open a crosh shell and follow on screen instructions:
When running sudo
cd ~/Downloads wget https://raw.githubusercontent.com/divx118/crouton-packages/master/change-kernel-flags) sudo sh ~/Downloads/change-kernel-flags
sh ~/Downloads/change-kernel-flags -hit will give you the usage. You may want to revert the changes so put save a backup kernel use -r:
Note: You will need to repeat the above steps after each chromeos update.
sudo sh ~/Downloads/change-kernel-flags -r
The following is done only once. Open a shell in your chroot:
This script will: add a signing key with which the packages are signed, add the ppa to the sources.list.d install linux-headers-, install linux-image-, add a rc.local script to load vboxdrv modules on entering the chroot if they are available.
cd ~ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh sudo sh setup-headers.sh
Kernel headers are build according to this guide https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86) kernel headers for arm are cross compiled.
Now go ahead and install virtual box
sudo apt-get install virtualbox
Install RstudioRStudio needs the latest r-base, not standard available in the ubuntu packages, so you need to add sources first. This method will use the latest development version of R-base from Michael Rutter.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 // wil add a key to your keyring
sudo add-apt-repository ppa:marutter/rdev
If you are met with the message: sudo: add-apt-repository: command not found.
You can install it with
sudo apt-get install software-properties-common
After which you have r-base installed. You can now install R-studio if you like, download it from the Rstudio website and install using the debian package installer (in the GUI) if you have chosen the *.deb version.
sudo apt-get update sudo apt-get upgrade sudo apt-get install r-base
AliasesAliases can save you a lot of time and energy. In your .bashrc add some lines, here is a few I use very frequently:
There is also one handy alias that can allow you to get into chroot a bit faster. It has to be stored in .bashrc outside chroot:
alias cdd="cd ~/Downloads" alias x="xiwi -t" alias xw="xiwi -w"
And then leave chroot, and move it to the chronos home .bashrc:
echo 'alias ec="sudo enter-chroot"' >> ~/Downloads/.bashrc
If you have just added these you need run
logout cat ~/Downloads/.bashrc >> ~/.bashrc
source .bashrcto activate them.
Setup autostart on ChromebookMove your crouton script and the backup into the Downloads directory on the machine (as well as all the keys and stuff). Specifically include crouton crouton.init crouton.conf and rw-rootfs.
After reboot run the file rw-rootfs (this is a script < see https://github.com/dnschneid/crouton/wiki/Autostart-crouton-chroot-at-ChromeOS-startup )
Run this file in the shell (not in the chroot)
sudo sh ~/Downloads/rw-rootfs
It will reboot.
Next copy the crouton.conf file to /etc/init with this:
Reboot and it will work. I use this to enter-chroot on startup
`sudo cp ~/Downloads/crouton.conf /etc/init/`
Backup and restore chrootTo backup your chroot use:
sudo edit-chroot -b nameofchroot
To restore use
sudo edit-chroot -r nameofchroot
You can delete a chroot by
sudo edit-chroot -d evilchroot
In the event that you want to restore a backup to a stock chromebook (with developer mode enabled) you can use the crouton installer with the -f option specifying the backup’s tarball, e.g.,
sudo sh -e crouton -r raring -f /media/removable/SD\ Card/backup/raring-20130617-1234.tar.gz
Update the softwareWhen a new version of your chroot comes out you may want to upgrade.
Check for updates, download the latest version, and see what’s new by running
croutonversion -u -d -cfrom the chroot (run
croutonversion -hto see what those parameters actually do).
Exit the chroot and run
sudo sh ~/Downloads/crouton -u -n chrootname. It will update all installed targets.
After an update of chomeos doIf you have virtual box installed, rerun the script to change the kernel flags. Open a crosh shell and follow on-screen instructions:
sudo sh ~/Downloads/change-kernel-flags
If you have set up autostart, rerun the file to make root writable this in the shell (not in the chroot)
sudo sh ~/Downloads/rw-rootfs. It will reboot.
Next copy the crouton.conf file to /etc/init with this:
sudo cp ~/Downloads/crouton.conf /etc/init/if you have set up autostart.