cat /dev/screen | topng > screencap.png

Posted on

plan9 · raspberrypi

If you've never heard of Plan 9 from Bell Labshttps://9p.io/plan9/ maybe this post isn't for you (or maybe it is). If you have any interest in Unix-like operating systems, then Plan 9 might be worth checking out.

For this you need a Raspberry Pi (I have a 3B+), an SD card, keyboard, mouse and an HDMI monitor. My work environment is GNU/Linux, so all commands are meant to be run on a GNU/Linux system. Insert the SD card in your system, make sure it’s not mounted and figure out its device name (you can typically do lsblk to figure this out).

$ wget https://9p.io/sources/contrib/miller/9pi.img.gz
$ gunzip -dc 9pi.img.gz | sudo dd bs=1M of=/dev/sda

Eject the SD card, put it into your Pi and plug in the power. The system should boot almost immediately.

The first thing to configure is some networking. Thankfully, the documentation p9wiki-networkinghttps://9p.io/wiki/plan9/network_configuration/index.html can guide us:

term% ip/ipconfig

should exit with no output, any errors are reported.

To enable DNS, run:

term% ndb/dns -r

There’s this wonderful person, Sigrid, who writes applications for Plan 9. To get it simply do:

term% 9fs ftrv.se
term% ls /n/ftrv.se

and a whole list folders should show up.

This is what it looks like right after boot (plus the small terminal to take a screenshot):

Plan 9 on Raspberry Pi screenshot

(click to enlarge)

What’s next? Dig in and learn. Plan 9 feels quite different from GNU/Linux, but it’s still similar enough that I occasionally try commands that I usually use (and fail). For example, cp does not move folders, only files. Use dircp instead.

I started using GNU/Linux when I was 21 and was a pretty comfortable Windows user. The switch felt huge and nothing worked as I was used to, but this also meant that all the problems I faced could be solved with a fresh outlook that wasn’t obstructed by any preconceived notions. Getting into Plan 9 requires a little more conscious effort to forget that you’re not on a Unix system.

It’s refreshing though.

If you are interested in more, check out Devine who posted a long threadhttps://merveilles.town/@neauoire/104609568812530054 on Mastodon on their journey with Plan 9. It’s what got me started (again) on Plan 9. The wikihttps://9p.io/wiki/plan9/plan_9_wiki/ is also a great resource.