Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Last active September 20, 2018 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennwhite/a01bd0ad002a08502d6918ed537b77aa to your computer and use it in GitHub Desktop.
Save kennwhite/a01bd0ad002a08502d6918ed537b77aa to your computer and use it in GitHub Desktop.
Dev environment setup for native Linux apps (VMs & containers) in ChromeOS Stable

Notes for setting up a dev environment in Chrome Linux (Crostini VMs & containers) on Chromebooks

Once Linux Apps has been enabled in System menu, open a browser window

Open a CROSH window: ctrl-shift-T

crosh>

Enter built-in ChromeOS Linux VM termina, based on Gentoo

(termina) chronos@localhost ~ $

Make a clean baseline snapshot to revert in case things go wonky

(termina) chronos@localhost ~ $ lxc snapshot penguin penguin-baseline
...
(termina) chronos@localhost ~ $ lxc info penguin
...
Snapshots:
  penguin-baseline (taken at 2018/09/19 23:47 UTC) (stateless)

View current state of the default (and other downloaded) containers:


+-------+--------------+--------+---------------------------------------+--------+----------+-------------------------------+
| ALIAS | FINGERPRINT  | PUBLIC |              DESCRIPTION              |  ARCH  |   SIZE   |          UPLOAD DATE          |
+-------+--------------+--------+---------------------------------------+--------+----------+-------------------------------+
|       | 980e37d286ad | no     | Debian stretch amd64 (20180904_18:31) | x86_64 | 286.61MB | Sep 19, 2018 at 11:39pm (UTC) |
+-------+--------------+--------+---------------------------------------+--------+----------+-------------------------------+

Manually log into Debian 9 container ("penguin") - this is an alternative brute force method, versus the preferred style of just using the Terminal button in "Linux Apps" in the Chromebook Launcher:

"fred" here is just an example. For typical gmail logins, it would be, e.g., "yourName" in yourName@gmail.com


Last login: Wed Sep 19 23:44:39 UTC 2018 on UNKNOWN
Linux penguin 4.14.65-05969-g6f2926628697 #1 SMP PREEMPT Tue Sep 4 16:08:40 PDT 2018 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
fred@penguin:~$

fred@penguin:~$ uname -a
Linux penguin 4.14.65-05969-g6f2926628697 #1 SMP PREEMPT Tue Sep 4 16:08:40 PDT 2018 x86_64 GNU/Linux

fred@penguin:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

High-voltage, use at your own peril: To get a peek at Developer Mode (not Dev channel, but Developer Mode with unverified boot [not recommended]):

$ cat /etc/issue
Developer Console

To return to the browser, press:

  [ Ctrl ] and [ Alt ] and [ <- ]  (F1)

To use this console, the developer mode switch must be engaged.
Doing so will destroy any saved data on the system.

In developer mode, it is possible to
- login and sudo as user 'chronos'
- require a password for sudo and login(*)
- disable power management behavior (screen dimming):
  sudo initctl stop powerd
- install your own operating system image!

* To set a password for 'chronos', run the following as root:

chromeos-setdevpasswd

If you are having trouble booting a self-signed kernel, you may need to
enable USB booting.  To do so, run the following as root:

enable_dev_usb_boot

Have fun and send patches!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment