~kvik/wiki.9front.org

ref: 8ee53648d03717755391329a02d2784f9d7424be wiki.9front.org/9p-on-unix.md -rw-r--r-- 1.4 KiB
8ee53648kvik 9p-on-unix: add section about 9pfs+tlsclient (thanks foura) 1 year, 2 months ago

#Mounting 9P on Unix-like operating systems

#9pfs

Under GNU/Linux and *BSD operating systems it is recommended to use 9pfs to mount 9p services.

OpenBSD:

doas 9pfs -o allow_other 9front /mnt

#9pfs and drawterm

When using drawterm it is possible to serve a 9P connection directly to the host system by binding /mnt/term/net over /net and starting exportfs(1) like shown in the script below

#!/bin/rc
	
rfork n
bind /mnt/term/net /net
aux/listen1 -t tcp!*!12345 /bin/exportfs -r / &
os mkdir -p /tmp/drawterm
os 9pfs localhost -p 12345 /tmp/drawterm

It requires 9pfs to be installed. A side bonus of doing it this way is, that it uses the drawterm's aan connection to keep the 9p connection up.

#9pfs and tlsclient (dp9ik / rcpu)

It is possible to use moody's tlsclient UNIX port for authenticated tls-encrypted 9p connections using the following script:

#!/bin/sh
export CPU=<cpu server>
export AUTH=<auth server>
export USER=<username>
export PASS=<password>
	
socat unix-listen:/tmp/9psock exec:"9cpu -r /" &
exec 9pfs -U /tmp/9psock /mnt

#v9fs

The Linux kernel contains a 9p driver that can be made to mostly work with 9front systems. Two things to keep in mind however:

  • Auth will not work
  • Currently file creation is broken.

Mounting:

sudo mount -t 9p -o version=9p2000,port=564,trans=tcp your.9p.server /mnt/9p