Notes on Drawterm and cpu/auth settings

Plan 9 Remote CPU

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

Some experience with sam or ed is advised

Base configuration

Enabling the CPU service

Mount 9fat and add service=cpu to plan9.ini.

Reboot the machine.

% 9fs 9fat
% sam -d /n/9fat/plan9.ini
-. /n/9fat/plan9.ini
a
service=cpu
.
w
q
% fshalt -r

Listening to ports

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
2
bootargs=local!/dev/sdXX/fs
c
bootargs=local!/dev/sdF0/fs -m 192 -A -a tcp!*!564
.
w
q
% fshalt -r

If you choose cwfs:

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

Configure network

Get parameters from the network database

% ndb/query sys $sys
ip=10.0.2.2 ipmask=255.255.255.0 ipgw=10.0.2.1 sys=rixe dns=4.2.2.2
sys=rixe ether=52540000ee03

Configure your network according to these parameters.

% sam -d /lib/ndb/local
-. /lib/ndb/local
33
# example: adjust to fit your network
34,47 p
auth=rixe authdom=9front
ipnet=9front ip=10.0.2.0 ipmask=255.255.255.0
        ipgw=10.0.2.1
        dns=4.2.2.2
        auth=rixe
        dnsdom=9front
        cpu=rixe
        fs=rixe
#        smtp=cirno
#
#ip=192.168.0.99 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
Password:
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

Drawterm

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.

Get your 9front machine’s ip.

% netaudit
checking this host's tuple:
	ip=10.0.2.2 looks ok
	no dom= entry
	no ether entry
checking the network tuple:
	we are in ipnet=9front
	ipgw=10.0.2.1 looks ok
	dns=4.2.2.2 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 10.0.2.2 -h 10.0.2.2 -u $user

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