Plan 9, /9/grid, Inferno

This is a site dedicated to the /9/grid, by hobbyist plan 9 grid node operators who thinks Plan 9 and related software and tech will revolutionize the net. Please point out improvements to make to this information, the setup of the qemu image file, and the g/toolkit scripts. This page is focused on a Plan 9 cpu server/grid node preinstalled qemu image. If you're interested in Inferno grid setup tips check the 9gridfaq page. You can look at the source code and manpages for the scripts here on this site, or at the g/ directory of sphericalharmony.com, which also has an archive of material of historical interest on the origins of the 4chan tecnolo/g/y board /9/grid project. A good faith effort will be made to keep everything updated, but the /9/grid has no central organization so no warranties are made.

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. This page is focused on setting up a cpu server, but please the g/toolkit is also included and ready to use in the image. A CPU server is a good choice for a grid node, but it is not necessary to set up a cpu server to access and provide grid services. Instructions for the scripts are contained in manpages and in a rough tutorial, but here's how you get started: 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!69.129.202.66!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.

Pre-installed Plan 9 CPU server + g/toolkit + goodies download and install

DOWNLOAD compressed qcow img file, then untar it

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 us 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. 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. In linux, its easy to use 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.

The following instructions assume Linux is the host OS, but qemu and Plan 9 work fine under windows also. A windows how-to covering this material would be appreciated. Note that the instructions executed inside the VM are the same no matter which host OS you are using. Instructions taking place outside of the VM will be noted. First, outside the VM, uncompress the image. In linux,

tar -xzf gPlan9.qcow.img.tgz

and next, to start the emulator,

qemu -hda gPlan9.qcow.img

You need to start by booting the term kernel inside the emulator. Instructions from here on are almost all for INSIDE the qemu virtual machine:

sdC0!9fat!9pcf

At the next option, press return to accept the default boot path and then 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

./configscript

and giving your IP and system name when prompted, you can do

fshalt -r

in your shell.

On reboot, change the boot option to what you will use for cpu server:

sdC0!9fat!9pccpuf

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:

bootes

yourcpunode

sectore not setup by default, leave blank

YOURPASSWORD

and then do

auth/changeuser bootes

setup that account, and

auth/changeuser glenda

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. OUTSIDE THE VM LINUX SHELL CODE -- requires superuser privileges.

iptables -t nat -A PREROUTING -p tcp --dport 567 -j REDIRECT --to-port 2567

iptables -t nat -A OUTPUT -o lo -p tcp --dport 567 -j REDIRECT --to-port 2567

then starting qemu like this:

qemu -hda gPlan9.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:

192.168.1.101 cpunodetwo

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 you have /lib/ndb/local setup correctly:

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/mouse $mouseport

aux/vga -m vesa -l 1024x768x8

exec rio


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 do

auth/changeuser USERNAME

and setup their password. Following that, you can connect as that user from linux:

drawterm -a yourcpunode -c yourcpunode -u USERNAME

and on your first connection do

/sys/lib/newuser

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.

9fat: /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

bootes YOURSYSNAMEHERE

for the first two prompts

please report all the dumb stuff I did that needs fixing to:

plan9grid@sphericalharmony.com


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