

Setting Up a Local Development Environment in Chrome OS - ujeezy
http://jeremyckahn.github.com/blog/2013/02/09/setting-up-a-local-development-environment-in-chrome-os/

======
Andrex
This isn't setting up a local dev environment in Chrome OS. This is setting up
a local dev environment on a Chromebook. I was hoping this would show some new
way to actually develop in Chrome OS itself, just saying "boot into Ubuntu!"
is a lazy answer.

------
MoOmer
Having just set this up, I'm really digging it.

If you're unsure whether or not a Chromebook is the right system for you,
check out the specs[0]. Note that the Chromebook isn't extremely powerful, but
that is not the product's goal.

Back to Ubuntu/Chrome: Rather than install Unity (which I actually don't mind
on some systems), I opted for the actual crouton dev team's recommendation of
XFCE[1].

XFCE is made for an underwhelming environment, and its performance is better
than what Unity would probably offer.

You can in fact switch between Chrome-os/Ubuntu with 3 or 4 key presses,
depending on your chromebook model. Your install likely won't come with vim,
git, etc. installed as ujeezy noted, but if you're familiar with gnu/linux,
you already know you what you want from your environment.

I, like many of you, have a couple of computers to lug around: Work laptop
(windows), Macbook (expensive shiny development tool). Being that I really
have come to enjoy the macbook's battery life, even when using lots of high-
resource tools/windows, I'm not sure where this chromebook will fit in.
Breaking my macbook scares me, but so does being without it.

If you have a chromebook, definitely try this out. I was expecting to have to
deal with lots of issues, but the install was extremely smooth (other than the
downloads coming in at 20-30kb/s).

Things to note:

* Make sure you read Crouton[1]'s readme - there are a few potential 'gotcha's in there.

* Disable XFCE or Unity's screensaver.

* As ujeezy noted, you'll need to install vim/emacs, git, gcc, etc.

* While nice, and amazing for what it is, this will probably not replace your default dev environment, unless you exclusively use programs that aren't resource intensive, and/or only exist in terminal.

[0] [http://www.google.com/intl/en/chrome/devices/samsung-
chromeb...](http://www.google.com/intl/en/chrome/devices/samsung-
chromebook.html#ss-cb)

[1] <https://github.com/dnschneid/crouton>

------
flyinprogramer
The real question is why have we devs been forced to bastardize this OS since
2009 in order to actually use the darn thing? Where's the innovation Google?
Where's the Chromebook for Devs? Because I bet if we looked at the numbers,
we're the only ones buying these things anyways.

~~~
luser001
Ummmm. It _is_ possible to run a full-blown Ubuntu including arbitrary kernels
etc. Some are doing it.

This is just an easier method if all you want is access to a powerful Debian
userland: it turns out that Debian already solved the problem of creating a
self-consistent cross-compiled directory tree ages ago so it makes sense to
reuse that solution here.

~~~
flyinprogramer
Ubuntu is still not ChromeOS -- my point is simply, why has Google not pursued
the "lets build a $250 dev box for startups" avenue... since we've been
playing this game going on 4 years now with not much traction beyond the dev
community.

~~~
jsight
Do these machines have traction in the dev community? Aside from a couple of
blog posts like this, I haven't really seen much.

AFAIK, most sales are still to schools and a few enterprise installations:
[http://techcrunch.com/2013/02/03/maybe-those-chromebooks-
wer...](http://techcrunch.com/2013/02/03/maybe-those-chromebooks-werent-such-
a-crazy-idea-after-all/)

"Still, with over 2,000 schools now using Chromebooks, the real market for
these devices sure seems to be in the education space. Over the last year or
so, I’ve heard from a number of educators that they prefer to use Chromebooks
with their students than an iPad (their students probably think the exact
opposite…). Not only are they obviously cheaper and come with service
contracts and management consoles for administrators, but having a full
keyboard and larger screen clearly make them attractive devices in the view of
many teachers and school administrators. The fact that the devices auto-update
regularly and are pretty much safe from viruses also makes for an attractive
selling point when compared to traditional laptops. For Google, of course,
this also means many of these kids will grow up in the Google ecosystem of
Gmail and Google Drive, which surely isn’t going to hurt it once these
students go on to college or get jobs."

------
habosa
I love my chromebook so I'm fairly interested in doing this. I have two
questions: 1) How does having a chroot environment affect battery life? Does
access to the Ubuntu tools cost a ton of battery? 2) After I go into developer
mode can I still get updates to Chrome OS?

~~~
jerbils
Article author here. Anecdotally the battery life takes a bit of a hit, but
I've been running it pretty hard to get everything installed. I haven't done
any tests. I have a suspicion that Chrome limits its CPU usage, and the chroot
does not. That said, the battery life isn't completely shot in the chroot.

I got my Chromebook on Monday, so I haven't updated it after initial boot. I'm
not sure about the updating issues, but you can always go into non-Developer
Mode and update from there. If that causes problems for the chroot, it's
really easy to back up the chroot (it's just a directory) and reinstall it
with Crouton: [https://github.com/dnschneid/crouton#you-want-to-make-a-
boot...](https://github.com/dnschneid/crouton#you-want-to-make-a-bootstrap-
tarball-and-create-a-chroot-from-that)

So in other words, I can't answer any of those questions yet, sorry!

~~~
habosa
Thanks for the preliminary response. I am very tempted to do all of this
"hacker" stuff to my Chromebook but I'm worried that's a slippery slope. As is
I have no local files, no battery worries, so it's essentially a maintenance
free machine. Once I start doing local work I'm going to want more and more
until it's basically just a netbook. I think it's maybe good for me to have a
machine where I can't constantly be tinkering.

~~~
ConstantineXVI
There's always USB booting [0], you can still tinker but can't muck up CrOS

[0] <http://archlinuxarm.org/platforms/armv7/samsung-chromebook>

~~~
dhruvmittal
If you did this, would there be a significant lag from i/o? I assume sticking
a Class 10 SD card in it and booting archARM would be pretty quick, but still
slower than the SSD that ships with the machine.

~~~
ConstantineXVI
Haven't tried on this machine specifically, but never noticed much lag as a
result of running from USB on others. There is a USB3 port on the back if
you're concerned about performance (just remember this is a $250 ARM laptop,
not a MacBook Pro).

------
kostya-kow
Is there a way to run a distro other than Ubuntu (Fedora, Arch)?

I am planning to buy the x86 version, so it seems like it should be possible
to install any distro on it. Is Crouton/ Chrubuntu for ARM version?

~~~
jstanley
I can't speak for fedora (possibly febootstrap?) but it is already easy to
install Arch in a chroot.

<https://wiki.archlinux.org/index.php/Archbootstrap>

If ChromeOS doesn't provide you enough tools to run archbootstrap, you can run
archbootstrap on a separate machine with the chrome disk attached and then put
the disk in the ChromeOS laptop. A bit of hassle but perfectly doable.

------
richo
Vim version referenced is horrifically out of date.

Their dev trunk is pretty stable, it'd be good if he'd update the post.

~~~
jerbils
Article author here. I can try a newer Vim when I have some time and update
the post, this was just the first thing I got working. Thanks for the heads
up.

------
JailhouseRodeo
I know the OP was interested in unix tools, but I've been wondering could you
build a lightweight IDE or dev toolset in chrome itself? It looks like
action.io and cloud9 have been some nice browser based tools, but what about
building something using google native client that runs locally in chrome?

~~~
habosa
This. I have been considering trying but I have no experience with such tools
so I think the task would be a little bit beyond me. I can't see a reason why
Cloud9 couldn't make an offline version for Chrome, minus a few features.

------
hayksaakian
What about something like sublime text 2? You can't really use it via a shell,
so would you end up running in a full Ubuntu install anyways?

~~~
dhruvmittal
While Sublime Text is nice (and rather attractive), many people still prefer
vim and emacs. It's a matter of personal preference, in the end, as both vim
and emacs are quite extensible. With the existence of tools such as
YouCompleteMe, syntastic, delimitmate, etc., one can outfit vim with the
functionality of Sublime Text or even some heavier IDEs in a matter of minutes
(using vundle and pathogen to handle the extensions). My largest reason for
preferring vim is its presence by default in almost every UNIX system I've
touched. I just have to pull my .vimrc over to whatever machine I'm working
in, if I'm spending enough time there to warrant it, and I'm almost
immediately at home.

I'm a vim guy so I can't really speak on emacs, but I imagine things work in a
similar fashion.

------
raingrove
You should try Action.IO: <https://www.action.io/>

~~~
benologist
He covered web based IDEs and also having a dev machine to ssh into, most
people have either no internet or shitty internet outside of their home and
work. How does action.io solve that?

~~~
iamclovin
> most people have either no internet or shitty internet outside of their home
> and work

we think this is a situation of "skating to where the puck is going to be,
rather than where it is", but we do have plans to build a bridge between an
offline/online dev environment. If you'd like an invite, please email me at
arun <at> action <dot> io

~~~
jewel
Is there any reason you couldn't keep an offline copy of the environment in
the browser by using <http://bellard.org/jslinux/>? It takes a while to boot,
but if you saved the RAM to local storage then it should resume instantly.

You'd have to sync the state of the VM when they come online again, but that
could be done efficiently from within the VM in a manner similar to dropbox
syncing.

------
camus
I dont get it , for the price of a chromebook , one can get a netbook with a
full linux plateform to install whatever stack one needs (and ides like
netbeans/eclipse/sublimetext2...) , what's the point being a chromebook for
development purposes ? ( it is a question not a rant against chromebooks )

~~~
ConstantineXVI
The ARM Chromebook looks to be a much nicer piece of hardware than anything
under $250 on Amazon's top 20 list of netbooks[0]; bigger screen, dead silent
(no spinning HDD, no fans), great battery life, and a keyboard/touchpad better
than nearly every low/mid-end PC laptop I've used.

And you lose this benefit if you go outside CrOS as described in the article
(I'm fine using it as a SSH terminal myself), but they're more or less
disposable. I could chuck mine out the window, watch it get trampled in a
conveniently timed parade, run out to Best Buy and pick up another one, and
I'm right back where I was minus only $250 and an hour (incl. drive time and
re-syncing).

[0] [http://www.amazon.com/Best-Sellers-Computer-Accessories-
Netb...](http://www.amazon.com/Best-Sellers-Computer-Accessories-Netbook-
Computers/zgbs/electronics/1232596011/)

~~~
camus
ok , so it is for the SSD ?

