
Chrome OS native development - AlexeyBrin
https://solarianprogrammer.com/2017/09/13/chrome-os-native-development/
======
monkmartinez
The thing is, you can get a Windows laptop with a bigger SSD, more RAM and
ports for the same price as a decent Chromebook. Instead of jumping through
hoops to run linux on chromeos, you can just install the distro of your choice
as a windows replacement. My opinion: Developing on a chromebook is like
typing with a hand behind your back; You can do it... but it doesn't make a
lot of objective sense unless you have bizarre constraints that _force_ you to
make such concessions.

~~~
bpye
"Okay" Chromebooks seem to cost less than the equivalent Windows laptop. The
CPU and memory is often fine but I agree, they are all too often limited by
the size of eMMMC storage. I managed to get a HP Chromebook 13 G1 for 250$,
3200*1800 IPS display, 4GB RAM, Core m3 CPU but 32GB eMMC. Even playing around
with a compressed filesystem it's limited, especially since 4GB RAM basically
mandates I have some swap space. Ultimately I'm left with about 16GB free.
There is a micro SD slot but that isn't very fast.

~~~
leggomylibro
HardKernel makes ODroid boards which offer board-mounted eMMC as an
alternative storage medium; you can choose between a normal microSD card, or a
small custom eMMC PCB with a mezzanine connector:

[http://www.vesalia.de/pic/odroidc1emmc.jpg](http://www.vesalia.de/pic/odroidc1emmc.jpg)

It'd be cool to see flash memory slots put on ARM laptop boards like you see
DRAM slots today. "16GB expandable to 2x 128GB!"

~~~
kevin_thibedeau
M.2 SSDs are the solution. Many low end laptops support them without listing
it on the spec sheet. Look around for service manuals with mobo pictures to
determine what one supports before making a purchase.

~~~
leggomylibro
Yeah, good point. There's no way a custom flash chip could beat the
combination of cost, density, speed, endurance, and industry-standard
footprint.

------
leggomylibro
Nice - I like Chromebooks for on-the-go work because they are light, have
great battery life, and Google's tentacles make for a slick UI.

I use crouton and xiwi, though, because while native is nice, you can't beat
surfacing X windows into Chrome tabs. I love the cheap 10-11" ones for stuff
like OpenSCAD and KiCAD.

(Also, if you keep your work backed up offline, $200-300 for a replacement
isn't bad, compared to a high-end powerhouse. That's nice in a mobile machine;
life happens.)

~~~
bgrohman
I use a Chromebook with Crouton as my main personal laptop now, and it has
worked well for me. I'm using i3wm instead of a traditional desktop
environment.

[http://bryangrohman.com/ubuntu-i3wm-
chromebook/](http://bryangrohman.com/ubuntu-i3wm-chromebook/)

------
hexrcs
A new "made by Google" Chromebook codenamed "Eve" is rumored to be unveiled on
the Oct 4 Google event. If the rumor is true then I think Google is now really
paying more attention to the laptop market, and the whole Chrome OS ecosystem
is very likely to get more mature in the near future. I would love to see
JetBrains tools running natively on Chrome OS one day.

source: [https://chromeunboxed.com/google-hardware-event-could-be-
on-...](https://chromeunboxed.com/google-hardware-event-could-be-on-
october-4th-again-this-year/)

~~~
leggomylibro
Oh, they are definitely paying more attention to the laptop market. They
partnered with Samsung recently to make Chromebook Plus/Pro models, and the
ARM version came with a strange 6-core processor only described as, 'OP1.'

It looks like it's a Rockchip with two Cortex-A72s, four Cortex-A53s, and a
recent Mali GPU. But the 'OP' branding is apparently an attempt by Google to
brand or designate ARM chips that have certain peripherals, performance-
enhancing features, and support for ChromeOS stuff.

[https://www.theverge.com/2017/2/22/14691396/google-
chromeboo...](https://www.theverge.com/2017/2/22/14691396/google-chromebook-
arm-laptop-op1-processor-apptop)

~~~
izacus
I was surprised how good the Samsung Chromebook (ARM version) was - it worked
decently well, ran pretty much all Android apps I tested (which filled the
gaps in ChromeOS very well!) and the stylus was useful for notetatking.

------
VikingCoder
Don't forget that newer ChromeOS devices support running Android Apps,
including Termux. It doesn't have an X built in, but you can do a ton of stuff
with it:

[https://news.ycombinator.com/item?id=14863580](https://news.ycombinator.com/item?id=14863580)

~~~
geokon
except development seems to have stalled. Very few devices are still
supported, even after a year+ since the first one. For instance my C201P is
still not supported even though the C100 which has identical hardware has had
support for a long time

~~~
VikingCoder
I have a Samsung Chromebook 3, and in the time I've owned it, Android Support
has moved from Dev channel to Beta channel. Seems like development is active
from where I'm sitting, anyway.

------
pjmlp
Crouton is not Chrome OS.

Even the author acknowledges that with "Running Chrome OS and Crouton side by
side is the easiest path for a complete Unix like development experience."

~~~
AlexeyBrin
The article presents ways to code directly on Chrome OS, without Crouton, you
just need to read past the first paragraphs.

------
yebyen
What kind of terminal are people using that develop on ChromeOS? I used a
Samsung XE303C for a while and I was happy with my options in Crouton, but I
could not get used to using a terminal in a Chrome tab.

I understand there is a way to disable the behavior that "ctrl+w immediately
closes the tab and terminates the shell" since I hit that key combo enough
times to turn me off of doing important work in a Chrome tab altogether, that
might help, but I wonder if anyone has come up with a really nice solution
that they'd be willing to share here.

~~~
isr
Install the crosh extension (which depends on the ssh extension). Now you have
a better term in a standalone window.

It's more configurable. You can open the javascript console and set your
preferred colours, turn off certain keybindings (so they can pass through to
the stuff running inside your terminal), etc. Here's a dump of my notes on
this:

\----

● preferences

●● general info See [^ nassh faq] (yes, not the 'hterm hack' file, confusing
eh?) for details on how to configure.

See [^ pref mgr] for the full list of configurable preferences. To configure,
you need to: \- run crosh shell in a browser tab (not standalone window) \-
open 'Developer Tools', console. This will open a javascript repl side-by-side
with the crosh window, within the same browser tab

Get the current value of a preference:

    
    
        term_.prefs_.get('OPTION NAME')
    

Set new value:

    
    
        term_.prefs_.set('OPTION NAME', <NEW-VALUE>)
    

Reset to default:

    
    
        term_.prefs_.reset('pref-name')
    

Reset all preferences to default:

    
    
        localStorage.clear()
    

●● copy/paste

By default: \- selected text will be automatically copied \- Ctrl+Shift+v will
paste into hterm

These defaults seem fine by me :)

●● basic changes

Fixes the ALT key (mostly, anyway):

    
    
        term_.prefs_.set('alt-sends-what', '8-bit')
    

●● $TERM

Actually, hterm is already set to 'xterm-256color' by default. ChromeOS must
change that to 'xterm' somewhere.

    
    
        term_.prefs_.get('environment')
    

●● look & feel

The bloody scrollbar (I use gnu-screen's scrollback buffer instead) and bell
are annoying:

    
    
        term_.prefs_.set('scrollbar-visible', false)
        term_.prefs_.set('audible-bell-sound', '')
    

This is my preferred font size (174x51). See [^ nassh faq] for more info on
setting fonts, blinking cursors, etc.

    
    
        term_.prefs_.set('font-size', 13)
    

Colours can be set using either: \- a CSS name \- in hex, with #rrggbb \- in
decimal, with rgba(red, green, blue, opacity) \- opacity = a number from 0 to
1. Best suited for a semi-transparent cursor

    
    
        term_.prefs_.set('foreground-color', 'ivory')
        term_.prefs_.set('background-color', #002b36)
        term_.prefs_.set('cursor-color', 'rgba(255, 20, 147, 0.75)')
    

See [^ css colors] for an easy to use chart.

●● override chrome shortcuts

There are many chrome shortcuts which get in the way. Running hterm/ssh in a
seperate window will disable many of them (C-w, C-n, C-t).

Some are still left, like the Ctrl+<number> and Alt+<number> shortcuts (switch
to n'th tab, switch to n'th widow). To disable these:

    
    
        term_.prefs_.set('pass-ctrl-number', false)
        term_.prefs_.set('pass-alt-number', false)
    

Use this in conjunction with chromeos/settings/"Keyboard settings"/"Treat top
row keys as function keys". I'm not sure what the most convenient combo is,
yet! Remember that Search+[1-0,-+] = F1 to F12, as well.

    
    
        term_.prefs_.set('media-keys-are-fkeys', true)

~~~
yebyen
Wow! Thank you isr

------
lando2319
I did nodeJS development on my Chromebook for a while, it worked well, the
only thing that was missing is the 'you complete me' autocomplete plugin for
Vim, but I think there's a way to get that working.

------
twotwotwo
I'm using a Chromebook that I like pretty well as a fancy terminal. A setup
that interests me is Kenn White's at
[https://blog.lessonslearned.org/building-a-more-secure-
devel...](https://blog.lessonslearned.org/building-a-more-secure-development-
chromebook/) \-- keeping it out of dev mode and using Android apps to fill
some gaps.

Big blocker for me starting over and doing that is VPN support. I have to
decipher how to convert my work's OpenVPN config to Chrome's ONC format.

~~~
nilleo
I'm currently running with this approach as well on a Chromebook Plus. I'm
still not entirely switched over to using it full-time but it's very usable
for a lot of terminal-based development.

------
chad-autry
Not mentioned, but for node.js dev termux almost gets there, but just falls
short. You can't hit a node.js server running in android/termux from a full
fledged local ChromeOS browser tab. It doesn't have port access. Have to go
run an android browser.

Alternatively, I've been just doing browser based dev. The free GCP google
cloud shell lets me edit and host so long as I have a connection. If I wanted
I could still keep it in sync with git running under termux.

~~~
bostand
Give me xwindows support in termux and I will happily ditch every other os.

------
TremendousT
See also [https://sites.google.com/site/chromeoswikisite/home/what-
s-n...](https://sites.google.com/site/chromeoswikisite/home/what-s-new-in-dev-
and-beta/shell-acess-with-verified-boot)

------
pier25
I'm guessing you can't really distribute your native apps to your users.

What about Android dev for Chrome OS? Does it allow you to use C and C++ NDK
when running on a Chromebook?

------
joshiefishbein
Just to be clear, Chrome OS is a Unix-based OS right?

They don't immediately explain that in their docs and, being a web dev, it's
hard to tell from the outside.

~~~
satysin
Correct, Chrome OS is a Linux-based distribution. I believe it is/was based on
Gentoo although I may be misremembering that.

~~~
wanda
You are correct. Gentoo was selected for its Portage package management
system.

------
jopsen
docker on chrome is would probably satisfy all these use cases...

------
kumarvvr
Its scary to think how much more Google will know about us if it gets into the
OS market too.

~~~
tombert
I'm a bit confused; isn't Android basically them getting into the OS market?

