-
Notifications
You must be signed in to change notification settings - Fork 275
Coder on a Chromebook with Crouton
Caution: I've only started experimenting with this, so it's completely untested. This presumes you're okay with putting your Chromebook into dev mode, which will reformat your device and wipe away any data you have locally stored on it. Proceed at your own risk.
Older devices need a small hidden switch to be flipped. details here
On newer Chromebooks, you hit Esc-Refresh-Power and then type Ctrl-D at the recovery screen. details here
Crouton is a way of running a full version of Ubuntu on your Chromebook at the same time Chrome OS is running. It installs the Ubuntu files in a chroot, which you can enter and exit. Inside the chroot, your terminal acts just like an Ubuntu box, and from there you can launch the Coder server.
Details are here, but here's the quick version.
-
Download http://goo.gl/fd3zc
-
Ctrl-Alt-T
to get a terminal. Then typeshell
to get to a shell prompt. -
sudo sh -e ~/Downloads/crouton -t cli-extra
This will take a while to run while it installs all the Ubuntu packages.
-
It will ask for a user/pass for your new chroot instance. I'm using
coder
, so you'll see some references to that in this howto. Modify as needed. -
Enter your new Ubuntu instance with
sudo enter-chroot
You're now logged in as the coder user in your Ubuntu chroot.
-
Enter your Ubuntu chroot, if you haven't already:
sudo enter-chroot
-
Install node.js, npm, git, and some other dev essentials.
sudo apt-get install nodejs npm git build-essential redis-server g++ zip nano vim
This is also a good time to your favorite editor like nano or vim. ;)
-
As the coder user, clone the Coder files from git into the coder-dist folder within your home directory:
cd ~/
git clone https://github.com/googlecreativelab/coder.git coder-dist
-
Install Coder's required node packages:
cd ~/coder-dist/coder-base/
npm install
-
Install all the core coder apps into the coder application directory:
cd ~/coder-dist/coder-apps/
./install_common.sh ../coder-base/
You will see some errors here about not being able to stat a media directory. You can ignore that.
There's a pre-made config file and a special server for running Coder on localhost without https. It's a good way to get up and running with a local development environment.
-
Replace the default config with the localhost version:
cd ~/coder-dist/coder-base/
cp config.js.localhost config.js
-
Launch the coder localhost daemon.
node localserver.js
-
Test it! Make a new tab and go to http://localhost:8080
When you're done, you can kill the server by hitting Ctrl-C in your terminal window.
The Coder server won't start up automatically. You'll have to launch it from the command line when you first log into your Chromebook. On the bright side, it's easier to see debug logs from the node daemon this way.
-
Ctrl-Alt-T
to make a terminal tab. -
sudo enter-chroot
to start and connect to your Ubuntu instance. -
Finally, launch the server:
cd ~/coder-dist/coder-base/
node localserver.js