-
Notifications
You must be signed in to change notification settings - Fork 8
"Plan 9" is unique system (from UNIX creators). However it may be hard to grasp first.
Main characteristics:
- everything is file (including env, sockets)
- because everything is file there are possible many neat tricks:
- irc or http client and http server is written in shell (!)
- even terminal windows uses files for operations, for example
/dev/text
is completed buffer of your terminal window so you can for example grep it -
/dev/snarf
is clipboard - you can read it or modify it - similarly works mouse and keyboard
- fully UTF-8 compatible (Plan9 authors invented UTF-8)
- transparently distributed system - remote resources (CPU, files, ...) can be just mounted on local machine and accessed as local files
- full namespace support - each process has its own view of filesystem
NOTE: There are several distributions of Plan9 - I tested 9front flavour.
Quick install:
- page: https://9front.org/iso/
- downloaded ISO: https://9front.org/iso/9front-10653.amd64.iso
Installed system under Proxmox (disk: VirtIO BLK, network: VirtIO NET).
- Do NOT use
lvm-thin
- copying will take forever. I suspect that there is significant write amplification - I use qcow2 on ext4 (because I will need snapshots, otherwise I would use raw),
cache: unsafe
- 1 CPU, 2 GB RAM
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 and Hold on empty background
- move mouse to
New
menu item and release Right button - when Cross (
+
) appears again Right-click (important) and hold - draw new Window - move mouse to draw rectangle of new window. When done - release button and Terminal will start in that rectangle area.
You can use man ITEM
for most commands...
System info - run sysinfo
script.
Most commands are in /rc/bin
(try ls /rc/bin
).
How to shutdown:
fshalt
Terminal window is called rio(1)
and it works like full screen editor.
I strongly recommended watching at least these YouTube Videos for introduction:
- Introduction to getting around. The User Interface of Plan9 / 9Front
-
Some Useful Tools in Plan9. Mouse Chording, VT, and Acme
Created by
@adventuresin9
.
NOTE: Autoscroll is disabled by default. You have two choices:
- press ENTER to show next page
- click-and-hold Middle button and select
scroll
and release Middle button - this will enable auto-scroll
Selecting text - again 2 choices: a) double-click on text to select word or text inside quotes b) left-click and hold left button - move mouse to select text - but see below for details.
Copy/Cut & Paste using "chords":
- left-click and hold left button - select text - still hold left-button
- now also press middle button (keep holding left-button) - it will Cut text 2.b) if you want to Copy instead of cut - still hold left and middle button. Additionally press Right button - text will be pasted back - same effect as Copy.
- release all buttons (I'm rather releasing from Right to Left)
- position mouse to place where you want paste text
- left-click, hold and right-click - text will be pasted
- release all buttons
Copy/Cut & Paste using menu:
- select text with any method - release left-button when selection is done
- Middle click and hold to show menu. Select Snarf (Copy) or Cut and release mouse button
- Position your mouse to place where you want paste text
- Middle click and hold to show menu. Select Paste and release mouse button.
Other menu items:
- plumbing -> will open selected file in application (typicaly in
page
viewer) - send -> will run command in clipboard
- Use
Del
key instead ofCtrl
-C
to stop program - To find assigned IP address:
cat /net/ndb
ornetstat -i
- To see routing tables
cat /net/iproute
- most scripts are under
/rc/bin
- default shell (equivalent of
/bin/sh
under Unix) is namedrc
- tryman rc
Generating graphical manual pages (from Video tutorial):
- example:
man -t rio | page -w
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
.
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
Default plan installation is so called "standalone terminal" - single user. Although it is possible to run "manually" some services as single user it is not standard way.
There are at least 2 guides:
Or:
- https://9p.io/wiki/plan9/Expanding_your_Grid/index.html
- https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
Trying:
- http://wiki.9front.org/cpu-setup
- verify that we are now in
terminal
(single user + GUI) mode:echo $service terminal
- note also sysname:
echo $sysname Server1
- create new hostowner user
kvik
:con -C /srv/cwfs.cmd newuser kvik newuser sys +kvik newuser adm +kvik newuser upas +kvik
- to exit
con
you have to:- press
Ctrl
-\
(documented) - press
ENTER
to get>>>
prompt (undocumented!) - press
q
followed byENTER
to quit
- press
- now reboot with
fshalt -r
- on boot remember to enter new hostowner name
kvik
(instead ofglenda
) - there will be error message regarding
./lib/profile
we have to fix it with:/sys/lib/newuser
- it will boot empty
rio
- to create terminal - click and hold right-button, select
New
, release button - and draw window.
- verify that
./lib/profile
now exists with:ls -l $home/lib/profile
- again reboot with
fshalt -r
- again enter username
kvik
- now empty
rio
should start without errors.
TODO: verify
To study:
- https://9p.io/wiki/plan9/drawterm_to_your_terminal/index.html
- note in both cases there
1
(NOT lowercase "l") in bothproto=p9sk1
andaux/listen1
- you can get IP address of your Plan 9 server with
netstat -in
On your client you have to build drawterm
- https://github.com/9fans/drawterm/
- under openSUSE LEAP 15.6 I have to install also
libXt-devel
(to avoid error not findingX11/Intrinsic*.h
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
Interesting stories:
- http://helpful.cat-v.org/Blog/2019/12/03/0/
- important guide to Plan9: https://pspodcasting.net/dan/blog/2019/plan9_desktop.html
- interesting and helpful videos: https://www.youtube.com/@adventuresin9797/videos
Copyright © Henryk Paluch. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License