Category Archives: Chrome OS

Chrome OS: Bad time in Linux container

I have an Acer R13 Chromebook running Chrome OS 83.0, and most actual work I do on this computer is development work inside the Linux environment.

I realized the other day that the time in the container was bad. Not just a little off, but several days behind. It seems when the computer sleeps/hibernates (which it does a lot) the Linux time “stops” and it does not leap forward to current time when the computer awakes.

I made a few attempts with ntp inside Linux but I don’t think it is meant to be used that way. I have also failed doing “$ sudo date -s 11:00:00”.

So, what make the time right in Linux again is:

  1. Restart the computer (doh), or
  2. Restart the container
    1. CTRL-ALT-T
    2. > vmc stop termina

In both cases your current work is interupted. So preventing your Chromebook from sleeping, or just shutting it off when not using it may be the most straight forward fix.

I changed the power settings so it does not sleep by itself.

Chromebook (Acer R13) as developer computer

I got myself a Chromebook (Acer R13 with ARM CPU, because I like to make it difficult for myself) quite a while ago, and it has been a mixed experience.

Now, however, with Chrome OS 76, I am actually rather satisfied both the the Acer R13 and with Chrome OS and the things I want to do finally just work!

General Laptop Aspects

Thinking about my Acer R13 as a laptop, it is quite decent:

  • very good battery time (although it drains when left it sleeping for long)
  • very quick startup/shutdown
  • simple to use Google login and Google docs
  • display, keyboard and touchpad is fine, weight is low, it is silent
  • chrome OS works well
  • performance is acceptable (mostly web browsing)

Developer and productivity aspects

I do web development, using Node.js, Vue, git and a web browser (it is a quite simple and limited toolset). This now works very well.

  • “Linux (beta)” works out of the box for my purposes (it is now finally stable on R13).
  • lxterminal gets me a simple tabbed terminal application.
  • Chrome OS 76 comes with virtual desks (very convenient).
  • nodejs (for ARM8) works perfectly

A few things to note about the Linux environment

  • it runs in a container, you can run more than one if you want, but the default container is Debian stretch (9.9) which is all good for me
  • since it is a container, you don’t access it at “localhost” but rather an IP that you get running “hostname -I” (for web development purposes or admin-UI)
  • the files in your linux home directory are accessible directly from ChromeOS under “Linux Files”, if you want to open something in Chrome, use Ctrl+O and just browse normally (it just works, it is just simple)

Conclusions

If you need a decent laptop at a good price, and you want Linux on it, a Chromebook is a very realistic option.

Crostini on Acer R13

Update 20190904: Got build 76.0.3809.136, deactivated developer mode, it seems to work good.
Update 20190730: Got build 75.0.3770.144 , it seems to work now!!!
Update 20190617: Got build 74.0.3729.159, problems remain.
Update 20190409: Activated Developer mode and installed Crouton again. It works perfectly for me.

Update 20190329: Got build 73.0.3683.88 four days late, Chrome OS 73, still no improvement.
Update 20190306: Got build 72.0.3626.122, problems remain.
Update 20190225: Got build 72.0.3626.117, problems remain.

Finally Crostini is available on the stable channel of ChromeOS for Acer R13 (elm platform 72). Unfortunately, the experience is still not what I had hoped.

I get a container as expected, but after a while problems start, it crashes and fails to start again. This is a way to destroy the virtual machine (termina) and the container (penguin) inside it.

crosh> vmc stop termina
crosh> vmc destroy termina
crosh> vmc start termina
(termina) chronos@localhost ~ $ lxc list
To start your first container, try: lxc launch ubuntu:18.04
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+

When I have done this, I can start the terminal app, it takes a while, and I get:

zo0ok@penguin:~$ uname -a
Linux penguin 4.19.4-02480-gd44d301822f0 #1 SMP PREEMPT Thu Dec 6 17:48:31 PST 2018 aarch64 GNU/Linux

That is good. I run apt-get update and apt-get upgrade successfully.

Trying to install a real terminal

However, when I try to install gnome-terminal “it” crashes.

(termina) chronos@localhost ~ $ [ERROR:utils.cc(50)] Failed to read message size from socket: Resource temporarily unavailable
[ERROR:vsh_client.cc(186)] Failed to receive message from server: Resource temporarily unavailable
crosh>

Both the virtual machine (termina) and the container (penguin) crashed. I can start termina again, but penguin is dead.

Yesterday, when running apt-get install, I got “Illegal instruction” repeatedly. I can make some semi-qualified guesses based on that:

  1. Something with the visualization/containerization layer is not working properly on ARM64 yet.
  2. The Debian guest OS is built in a way that is not compatible with my machine, at least not inside a container in a VM

I tried (as suggested in a message above) to set up Ubuntu instead:

(termina) chronos@localhost ~ $ lxc launch ubuntu:18.04
Creating the container
Container name is: set-kitten
Starting set-kitten
(termina) chronos@localhost ~ $ lxc list
+------------+---------+-----------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------+---------+-----------------------+------+------------+-----------+
| set-kitten | RUNNING | 100.115.92.201 (eth0) | | PERSISTENT | 0 |
+------------+---------+-----------------------+------+------------+-----------+

Then it turned out to be necessary to use a little trick to set the password in Ubuntu, and log in as usual.

(termina) chronos@localhost ~ $ lxc exec set-kitten -- /bin/bash
root@set-kitten:~# passwd ubuntu
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@set-kitten:~# exit

(termina) chronos@localhost ~ $ lxc console set-kitten
To detach from the console, press: +a q
Ubuntu 18.04.2 LTS set-kitten console
set-kitten login: ubuntu
Password:

But again, apt-get update and apt-get upgrade works just fine. But when I tried to install gnome-terminal all looked fine for a while, until:

Setting up libcdparanoia0:arm64 (3.10.2+debian-13) …
Setting up libblockdev-loop2:arm64 (2.16-2) …
[ERROR:utils.cc(50)] Failed to read message size from socket:
Resource temporarily unavailable
[ERROR:vsh_client.cc(186)] Failed to receive message from server: Resource temporarily unavailable
crosh>

From here it got worse, and all I could think of was to start over again.

(termina) chronos@localhost ~ $ lxc list
+------------+---------+------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------+---------+------+------+------------+-----------+
| set-kitten | STOPPED | | | PERSISTENT | 0 |
+------------+---------+------+------+------------+-----------+
(termina) chronos@localhost ~ $ lxc start set-kitten
Error: Missing source '/run/sshd/penguin/authorized_keys' for disk 'ssh_authorized_keys'

Back to basics

What if the problem is related to me wanting a GUI-terminal? I started over with a new default-penguin-container (using the vmc destroy termina trick I mentioned in the beginning). Unfortunately, when I did apt-get ugrade in my new penguin-system I have the impression that many things anyway were left since before, and apt-get upgrade crashed.

So I decided to:

  1. Powerwash the Acer R13
  2. First thing when it came up again, install Linux
  3. apt-get update
  4. apt-get uprade (CRASHED)

Trying with Archlinux

I gave an arch-container a try. Installing archlinux is as easy as:

lxc launch images:archlinux

I installed a few tools (ssh, git, nodejs) and that was fine. Then I tried to git clone a private repository. It got stuck half way, but Ctrl-C allowed me to restart and all was good. Then I installed some node-packages with npm install and I got the familiar:

[ERROR:utils.cc(50)] Failed to read message size from socket: Transport endpoint is not connected [ERROR:vsh_client.cc(186)]
Failed to receive message from server: Transport endpoint is not connected
crosh>

…that is, container, and virtual machine all crashed.

Other people…

It seems I am not alone according to this reddit thread (that I have also posted to).

Conclusion

Unfortunately , I must say that Crostini is not at all stable and useful on Acer R13, despite it is now in the stable channel.

At this point when I get very irregular crashes I must ask myself if there is anything wrong with my Chromebook. However, apart from Crostini I never had any problems with it. And for several months I ran it in Developer mode with Crouton, always rock solid.

The good thing is possibly that this should not be a major bug with architectural implications. If they (Google) have made it all this way with Crouton for ARM64 I don’t think they will abandon it. This will silently be fixed some day and forgotten.

So unfortunately, I can not recommend the Acer R13 (or any other ARM device) at the moment if you are interested in running Linux/Crostini on your Chromebook. Crouton should still be good, I guess, it was a while since I used it.

Linux Apps on Chromebook R13! Finally!

For a while I have owned an Acer R13 Chromebook that I occationally have used as a development computer. I have been using Crouton, which is quite ok, but it is like something is missing.

Lately there has been talks and writings about Crostini, Container technology on Chrome OS, which enables Linux applications to run in Chrome OS. This would be different from Crouton in different ways, like:

  1. The Chromebook does not need to start/run in unsafe developer mode.
  2. There is a Terminal App, instead of running Crosh in the browser

This is perhaps not huge, but it is a step closer to making Chrome OS more universally usable.

New features are added to Chrome OS on different times for different devices. Just now (according to this thread) “Linux” was added to the Development Channel for Acer R13. I can confirm it. I changed channels to Beta (R71) and got nothing. I then switched to Dev channel (R72) and now I finally have Linux (Beta).

I guess in a few weeks R72 will have made it to Stable. If everything seems fine I will probably switch back to Stable, disable Developer mode and never touch Crouton again.

The terminal gives me a standard Debian Stretch system. The terminal itself is very minimal. I am aware of these shortcuts:

  • Ctrl + : make text larger
  • Ctrl – : make text smaller
  • Ctrl Shift P : open preferences
  • Ctrl Shift N : open new terminal windows

Compared to the terminal application I am used to in Debian or macOS this is pretty basic (and the limitation of Chrome OS is that you cant just install another terminal application easily).

Unfortunately I tried to install something (the screen command) using apt-get, and something went wrong. apt-get does not finish and when I open another terminal it crashes. A restart of the computer fixid this though. However, when during more real work things crashed on me. So there is clearly a reason for this to be in Development rather than Beta or Stable today, but it is very promising and fun nevertheless.

Acer Chromebook R13: Switching to Developer Channel

I read some things about being able to run Linux applications in Chrome OS if switching to the Developer Channel.

So I did that.

Everything looks very much the same and Crouton stopped working:

crosh> shell
chronos@localhost / $ sudo startcli
Entering /mnt/stateful_partition/crouton/chroots/deb-cli...
ln: failed to access '/var/run/crouton/mnt/stateful_partition/crouton/chroots/deb-cli/etc/resolv.conf': Permission denied
Unmounting /mnt/stateful_partition/crouton/chroots/deb-cli...
chronos@localhost / $ 

I made a few attempts to fix it with no success. So I will be switching back to stable channel again.

Acer Chromebook R13: 3. As a Linux development workstation

Update 20190904: Everything finally works now!

Update 20190730: Crostini seems to work now, this post is mostly about using Acer R13 with Crouton (which you probably dont want if you can use Crostini instead).
Update 20190409: My experiments with Crostini are not giving good results, and I am back with Crouton. So This post is still the most relevant I have written if you want to do development on your Acer R13.
Update 20190216: This post describes how to run Linux on a Chromebook the old way: Crouton. There is a new more supported way: Crostini, which officially is now in the stable channel for the Acer R13. However my experience so far is very bad.

I have got an Acer Chromebook R13 and I will write about it from my perspective.

1. Background
2. As a casual computer
3. As a Linux development workstation (this post)

As a Linux development workstation
I switched my Chromebook to Development mode and everything that follows depends on that.

In ChromeOS you can hit CTRL-ALT-T to get a crosh shell. If in Development mode you can run shell to get a regular “unix” shell. You now have access to all of ChromeOS. It looks like this:

crosh> shell
chronos@localhost / $ ls /
bin     dev  home  lost+found  mnt  postinst  root  sbin  tmp  var
debugd  etc  lib   media       opt  proc      run   sys   usr
chronos@localhost / $ ls ~
'Affiliation Database'          login-times
'Affiliation Database-journal'  logout-times
Bookmarks                       'Media Cache'
Cache                           'Network Action Predictor'
Cookies                         'Network Action Predictor-journal'
Cookies-journal                 'Network Persistent State'
'Current Session'               'Origin Bound Certs'
'Current Tabs'                  'Origin Bound Certs-journal'
databases                       'Platform Notifications'
data_reduction_proxy_leveldb    Preferences
DownloadMetadata                previews_opt_out.db
Downloads                       previews_opt_out.db-journal
'Download Service'              QuotaManager
'Extension Rules'               QuotaManager-journal
Extensions                      README
'Extension State'               'RLZ Data'
Favicons                        'RLZ Data.lock'
Favicons-journal                'Service Worker'
'File System'                   'Session Storage'
GCache                          Shortcuts
'GCM Store'                     Shortcuts-journal
GPUCache                        Storage
History                         'Sync App Settings'
History-journal                 'Sync Data'
'History Provider Cache'        'Sync Extension Settings'
IndexedDB                       'Sync FileSystem'
'Last Session'                  Thumbnails
'Last Tabs'                     'Top Sites'
local                           'Top Sites-journal'
'Local App Settings'            'Translate Ranker Model'
'Local Extension Settings'      TransportSecurity
'Local Storage'                 'Visited Links'
log                             'Web Data'
'Login Data'                    'Web Data-journal'
'Login Data-journal'
chronos@localhost / $ uname -a
Linux localhost 3.18.0-16387-g09d1f8eebf5f-dirty #1 SMP PREEMPT Sat Feb 24 13:27:17 PST 2018 aarch64 ARMv8 Processor rev 2 (v8l) GNU/Linux
chronos@localhost / $ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/root                1.6G  1.4G  248M  85% /
devtmpfs                 2.0G     0  2.0G   0% /dev
tmp                      2.0G  248K  2.0G   1% /tmp
run                      2.0G  456K  2.0G   1% /run
shmfs                    2.0G   24M  1.9G   2% /dev/shm
/dev/mmcblk0p1            53G  1.3G   49G   3% /mnt/stateful_partition
/dev/mmcblk0p8            12M   28K   12M   1% /usr/share/oem
/dev/mapper/encstateful   16G   48M   16G   1% /mnt/stateful_partition/encrypted
media                    2.0G     0  2.0G   0% /media
none                     2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs                    128K   12K  116K  10% /run/crw

This is quite good! But we all know that starting to install things and modifying such a system can cause trouble.

Now, there is a tool called Crouton that allows us to install a Linux system (Debian or Ubuntu) into a chroot. We can even run X if we want. So, I would say that for doing development work on your Chromebook you have (at least) 5 options:

  1. Install things directly in ChromeOS
  2. Crouton: command line tools only
  3. Crouton: xiwi – run X and (for example) XFCE inside a ChromeOS window
  4. Crouton: X – run X side by side with ChromeOS
  5. Get rid of ChromeOS and install (for example) Arch instead

I will explore some of the options.

#2. Crouton command line tools only
For the time being, I don’t really need X and a Window Manager. I am fine (I think) with the ChromeOS UI and UX. After downloading crouton I ran:

sudo sh ./crouton -n deb-cli -r stretch -t cli-extra

This gave me a Debian Stretch system without X, named deb-cli (in case I want to have other chroots in the future). Installation took a few minutes.

To access Debian I now need to

  1. CTRL-ALT-T : to get a crosh shell
  2. crosh> shell : to get a ChromeOS unix shell
  3. $ sudo startcli : to get a shell in my Debian strech system

This is clearly a sub-optimal solution to get a shell tab (and closing the shell takes 3x exit). However, it works very well. I installed Node.js (for ARMv8) and in a few minutes I had cloned my git nodejs-project, installed npm packages, run everything and even pushed some code. I ran a web server on 127.0.0.1 and I could access it from the browser just as expected (so this is much more smooth than a virtual machine).

For my purposes I think this is good enough. I am not very tempted to get X up an running side-by-side with ChromeOS. However I obviously would like things like shortcuts and virtual desktops.

Actually, I think a chroot is quite good. It does not modify the base system the way package managers for OS X tend to do. I don’t need to mess with PATH and other variables. And I get a more complete Debian system compared to just the package manager. And it is actually the real Debian packages I install.

I installed Secure Shell and Crosh Window allowing me to change some defaults parameters of the terminal (by hitting CTRL-SHIFT-P), so at least I dont need to adjust the font size for every terminal.

#4. Crouton with XFCE
Well, this is going so good that I decided to try XFCE as well.

sudo sh ./crouton -n deb-xfce -r stretch -t xfce,extensions

It takes a while to install, but when done just run:

sudo startxfce4

The result is actually pretty nice. You switch between ChromeOS and XFCE with CTRL-ALT-SHIFT-BACK/FORWARD (the buttons next to ESC). The switching is a little slow, but it gives you a (quite needed) virtual desktop. Install crouton extensions in ChromeOS to allow copy-paste. A good thing is that I can run:

sudo enter-chroot -n deb-xfce

to enter my xfce-chroot without starting X and XFCE. So, for practical purposes I can have an X-chroot but I dont need to start X if I dont want to.

screen
After a while I have uninstalled XFCE and I only use crouton with cli. The terminal (part of the Chrome browser) is a bit sub-optimal. My idea is to learn to master screen, however:

$ screen
Cannot make directory '/run/screen': Permission denied

This is easily fixed though (link):

mkdir ~/.screen
chmod 700 ~/.screen

# add to .bashrc
export SCREENDIR=$HOME/.screen

# and a vim "alias" I found handy
svim () { screen -t $1 vim $1; }

I found that I get problems when I edit UTF-8 files in VIM in screen in crouton in a crosh shell. Without screen there are also issues, but slightly less so. It seems to be a good idea to add the following line to .vimrc:

set encoding=utf8

It improves the situation, but still a few glitches.

Now at least screen works. It remains to be seen if I can master it.

lighttpd
I installed lighttpd just the normal Debian way. It does not start automatically, but the normal way works:

$ $ sudo service lighttpd start

If you close your last crouton-session without stopping lighttpd you get:

$ exit
logout
Unmounting /mnt/stateful_partition/crouton/chroots/deb-cli...
Sending SIGTERM to processes under /mnt/stateful_partition/crouton/chroots/deb-cli...

That stopped lighttpd after a few seconds, but I guess a manual stop is preferred.

Performance
I have written about NUC vs RPi before and to be honest I was worried that my ARM Chromebook would more have the poor performance of the RPi than the decent performance of the NUC. I would say this is not a problem, the Acer R13 is generally fast enough.

After a few Nodejs tests, it seems the Acer Chromebook R13 is about 5-6 times faster than an RPi V2.

A C-program (some use of 64-bit double floats, little memory footprint) puts it side-by-side with my Celeron/NUC:

                s
RPi V1        142
RPi V2         74
Acer R13       12.5
Celeron J3455  13.0
i5-4250U        7.5

Benchmarks are always tricky, but I think this gives an indication.

Acer Chromebook R13: 2. As a casual computer

I have got an Acer Chromebook R13 and I will write about it from my perspective.

1. Background
2. As a casual computer (this post)
3. As a Linux development workstation

As a casual computer

My general impressions of the Acer Chromebook R13 are positive. The display is good (I am not used to Full HD on a laptop) and the build quality in general is more than acceptable.

What works well, quite literally out of the box:

  1. English language with non-English keyboard
  2. Connect to 5GHz WiFi
  3. Editing Google Docs, Facebook, Youtube
  4. Google Play Store for Android Apps (required a restart for a system upgrade)
  5. Spotify App (in Mobile App format), streaming audio via Bluetooth to external speaker
  6. Netflix App (failed to mirror/play to external display)
  7. Netflix Web Page (could display video on TV over HDMI)
  8. Writing this blog post…
  9. Switch to tablet mode, use touch and type on virtual keyboard on display (well, it sucks compared to a real keyboard, but it works as could be expected)
  10. Printing to a local network printer: CUPS comes preinstalled (there are other options as well, but for me CUPS is perfect)
  11. Importing photos from a micro-sd-card taken with a camera. VERY rudimentary (crop/rotate/brightness) editing available.

The good
So far my impression is that the performance is very acceptable. I used some JavaScript-heavy web pages and it was surprisingly good.

The not so good
Compared to my MacBook Air the touchpad is not as nice. Scrolling web pages is more… jerky? I would have preferred if the keyboard was closer to the display and the touchpad more far away from me. At least the touchpad is nicely centered in the middle. To be fair, the touchpad is at least as good as on more expensive PC laptops.

Performance and Benchmarks
My own Web Worker Test indicates my MacBook Air (1.4GHz Intel i5) is about 2-3 times faster (both computers using Chrome browser). However, on OS X, Safari seems to be much faster than Chrome browser on some tests and outperforms the Chromebook up to 10x on some tests. This is quite pure JavaScript number crunching.

My own String Compare Test indicates the MacBook Air is about 50% faster (Chrome browser in both cases).

Things not quite there
I have been using my Chromebook more or less daily and there isn’t much I actually miss. But here is a short list (that may grow or shrink over time).

  • A graph plotter/calculator: Grapher in OS X is not amazing but better than what I found for Chrome OS. So far I have tried Plot and Graph Functions and Desmos Graphing Calculator

Developer mode
So far I have not touched the Developer mode. Everything is completely standard and I will leave it like that for a while.

Acer Chromebook R13: 1. Background

I have got an Acer Chromebook R13 and I will write about it from my perspective.

1. Background (this post)
2. As a casual computer
3. As a Linux development workstation

Background
The last 20 years I have used OS X since 10.0, Windows since NT4, and many Linux distributions. These systems all have their pros and cons. Last years Chromebooks running Chrome OS (which is Linux) have appeared. They are typically cheap and built for the cloud. However there are two things that make them particularly interesting:

  1. Chromebooks (modern ones) can run Android Apps
  2. Chromebooks are much used in schools, so children of today will start looking for jobs in a few years, knowing perhaps only Chromebooks

I am too curious not to want one (perhaps mostly to be disappointed).

A few years ago I thought about getting a Chromebook, but at the time I felt it was not going to satisfy me. I bought a MacBook Air 11 instead, which is a great laptop for my purposes. However I less and less agree with what Apple does and I would rather have a native Linux laptop, than a Mac.

There are several reasons why I bought an Acer Chromebook R13 as my first Chromebook

It has got good reviews (although it is not the latest Chromebook in the market).

I like the quality aluminium build (it almost reminds me of my Titanium PowerBook G4).

It has a touchscreen and can be used as a tablet or in tent mode.

It should run Android Apps very will with its ARM CPU.

I am enthusiastic and curious about the ARM CPU for several reasons. I like an underdog and after Spectre/Meltdown I think that we need all possible alternatives to Intel. I am also curious to see if the ARM performs decently enough for my needs (and I might get disappointed).

I hope to get decent quality and some new opportunities compared to MacBook Air.

As a standard user
Most of the time I am a very ordinary computer user. I browse the internet, pay my bills, send and receive emails, watch Youtube, write something using Google Docs and I do some basic photo editing. I kind of expect the Chromebook to do this just as well as my MacBook Air.

As a programmer
I am a programmer. I mostly code JavaScript for Node.js and the web, but I also code C, C++, Lisp, Python, Bash, or whatever I feel like (mostly for fun, sometimes for work). I don’t use very advanced tools (mostly Vim, actually) and I really feel comfortable with a Linux shell. Even Mac OS X with its many package managers feels foreign. Not to talk about how I am lost in Windows.

I understand Chrome OS is Linux. It comes with a terminal. It has a Developer mode. And I can install almost anything I want using crouton (or so I have read).

My hope is that my Chromebook, for most practical purposes, will work like Linux the way I expect (more so than OS X). My hope is also that the ARM CPU will have reasonaable JavaScript performance. I may end up disappointed.