Notes on Drawterm and cpu/auth settings

Plan 9 Remote CPU

This guide will allow your host machine to connect to a 9front machine running in a VPS, or on your network or in a VM.

Some experience with sam is advised. Don’t reboot until everything down here is done, it will make your life easier.

Base Configuration

Creating User

Creating your own user depends on which file server you chose during the installation. In the following commands, replace $fs by either cwfs or hjfs, and $user by the desired username.

% echo newuser royniang >> /srv/$fs.cmd
% echo newuser upas +$user >> /srv/$fs.cmd
% echo newuser sys +$user >> /srv/$fs.cmd
% echo newuser adm +$user >> /srv/$fs.cmd

You can reboot your machine and log in as your new user when you are prompted to. Execute /sys/lib/newuser to populate your new $home and to launch a fresh rio session!

Enabling the CPU Service

Execute 9fs 9fat and edit /n/9fat/plan9.ini to add service=cpu on its own line. If you created an user ealier, you can also add a line with user=$user. During future reboots, you will be prompted to confirm the file server to use. To disable this behavior, edit bootargs for nobootprompt without changing the file server variable.

Setting up the auth Server

You’ll be prompted to choose an authid, an authdom and a secstore key.

authid is your $user, authdom can be anything. Remember your secstore key as it will be your password.

I use hjfs. If you use cwfs, you should get a different configuration prompt. Answer to it with noauth.

Edit plan9.ini again.

If you choose hjfs:

% 9fs 9fat
% sam -d /n/9fat/plan9.ini
-. /n/9fat/plan9.ini
bootargs=local!/dev/sdF0/fs -m 192 -A -a tcp!*!564
% fshalt -r

If you choose cwfs:

% 9fs 9fat
% sam -d /n/9fat/plan9.ini
-. /n/9fat/plan9.ini
bootargs=local!/dev/sdF0/fscache -a tcp!*!564
% fshalt -r

Configure Network

Get parameters from the network database

% ndb/query sys $sys
ip= ipmask= ipgw= sys=rixe dns=
sys=rixe ether=52540000ee03

Configure your network according to these parameters.

% sam -d /lib/ndb/local
-. /lib/ndb/local
# example: adjust to fit your network
34,47 p
auth=rixe authdom=9front
ipnet=9front ip= ipmask=
#        smtp=cirno
#ip= sys=cirno dom=cirno.9front ether=112233445566 

sys=rixe ether=52540000ee03

cpu and auth must match with $sys.

You have to use the same authdom that you defined earlier, and also use it for ipnet and dnsdom.

ip is a subset of the earlier ip we got with the query: replace the last number with 0.

ipmask, ipgw and dns must match the output of the query.

Set Up Authentication

Use the password you set earlier.

% auth/keyfs
% auth/changeuser $user
Confirm password:
assign Inferno/POP secret? (y/n) n
Expiration date (YYYYMMDD or never)[return = never]: 
2 keys read
Post id: 
User’s full name: 
Department #: 
User’s email address: 
Sponsor’s email address: 
user $user installed for Plan 9


Now that your machine is connected to the network and properly configured, you can connect to it from your 9front machine with rcpu -h $dom -u $user. See also rimport which can be useful if you want to locally work with remote files.


Drawterm is only useful to connect alien systems to Plan&nbps;9. It’s a nice companion to virtual machines since VNC is… VNC.

Get the source from 9front’s website. Audio might be an issue. The OpenBSD makefile should work on Linux with some corrections. It relies on sndio for audio. It also seems like drawterm only allow the hostowner to auth on the machine.

Get your 9front machine’s ip.

% netaudit
checking this host's tuple:
	ip= looks ok
	no dom= entry
	no ether entry
checking the network tuple:
	we are in ipnet=9front
	ipgw= looks ok
	dns= looks ok
	auth=rixe looks ok
	fs=rixe looks ok
checking auth server configuration:
	we are the auth server
	auth/keyfs is running
	someone is listening on port 567
	run auth/debug to test the auth server
	run auth/asaudit to verify auth server configuration

On your host machine, launch drawterm.

$ drawterm -a -h -u $user

You can use the host’s filesystem from Plan 9 at /mnt/term/.

1 Incoming Links