|Left hinge gone, right hinge broken and bezel de-bezeled!|
Unfortunately, it was my one and only lovable laptop. An awesome bulky, heavy, hot runnin' Dell Latitude E5500 with a screamin' install of Ubuntu. It was my work, dev and play deck and it was a goner!
While I waited on replacement hinges, a screen frame and a spare screen (just in case I screwed up the original screen doing the repairs...yeah I repair my own hardware...the OG scrooge mcduck here...), I couldn't help but wonder what might be out on the market in terms of new linux laptops. To my utter dismay nothing very good. Mostly big, bulky, black behemoths and all of them were quite costly.
Having heard a lot of online chatter about Chromebooks, I decided to go take a look. They all looked pretty bad ass. The only problem, Chromebooks run Chrome OS which is a pretty limited cloud based operating system. Or so I thought!
After a little research I had determined that Chrome OS is just Gentoo linux locked down for GrandmaLand. For those that don't know, GrandmaLand is kinda like Userland and Candyland mashed up. It is very limited but chock full of all kind of sweet goodness! I saw a few articles about putting a Chromebook into developer mode and some articles that went even further about putting a Chromebook into the full Gentoo image via dev_install.
These articles had me hook line and sinker! I love a good challenge and I love a good adventure even more! So, in March 23, 2014, I purchased an HP Chromebook 14 for $349.
Check out the specs here. My fav bits are...
- Beautiful 14" display.
- Sleek .81 thin and 4.08.lbs design that is routinely mistaken for an Apple device.
- 9.5 hours of battery life!
- < 7 second boot but you rarely have to turn these things off or reboot them.
- Wifi and 4G LTE. The baked in 4G LTE is rad! I can develop, deploy, work and play ANYWHERE! Hello beach! Hello skate park! Hello anywhere!
Things I was worried about...but then realized...
- 16 GB SSD
- If you need more than 16 GB locally get an SD Card OR use a USB thumb drive.
- Hardware hack and put in a larger SSD if you don't mind voiding your warranty! Future blog post!
- 4 GB RAM
- Should suffice for most uses.
- Hardware hack and put in more RAM if you don't mind voiding your warranty! Future blog post!
Since March 23, 2014 I have used this HP 14 Chromebook as my primary work, play and development machine.
YES, DEVELOPMENT MACHINE!
Chromebooks actually make a nice affordable development machine. There are some interesting advantages like:
- Cheap. If you lose it you aren't out a couple or a few thousand dollars.
- Thin and light and don't run hot.
- Once in developer mode, if you lose the Chromebook and someone boots it they will likely press the space bar on boot which will wipe the drive. Kind of like built in IP protection! More on this later.
Which brings me to my point. Chromebooks are not the student, grandma, casual user computers everyone is being led to believe. Nope, in fact they can make wonderful and powerful development machines.
In fact, I am going to show you how to put your Chromebook in developer mode and setup your development environment for Python, Ruby, Node, Meteor, MongoDB and Java. In another blog post I will explore putting a Chromebook into the full Gentoo image via dev_install and all the goodness that comes from having the Gentoo portage package manager at your disposal!
Step 1 - Make A Recovery Image
The first thing you will want to do is make a recovery image on a USB thumb drive. Make sure the thumb drive is greater than 4 GB. There are a few ways to do this.
Easiest - chrome://imageburner
Before you mess with your Chromebook use the image burner. Open up Chrome and go to chrome://imageburner/
Medium Difficulty - Chrome Recovery Utility
This works from any Chromebook. So, if you totally hose your Chromebook you can do this from any other Chromebook around. Yep, even the ones at Best Buy...trust me! Just go to Use the Chromebook Recovery Utility
Expert Level - Mac or Linux Restore
I have done it this way a couple of times successfully and a few times it didn't work. I have only used the linux instructions because I don't use Crapples. Just check out the Mac or Linux instructions here Restore your Chromebook
Ok, so now if you hose your Chromebook you can always recover it! Hopefully.
Going any further could damage your Chromebook or void your warranty.
They are only a couple hundred to a few hundred dollars so WHO CARES RIGHT?!?!
Step 2 - Putting Your Chromebook Into Developer Mode
First, read Poking around your Chrome OS Device. Device? Yes, device. You can put the beautiful new LG Chromebase (got 2 of these for point of sale systems for my stores) into developer mode or any of the host of the Chrome Boxes (using these are media devices in my home and as primary computers in my store).
Second, read Developer Information for Chrome OS Devices to find specific instructions on how to put your device into developer mode. I have the HP 14 Chromebook and used these instructions which actually lead you to the Acer instructions.
Most Chromebooks can be put into developer mode by pressing ESC-F3 (refresh) and the power button.
|So, tempted to press SPACE. So tempted!|
You will be prompted to turn off Chrome OS verification and might see a screen that looks like this. On most systems you just press CTRL-D to put the device into developer mode. You may see some ASCII notifications about the process at the top of your screen with a percentage or progress type indicator about the process. Every time you reboot you will see this screen.
You have to press CTRL-D to get into the computer. If you press SPACE your device will be power washed and your data wiped clean. Which I think is a nice security feature actually.
Step 3 - Making the Chromebook Useful in Developer Mode
Ok, so now you are in developer mode. Big deal.
First, there are two terminals.
There is VT-2 or virtual terminal. You can get to it through CTRL-ALT- -> (above the #3 on most keyboards). Personally, I don't find this terminal very useful on a day to day basis.
Then there is a terminal command prompt through CROSH (Chrome Shell). Press CTRL-ATL-T to get to CROSH. I don't find CROSH all that useful on a day to day basis but it is the only way to get to a standard terminal interface and BASH. Anyway CROSH looks like this. If you are curious about what commands are available just type help.
Moving on, in CROSH just type shell and you will be greeted with a familiar GNU bash shell with all kinds of goodies. Just type help and take a gander!
|GNU to you too!|
But the Chromebook still isn't that useful. Why? Because the file system is still locked down.
The easiest way to make the file system writable is to use the following command.
sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
You will see something semi-terrifying like...
chronos@localhost / $ sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
! INFO: ALL SANITY CHECKS WERE BYPASSED. YOU ARE ON YOUR OWN. !
Start in 1 second(s) (^C to abort)...
Kernel A: Disabled rootfs verification.
Backup of Kernel A is stored in: /mnt/stateful_partition/backups/kernel_A_20140928_152145.bin
Kernel A: Re-signed with developer keys successfully.
Kernel B: Disabled rootfs verification.
Backup of Kernel B is stored in: /mnt/stateful_partition/backups/kernel_B_20140928_152150.bin
Kernel B: Re-signed with developer keys successfully.
Successfully re-signed 2 of 2 kernel(s) on device /dev/mmcblk0.
WE DON'T NEED NO STINKY SANITY CHECKS!!!
BTW, I have no idea what happens if you press ^C during this process. It says it aborts but who knows what the outcome is.
NOW RE BOOT!!!
- Sometimes you have to use this command after rebooting or applying a chrome update. Chrome updates are not automatic.
- Delete these backups from /mnt/stateful_partition/backups/ otherwise they will eat up drive space. A Chromebook that runs out of drive space is a painful experience.
Finally, it would be nice to easily make all mounts writable. So, do the following.
- Go to CROSH CTRL-ALT-T
- Go to GNU Bash shell by typing shell and type
- sudo su -
- mount -o remount,rw /
- mount -o remount,exec /mnt/stateful_partition
- sudo vi /sbin/rw
Here is the rw script
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"
Make sure you make the script executable.
sudo chmod a+x /sbin/rw
Now on most reboots and most Chrome OS updates you can just type sudo rw to make your system read write!
sudo chmod a+x /sbin/rw
Now on most reboots and most Chrome OS updates you can just type sudo rw to make your system read write!
Now you can really do ANYTHING!
Step 4 - Setting Up Your Development Environment
Chromebrew aka crew
Chromebrew is to Chrome what Homebrew is to Crapples! Well not exactly, it doesn't quite build packages locally but it does help you do some heavy lifting.
So, if you want a fast way to get things like binutils, buildessentials, curl, gcc, git, glibc, linuxheaders, libssh2, make, perl, python, ruby, vim and zlibpkg among a host of other important linux packages then install Chromebrew.
Here is how you can install it.
- Chromebrew the missing package manager for Chrome OS page
- or wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | bash.
- From there you can search and install packages or update crew itself!
- Or view the packages on github.
Crew alone gets you perl, python, ruby and even node.
Though many times I install node on my own so that I can control the version and there are instructions below.
See Chromebrew above duh!
Node & npm
- Get whatever version of node you want at http://nodejs.org/dist/
- For example: wget http://nodejs.org/dist/v0.10.31/node-v0.10.31-linux-x64.tar.gz
- Untar it to ~/ and then rename the directory if you want to. I rename mine to ~/node
- Link up your binaries like so
- sudo ln -sf /home/chronos/user/nodejs/bin/node /usr/bin/node
- sudo ln -sf /home/chronos/user/nodejs/bin/npm /usr/bin/npm
Change npm prefix config so npm installs packages outside of root. Otherwise it will install them to /dev/root and you will run out of drive space really quickly.
I called mine npmprefix and located it at ~/.
npm will then install things in npmprefix/lib/node_modules and npmprefix/bin
Edit and change the npm prefix location in your npmrc
prefix = /home/chronos/user/npmprefix
Now you have node and npm and you can update it whenever you need to or install different versions alongside each other.
I use MongoDB quite a bit. Installing it on ChromeOS is a breeze.
- Download the tar from here. I use the 64-bit version.
- It will download to your ~/Downloads directory
- Untar it to ~/ and then rename the directory if you want to. I rename mine to ~/mongodb
- Then just link up the binaries like so. ls bin to see all the binaries. These are the ones I use most often.
- sudo ln -sf /home/chronos/user/mongodb/bin/mongorestore /usr/bin/mongorestore
- sudo ln -sf /home/chronos/user/mongodb/bin/mongodump /usr/bin/mongodump
- sudo ln -sf /home/chronos/user/mongodb/bin/mongo /usr/bin/mongo
Not only do I work with MongoDB locally, but I routinely dump and restore production databases from and to my Chromebook!
Ok, this should be pretty familiar to everyone.
- Download the JDK you want at http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html
- Personally I use the 64 bit one.
- Many people run more than one version of Java. If you do then create a ~/java directory and move and untar the jdk there.
- mv ~/Downloads/jdk<version>tar.gz ~/java
- If you are only running one version you could just untar the jdk to ~/ and rename the directory to ~/java to make the rest easier.
- Add the JDK to your PATH and set your JAVA_HOME Here is mine as an example.
Yep. With one line.
Make sure you are at ~/
In fact, type cd ~/ just to be sure because many times when you CROSH to shell you are dumped into / rather than ~/.
Meteor MUST be installed in your home directory.
Type...wait...you ready for it....
sudo curl https://install.meteor.com | /bin/sh
Want to make sure it worked? Type the following commands in shell.
- meteor create ~/my_cool_app
- cd ~/my_cool_app
I suggest you put your projects in ~/Downloads. Probably something like ~/Downloads/projects or something.
Well, because most Chrome apps cannot reach the file system outside of the ~/Downloads directory. That means Chrome based editors and IDEs.
What else do you need?
You now have perl, python, ruby, node, java and Meteor and MongoDB as a database.
I haven't tried installing other database systems like postgres or mysql but I suspect it is possible.
For example, I installed Apache Ant the other day without a hitch.
Oh yeah, this of course leads to the question, "What do I use as an IDE?"
Duh vi or vim!
Just kidding. Though they work great combined with shell commands because in ChromeOS each terminal is just an open tab in the Chrome browser! I use them quite often for quick stuff or when grepping around.
Though, I know you want a REAL editor or IDE, so lets move on.
Step 5 - IDE & Editors
Personally I haven't tried running Eclipse or something similar because I am not a big fan of full fledged IDEs but I suspect you could get it to work.
There are plenty of cloud ones like Code Envy, Espruino, CoffeeScript IDE, JetBrains, Shift Edit and dozens of other web based or cloud based IDEs.
Personally, I don't want to be forced to edit in the cloud. Quite often I find myself working on a plane and quite often they don't have WIFI. With built in 4G LTE in some Chromebooks you don't really worry about WIFI otherwise.
First, almost all of the editors are based on ACE.
On a daily basis I tend to use Caret. It is very similar to Sublime Text.
I also use Zed from time to time. It is a powerful distraction free full screen editing. Unfortunately, I am the kid of person that needs to see my directory and file structure to remember where things are or how they work!
Tailor is a very lean editor. Though I don't find myself using it often.
Tedit is an interesting one because it focuses on projects being git repositories locally with remote support and supports symlinking from the editor. Personally, I haven't gotten used to this editor yet.
Step 6 - What About Image Editing?
First, most of the time you don't need photocrap or any bloated application.
Second, use CSS as much as you can. Images are so 1990's.
Though, ultimately you will probably have to edit photos or make icons or something.
If you want to use Gimp try Gimp on Roll App, though I suspect you could build gimp locally if you wanted.
There are plenty of image editing programs in Chrome Web Store.
I tend to use Pixlr and Sumo Paint but there are dozens of various types of image or photo editing applications available.
Step 7 - Have Fun & Build Something Cool!
For between a couple hundred and a few hundred bucks what more could you ask for?
So, go have fun and build something cool!
So, Chromebooks ain't just for students, grandmas and casual users!
A properly tuned up Chromebook can make a great development box.
Since March, 2014 I have been developing two production applications and deploying those applications from my Chromebook.
What can you do with yours?