This is more or less a dumping ground for random plan9/Inferno project related things. I am an amateur hobbyist plan 9 user who thinks it is amazing and awesome, these resources and info are 'use at your own risk', please point out improvements to make to this information and the setup of the qemu image file.
if you're interested in some grid setup tips (mostly Inferno oriented) check the draft of a /9/grid faq at
Also availabl: a slightly outdated version of the toolkit of scripts used, at
the g/ directory
The most important resource here is this qemu qcow image of a fully installed plan9 with the grid toolkit preinstalled, which is also an almost-ready-to-go Plan 9 CPU server -- there is a configscript included to setup your IP and system name inside the VM on your first boot. For external setup, add an entry to your host machines hosts file for the name you give your cpuserver (yourcpunode is the default), and figure out exactly how you want to do the networking. I use linux + a couple simple netfilter rules to bounce port 567, the auth port, around. Instructions are in the rc terminal you see on booting the terminal kernel.
Instructions for the scripts are contained in manpages and in a rough tutorial. To start a gridsession, do
g/gridstart SESSIONNAME MY.EXTERNAL.IP
wait a few moments, then open a new window inside the grid session rio and connect to a sample registry:
g/dialreg tcp!126.96.36.199!7888 reg1
and after that you are inside a grid session and can read the manpages. The scripts will be bound to /bin/g so you can see whats available there.
DOWNLOAD compressed qcow img file, untar it first
note: In theory this image should work on any form of qemu. it was produced on an ubuntu 8.04 qemu current as of mid 08. let me know about comptability. This .img is configured targeting the 'typical residential' internet user, with auto-dhcp at startup. You need the free, open source qemu emulator to use this hard drive image. If you are using linux, you can probably install it from your distro's repositories. (aptitude install qemu for instance). for windows, we have had the best luck with version 0.9.0.
OK, lets get explicit here: download the file, and do:
tar -xzf gcpuPlan9.qcow.img.tgz
and next, to start the emulator,
qemu -hda gcpuPlan9.qcow.img
You need to start by booting the term kernel inside the emulator like this:
and press return to accept the default boot path and choose to be user glenda
Your session starts up with some instructions in the RC shell and the /lib/ndb/local file open in acme. You don't need to do anything apart from running the provided configscript to setup your IP and system name. You will be prompted to give your local IP address (what your system sees as its IP, not your external IP if you are behind a router) and, if you want, a name for the system. After running the config script with
and giving your IP and system name when prompted, you can do
in your shell.
On reboot, change the boot option to what you will use for cpu server:
this should boot you to a message about 'bad nvram' and this is where you setup users and passwords. if you used the configscript to change your system name, subsititute whatever name you used for 'yourcpunode' in these instructions. first, you want to enter:
(sectore not setup by default, leave blank)
and then do
setup that account, and
and setup glenda. you can also make more users, you will also need to add them in fossilcons (the local file server (=your disk) control system) which you can find explained further down the page, or at: the plan 9 wiki new user page .
once you have setup users, do fshalt, wait for it to stop, and temporarily halt qemu. now you need to decide how to do the networking, the easiest i think is just doing qemu with -redir tcp:port::port -redir tcp:port::port -- the default ports are 567 for auth and 17010 for the cpu server itself. you may want other ports for other services, too. I do a simple iptables setup in linux to bounce port 567 to 2567 and then do the qemu redir from 2567 to 567.
iptables -t nat -A PREROUTING -p tcp --dport 567 -j REDIRECT
iptables -t nat -A OUTPUT -o lo -p tcp --dport 567 -j REDIRECT --to-port 2567
then starting qemu like this:
qemu -hda gcpuPlan9.qcow.img -redir tcp:2567::567 -redir tcp:17010::17010
and use the sdC0!9fat!9pccpuf boot option. You will be given a text console, logged in as bootes -- and you can access your cpu server with drawterm or another plan9 setup. You should add an ip and name to the hosts file on the machine you want to connect from. For instance, I have this in /etc/hosts:
to identify the address of that cpu server on my network. After installing drawterm with your favorite package manager(aptitude install drawterm, or whatever) the drawterm command in linux is:
drawterm -a yourcpunode -c yourcpunode -u glenda
from within plan 9 you use (assuming correct /lib/ndb/local info):
cpu -h yourcpunode
If you want to bring up a GUI from 'inside' the cpu server, you can start it like this from the text console in qemu:
aux/vga -m vesa -l 1024x768x8
Here are the basics of adding a new user:
(do this as bootes in the qemu text console)
con -l /srv/fscons
(you are now inside the file server control shell)
uname USERNAME USERNAME
(now hit ctrl-\ followed by q to leave fscons)
and setup their password. Following that, you can connect as that user:
drawterm -a yourcpunode -c yourcpunode -u USERNAME
and on your first connection do
to run the script to setup a sensible default environment. Exit and reconnect and your new user should be all setup.
To clone this setup and customize it for another machine with another name and IP, you can re-use the provided configscript (located in /usr/glenda) or you can edit stuff manually. Here are the relevant files to deal with.
/lib/ndb/local should have entries for any cpuservers more or less templated on what you see there, assuming each one is doing its own auth.
/n/9fat/plan9.ini needs to have the sysname=yourcpunode changed
the /cfg/yourcpunode/cpurc and /cfg/yourcpunode/cpustart files should be copied to /cfg/YOURNEWNAME
if something gets messed up in the authorizations, boot the term kernel
(9pcf boot) and do
echo thisisabunchofgarbage >/dev/sdC0/nvram
then on your next boot to the 9pccpuf kernel, you will have to reenter auth info, use
for the first two prompts
please report all the dumb stuff I did that needs fixing to:
I want to respect your software licenses!
Thanks to all the developers and people who have made Plan9 and related tech so awesome. I want to comply fully with all the licensing terms of the software I'm distributing. The downloaded hard drive image includes the standard licensing terms and I agree to all the conditions for redistribution. please let me know if im not in full compliance with anything. This is just a very rough first attempt to package up a form of plan 9 i have found useful, any suggestions for software that should be added and configuration improvements is very welcome.
changes from the default bell labs .iso distribution:
9pccpuf cpuserver compiled and installed using default CONF file.
cpurc and termrc files edited for a default setup designed for the 'typical residential' network user. these edits need help.
some random stuff from contrib was installed on the setup i used as a base. abaco, links, the openssh port, and a few games are what springs to mind.
moved the vast majority of default services in /rc/bin/service to the off configuration by placing ! before the filename. you may wish to disable everything except cpu services, or possibly re-enable stuff thats turned off.
The basic setup was done by attempting to follow the wiki guide
Plan 9 wiki standalone CPU and auth server guide
Edited default setup for glenda so when start the term kernel you get a help doc in rc and /lib/ndb/local open in acme, edited plan9.ini to add sysname yourcpunode, force manual kernel choice at boot, add default mouse scrollwheel support, and set resolution to 800x600x8
Added configscript to Glenda's home directory to automate setting up machine IP and sysname.
The modifications to the cpurc are in /cfg/yourcpunode
Thanks to everyone who's helped out on #plan9chan on irc.freenode.net