P9 - hpaluch/hpaluch.github.io GitHub Wiki

Plan 9

"Plan 9" is unique system (from UNIX creators). However it may be hard to grasp first.

NOTE: There are several distributions of Plan9 - I tested 9front flavour.

Quick install:

Installed system under Proxmox (disk: VirtIO SCSI, network: VirtIO NET).

There is really good installation guide - and mostly you just press enter when asked for something:

Both installation (and after installation) runs GUI called rio(1) very good intro is at:

How to create new terminal window:

  • right click on empty background
  • release right-button on New menu item
  • when Cross (+) appears again Right-click (important) - draw new Window
  • on release of rigth-button new terminal will appear and will be ready.

You can use man ITEM for most commands...

System info - run sysstat script. Most commands are in /rc/bin (try ls /rc/bin).

How to shutdown:

fshalt

Random tips

  • To find assigned IP address: cat /net/ndb or netstat -i
  • To see routing tables cat /net/iproute
  • most scripts ar under /rc/bin
  • default shell (equivalent of /bin/sh under Unix) is named rc - try man rc

Building docs

Try:

cd /sys/doc
mk

Should generate lot of *.ps files in /sys/doc

WARNING! OpenSUSE Viewer (gv) is somehow broken (strange rendering of fonts). However you may use ps2df file.ps (included with ghostscript package) and then evince file.pdf.

Serving filesystem from Plan9 server to Linux client

After lot of digging found working example on: https://mitjafelicijan.com/mount-plan9-over-network.html

On Plan9 I run:

ip/ipconfig # enables network
aux/listen1 -tv tcp!*!9999 /bin/exportfs -r /sys/src

On Linux client:

mount -r -t 9p -o version=9p2000,port=9999,trans=tcp IP_ADDRESS_OF_PLAN9_SERVER /mnt/9p
# should see contents of /sys/src
ls -l /mnt/9p

Connecting remotely

TODO (Plan 9 has integrated support for distributed access).

To study:

On your client you have to build drawterm

TODO:

Probably this guide is most close: http://wiki.9front.org/cpu-setup

Problems:

  • there was nothing listening on port 5356 (secstore) I tried to run on plan9:
    auth/secstored
    
  • I then run on client (Linux) machine:
    drawterm -a IP_OF_PLAN9 -c IP_OF_PLAN9 -u genda -d -d -d
    
  • but on terminal there was error:
    cpu: negotiating authentication method: IP_OF_PLAN9:
    
    goodbye
    
  • on plan9 server terminal there was error:
    incoming call for tcp!*!ncpu from CLIENT_IP in /net/tcp/4
    aux/listen1: exec directory entry not found: /bin/cpu
    

It seems that I have to edit /n/9fat/plan9.ini and add service=cpu there... Following FAQ I have to mount with 9fs script - in case of VirtIO SCSI under Proxmox:

WARNING! Do not do that below - it will cause boot failure!!!

9fs 9fat /dev/sd00/9fat
# Do NOT use quotes "" - it will cause error
echo 'service=cpu' >> /n/9fat/plan9.ini
cat /n/9fat/plan9.ini

Resources

Interesting stories: