Plan 9, /9/grid, Inferno

UPDATED: January 30, 2008 - new release, version 1.1

This is a site dedicated to the /9/grid, by hobbyist plan 9 grid node operators who think Plan 9 and related software and tech will revolutionize the net. Please point out improvements to make to this information, the setup of the VM image file, and the g/toolkit scripts. This page is focused on a Plan 9 cpu server/grid node preinstalled 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. the g/ directory of sphericalharmony.com 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.

There are several resources here including a preinstalled VM image (prepared with qemu) of a fully installed plan9 with the grid toolkit, 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. This page is focused on setting up a cpu server, but 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.

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

DOWNLOAD compressed .qcow img file

md5sum: e54d5b5d4415069cc945d6fef3deba2a

then untar the gzipped archive. Please note that the default system is named 'gridnode' and that both bootes and glenda have the password 'gridnode'. The initial autostart puts you in terminal mode as glenda with no remote services enabled. The qemu .qcow is qemu-specific but should be cross-platform on different qemu versions. It was produced on an ubuntu 8.04 qemu current as of January 09. Let us know about comptability. If you are using qemu, the qcow will be more space efficient. This .img is configured targeting the 'typical residential' internet user, with auto-dhcp at startup. You can use 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.

The following instructions are slightly Linux focused, but windows-specific differences will be noted. Qemu and Plan 9 work fine on all platforms. There are screenshots for much of this on both platforms at the walkthrough screenshots gallery. 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 and using qemu:

tar -xzf gPlan9.qcow2.img.tgz

and next, to start the emulator in Linux

qemu -hda gPlan9.qcow2.img

Windows users need to cd to the directory containing the qemu emulator and the hard drive image, and start with a similar command:

qemu.exe -L . -hda gPlan9.qcow2.img

The initial boot to a terminal kernel has been configured to happen automatically. Everything is fully functional and ready to go.

CPU Server Setup for Local or Remote access

Plan 9 is designed for use as a distributed system. Even if you are just running it on one machine in a VM, there are advantages to making use of the capabilities designed for sharing resources across the network. Running your VM as a CPU server and connecting to it with a program such as Drawterm (or 9vx) usually provides better performance and flexibility than using the VM's gui. The easiest way to do this is start qemu with -redir tcp:port::port -redir tcp:port::port — the default ports are 567 for auth and 17010 for the cpu server itself. Windows command line for starting qemu with cpu server/drawterm port redirections:

qemu.exe -L. -hda gPlan9.qcow2.img -redir tcp:567::567 -redir tcp:17010::17010

Other redirections can be placed for other services if needed. In Unix derived systems, the restriction on low numbered ports means you need to either run qemu as root (not recommended) or setup a simple port redirection. In linux the following code is 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.qcow2.img -redir tcp:2567::567 -redir tcp:17010::17010

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 be able to connect with drawterm from the same machine the VM is running on with (Linux)

drawterm -a 127.0.0.1 -c 127.0.0.1 -u glenda

Windows uses the same command but without the -u glenda at the end. drawterm -a 127.0.0.1 -c 127.0.0.1 - you enter the user when you conect.

From within a separate 9vx or plan 9 install, you need to edit /lib/ndb/local to add information for the CPU server and then echo -n refresh >/net/cs. Then

cpu -h gridnode

The default install is named 'gridnode' and bootes and glenda both have the password 'gridnode'. It's fine to use this initial setup to test things out, but please change the default passwords and system name using the configscript (or at least the passwords using auth/changeuser on bootes console) before allowing connections to your system from the wider internet.

Your session starts up with some instructions in the RC shell and the default readme files open in acme. If you want to configure a cpu server, 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

in your shell.

On reboot, choose the CPU server boot option. 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

YOURSYSNAME

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.

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.


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!9gridchan.org!7888 reg1

and after that you are inside a grid session and can read the manpages. The scripts are installed in /bin/g so you can see whats available there.


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, IRC7, and contrib/install are notable.

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 to display /9/grid docs on opening. Edited plan9.ini to provide boot menu.

Added configscript to Glenda's home directory to automate setting up machine IP and sysname.

Glenda's home directory contains just about all the new additions.

Thanks to everyone who's helped out on #plan9chan on irc.freenode.net