Installing Plan9 on Qemu (Oct/2013 Edition)
I have had several attempts at learning plan9, none succeeded. About 2 months ago, I tried it on my work MacBook Air with VMWare Fusion but didn’t get it going. I decided to try again, this time on my GNU/Linux box. Installing Plan9 is just one small step. Real fun starts once one starts to use it. I have just started and am already learning a lot, fondly bringing back the memories of the times when I was installing Slackware on my 486/DX66 with 4MB of RAM in 1996.
There are a few versions of Plan9.
- the original from Bell Labs
- 9front, a fork from the Bell Labs version.
- 9atom (supports a lot of hardware)
- 9legacy (Bell labs + patch set)
- NxM (designed for multicore)
I got into the #plan9 irc channel and
mischief (of NoiseBridge, SF) was kind enough to offer some suggestions. He suggested me to install 9front. So, I went off and downloaded the ISO image.
Host machine setup
I installed plan9 as a guest on a host Debian GNU/Linux system. All I had to install was Qemu.
Booting the ISO
First you need to create a qcow image (virtual hard disk) for qemu to install plan9 into.
$ qemu-img create -f qcow2 9front.qcow2.img 20G
Now, boot the iso image:
$ qemu -hda 9front.qcow2.img -cdrom ~/iso/9front.iso -boot d -vga std -m 768
Just follow the instructions in the 9front install wiki page. You start the installation by doing
inst/start. Once installation is done, stop the qemu reboot and start with the following switches.
$ qemu -hda 9front.qcow2.img -boot c -vga std -m 768
Also I configured my screen with
1920x1080x16 which works just fine. I also used
ps2intellimouse as my mouse, that gives me nice scrolling.
To take mouse control off Qemu, just press
To make good use of the Plan9 graphical console (
rio is the graphical shell of plan9), one need a 3-button mouse.
acme need a real 3 botton mouse for some of the “chording” operations. One could simulate button-2 (the middle button) with SHIFT+right click. But it is not very pleasant. So, I got a Microsoft Notebook Optical Mouse (from ebay.in for Rs.1000) which has a side button that acts as the third button.
Unix to Plan9
Moving to Plan9 as a regular OS can be daunting (at least for me that was/is the case, but I am slowly making my way in). There is a nice Unix to Plan9 command transition page. Just keep it handy. Plan9 takes Unix philosophy to the extreme and that shows in the commands.
The terminal does not have a separate pager like
less, infact there is an automatic pager and the command output blocks until one scroll the terminal, though this behaviour of the terminal can be changed using the menu. There is no commandline history. The shell is rc and is very nicely integrated with plan9 in all respects.
Unlike most Unix/GNU programs, plan9 programs need very less customizations. In many ways, GNU programs are antithesis of the Unix philosophy (of doing one thing well). I realized it only after I read and used plan9 a bit.
- get an irc client working inside 9front.
- get email client working with upas.
- 9fs works like a charm. Play more with it.
- how to compile C programs?
- APE layer
- read all the papers on the bell labs website.
- ACME, sam, structured regexps, rc.
- … many more.
Community and Support
There is a small but very passionate community around plan9. 9fans list and the
#cat-v irc channel on freenode are great places to hang out with other plan9 enthusiasts.
I tried to compile a few programs. I could rebuild the plan9 kernel and bootloader just fine. Mercurial seem to be the defacto version control system used by plan9 folks.
I tried to compile the Go compiler but that didn’t succeed. I needed a bunch of patches and even after applying those, it didn’t compile and finally I lost interest. A lot of plan9 folks use the paste service called sprunge for sharing error messages and patches. One could send error messages or recieve patches using the hget/hpost commands. For example, to post a file containing an error message into sprunge, this works:
term% hpost -u http://sprunge.us -p http://sprunge.us email@example.com # hit enter http://sprunge.us/EUJF
The URL returned by hpost can be shared on the IRC.
Installing, using and reading the motivations behind Plan9 makes one understand how broken our day-today computing infrastructure is. Plan9 was a nice attempt at fixing Unix and bringing computing to modern ages. In plan9, everything is a file. Even environment is a file. Each process has its own private namespace. This means that one can get rid of the ugly hack called sudo from the system. Venti, the network file storage system, is a content addressible system, which works similar to git.
How ever the strenghts of Plan9 also turned out to be its weakness. The world had already moved well into Unix and making something too different from Unix, is not for someone without enough marketing muscle. Had ANSI Posix Environment (APE) been done and had there been a linux emulation layer, things would have looked quite different. Also Plan9 doesn’t have a C++ compiler. Almost every web browser out there is written in C++ and the lack of C++ compiler means that one cannot use modern web from Plan9.
I am extremely sorry to see plan9 die a silent death. Or dare I say, it is already dead? There are handful of people using it at the moment. But hopefully, Plan9 from Userspace will live on.