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
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

rcpu

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

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=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/.

1 Incoming Links

secstore