Archlinux on Pixelbook

It's been a while since I last paid attention to the laptop market. With a little disappointment, the hardware spec hasn't been improved as much as I expected. Ultrabooks are still mostly shipped with two typical combinations: 8G RAM with i5 or 16G RAM with i7. I don't need i7 because I weigh portability over performance. I have my nice Linux desktop for performance demanding tasks and I would like to have a skinny laptop that is friendly to both surfing and coding. Moreover, I've been waiting for a "dream" machine that can properly serve both as a laptop and a tablet. Pixelbook seems just right.

I got one with 8G RAM, i5 CPU, and 128G SSD at $880 during a sale. The hardware is worth the price, considering the decent spec given 2.4lb weight, and I also personally like the look that won't let any haxor down. It operates with the heavily shielded Chrome OS. After some search I realize that I need to give up the security guarantee by switching to developer mode, in order to run a decent Linux distro aside. Doing so will cause the laptop generates loud beep sound if one does not press Ctrl+D to skip it at boot time and all data will be erased if one presses space bar and enter key, before the beep. At the moment I was giving up to this plan of using crouton, Google held 2018 I/O event and announced crostini, a way to run other Linux distros inside sandboxed lxc containers, one day before I got my Pixelbook.

The crostini environment currently works, but with hacky scripts. The sommelier [1] program emulates an X11/Wayland server that in turn forwards the rendering commands to Chrome OS host, penetrating the container boundary. The good part of the story is, with linux container technology, unlike traditional VM with fully emulated hardware, the sandboxed Linux system runs with very little overhead. The provided distro, Debian Stretch, is only slightly adapted compared to the one given by Linux Containers [2]. This gives me some hope of figuring out how to apply the changes to in theory make containers of any Linux distros.

I use Archlinux since my conversion from Gentoo two years ago. It is easy to setup and bare-bones enough to customize. It has very up-to-date binary packages and the rolling update does not break as frequently as in its early years. Archlinux also uses systemd as in Debian, so it shouldn't be hard to make it work in crostini.

So far, I managed to run Archlinux as a container with working network, console, and Wayland display. I fixed the network issue using the lxc profile modification found here [3], and converted the Debian packages to make Wayland work. In theory, X11 should work as well, but due to some bug inside sommelier, I'm currently unable to run any X11-only program see the picture below.

To get Archlinux working on your Pixelbook, try the following steps (in termina prompt):

  1. Adjust the profile for networking:
  1. Create and run the container:
  1. Enter the root shell:
  1. Or use console to login:
  1. You can use bazel to build the Debian packages provided here [4], and convert them to Archlinux packages using debtap [5]. The conversion isn't perfect, so don't forget to create a symlink from /usr/bin/sommelier to /opt/google/cros-containers/bin/sommelier.
  2. To avoid annoying retry messages, disable the ttys by systemctl disable getty@lxc-tty1, and the other five.
  3. For those slackers, here [6] is the link to the converted packages.
  4. Finally, a picture is worth a thousand words:
/images/pixelbook-with-archlinux.thumbnail.png

It shows a running Archlinux with a Wayland terminal emulator, proper fonts, Rust, Texlive, etc. Here is another picture showing X11 support with urxvt, fcitx IME and open file dialog of evince:

/images/pixelbook-with-archlinux2.thumbnail.png

Troubleshooting

  • If X11 programs refuse to start and complain about keycodes, try to comment out the following lines in /usr/share/X11/xkb/keycodes/evdev:

    ...
    <I255> = 255;   // #define KEY_RFKILL              247
    
    //<I372> = 372;   // #define KEY_FAVORITES           364
    //<I374> = 374;   // #define KEY_KEYBOARD            366
    ...
    

    This is because sommelier does not support the keycodes only exist in the latest version of xkeyboard-config.

[1] https://chromium.googlesource.com/chromiumos/containers/sommelier
[2] https://linuxcontainers.org/
[3] https://github.com/lxc/lxd/issues/4071
[4] https://chromium.googlesource.com/chromiumos/containers/cros-container-guest-tools/
[5] https://aur.archlinux.org/packages/debtap/
[6] https://tedyin.com/archive/cros-archlinux/
Comments

Application for PhD

Comments

所謂幸福

我想有個姑娘
能同她聽金色音樂會
亦可去吞街頭牛肉麵
狹小店裏
於盈盈熱氣中
促膝而坐
吸溜着叼滿一嘴的麵條
咕噥了聽不清什麼的話
相視一笑
這便是心中的幸福

Read more...

Comments

沒時間

「牛奶咖啡」組合的單曲《沒時間》。

最近的確沒時間。這個詼諧的歌詞權當自我調侃~

突然很想 不去上班
發一發呆 偷一點懶
但是又要 問我自己
是不是要 堅強一點

夢想總是 繞一個圈
卻還是要 回到原點
是不是我
還需要再堅強一點

我真的沒時間 沒時間 吃一頓早餐
我沒時間 沒時間 去鍛煉鍛煉
我沒時間 沒時間 逛一逛商店
我沒時間 沒時間 真的沒有時間

Read more...

Comments

端着水行走

這是無意中得到的一個比喻。做任何事情,就像是端着滿滿一杯水行走;如果刻意求快,那麼水很容易灑出來;而如果力求水面平穩,步伐就會自然而然地放慢。端着這杯水行走,還需要眼和手的平衡:時時刻刻盯着手裏的那杯水,看不清前方的路,撞破頭是難免的;而倘若總是眺望遠方,手裏那杯水不知灑掉了多少,再低頭一看,已經後悔莫及。

讀一本書,可以一目十行,但是那些蘊含在字裏行間的靈動的智慧也就像灑出的水一樣被忽視;也可以字斟句酌,然而隨之而來的龜速前進無疑大大影響了進度。一段時間內,做事得到的收穫既取決於速度,也取決於質量。兩者是矛盾的統一體。

Comments
Contents & Theme © 2020 Ted Yin
TypoPro & Adobe TypeKit