This is the 2nd1 tutorial for setting-up the Plan 9 from Bell Labs operating system in a VPS slice on SDF. This tutorial was aimed at participants in the SDF Plan 9 Boot Camp including 9front PARODY2, but should be useful for SDF VPS user review. More recently3, the Boot Camp participants are studying virtualized amd64 9front, located on another VPS. If you were using the 9front PARODY VPS, thank you for your participation. A redirect to the SDF VPS - Plan 9 / 9Front home, includes SDF html and wiki tutorial links.
1 Several HTML tutorials are mentioned, including https://sdf.org/tutorials/VPS_Plan9.html, the primary Plan 9 on SDF VPS tutorial. 2 9front PARODY VPS Boot Camp image will shutdown. 3 Recent communication about the Boot Camp amd64 9front VPS.
Plan 9 has active communities which mostly interact by email. You are encouraged to join the 9fans mailing list where discussion about Plan 9, and related technologies occur.
SDF hosts the plan9-l mailing list for participants in the Plan 9 Boot Camp. Email 'majordomo' and 'subscribe plan9-l' to join.
Of the various VPS that SDF offers1, the SDF Plan 9 Boot Camp VPS is the only VPS provided without subscription, to SDF MetaARPA2 members. The Boot Camp VPS slice includes cluster access to the SDF Plan 9 Community 9p server. With your help, Plan 9 participation at SDF can continue to promote networking, learning and participation. To request an SDF Boot Camp Plan 9 VPS, type “plan9” at the SDF shell3 (
After receiving notification of an allocated VPS slice, connect by “
$ ssh <SDF member ID>@<VPS slice>.sdf.org”. The password1 is the same as your SDF member login. At the VPS Maintenance Shell menu, type “x” for a Clean Install. If asked to install from the ISO, type “no”. (During a previous Boot Camp, there was an option to install from the Plan 9 iso image; at the time of this Boot Camp, the VPS Maintenance Shell is without an iso image install option.)
Do you wish to continue? (yes/no) yes Would you like to install Plan 9 yourself from the ISO? (yes/no) % Copying a fresh plan 9 image [PLEASE WAIT] [COMPLETE] (continue)
Once the install has completed, press the “[Enter]” key to return to the SDF VPS Maintenance Shell menu; then press the “r” key to reset or restart2 the instance.
1 A VPS password change option is available from the VPS Maintenance Shell, after login. 2 Other options are “l”, “q” and “p”, review the SDF VPS Maintenance Shell for details.
When the Plan 9 system boots, it will ask where root is from (the network, or a local disk). Just press the “[Enter]” key to select local (the default), “root is from (tcp, local)[local!#S/sd00/fossil]:”. Next, there will be prompt to login. Login as the Plan 9 default user: “glenda”.
user[none]: glenda time... fossil(#S/sd00/fossil)...version...time... init: starting /bin/rc #m/mousectl: rc: can't open: unknown device in # filename init: rc exit status: rc 24: error init: starting /bin/rc
You will now see the Plan 9 VPS console rc prompt (%), Plan 9's shell.
|Plan 9 Rc shell||Plan 9 Rc Survival Guide|
|% sam -d||Editing will be done with the command language only, as in ed.|
While at the VPS Maintenance1 Shell menu for “<VPS slice>.sdf.org”, note YOUR_IP (e.g., 205.166.94.xx) address on the top line of the VPS Maintenance Shell. Press the “l” key to list the status. Press the “r” key to start your server if it's not running, and login via the VPS Plan 9 console using the default user (default=glenda). At the Plan 9 rc prompt (%), enter: “ip/ipconfig -g 188.8.131.52 ether /net/ether0 YOUR_IP 255.255.255.0”
% ip/ipconfig -g 184.108.40.206 ether /net/ether0 YOUR_IP 255.255.255.0
This configuration remains active until a reboot of the Plan 9 os. To make this configuration permanent, it is recommended to add this line to your “/rc/bin/termrc.local” file. To detach the VPS Plan 9 console prompt (%), and enable a reattachment without rebooting the server, see above.
1 Other Maintenance Shell menu options are “l”, “c” “q” and “p”; review the SDF VPS Maintenance Shell for details.
You can set DNS resolution by editing “/lib/ndb/local”, replacing “ip=127.0.0.1 sys=localhost dom=localhost” with “ip=YOUR_IP sys=plan9 dom=plan9 dns=220.127.116.11”. The mentioned “/lib/ndb/local” edit (with ed or sam -d) can be postponed until the initial Drawterm connection is established, where another editor (sam, ed, acme) choice is available. Once the DNS is set, from the VPS console rc prompt (%) type “ndb/cs” and press [Return], then “ndb/dns -r” and press [Return].
% ndb/cs % ndb/dns -r
This configuration is retained until a reboot of the Plan 9 os. To make this permanent, it is recommended to add the two lines to your “/rc/bin/termrc.local” file. To detach the VPS Plan 9 console prompt (%), and enable a reattachment without rebooting the server, see above.
Drawterm1 is essentially a BLIT terminal emulator which allows you to connect to your Plan 9 system and load the Rio windowing system. Rio is a direct successor of UNIX 'layers' and Plan 9 '8½'. At the Plan 9 VPS console “rc” prompt (%), enter these two separate lines. Replace PASSWORD with a new Drawterm password, for later use.
% echo 'key proto=p9sk1 dom=plan9 user=glenda !password=PASSWORD' >/mnt/factotum/ctl % aux/listen1 -t tcp!*!ncpu /bin/cpu -R &
|Although missing from the “
Verify the Drawterm command line syntax with the “
–help” option, if needed. A 9front2 Drawterm comparison is provided.
|Plan 9 Drawterm command||Plan 9 Drawterm output|
|9front Drawterm command||9front Drawterm option -h and Plan 9 Drawterm option -c comparison|
|9front Drawterm command||9front Drawterm output|
1 Drawterm is a X11 application that allows one to connect to a remote Plan 9 server…; a graphical client for Plan 9 CPU servers. https://directory.fsf.org/wiki/Drawterm 2 DRAWTERM http://git.9front.org/plan9front/drawterm
$ ./drawterm -a YOUR_IP -c YOUR_IP -u glenda
After typing your Drawterm password, the initial Rio display is a blank grey screen. The passing cpu: failed to chdir to message is not uncommon.
At the Rio blank grey screen, press the right button of your mouse. A menu should appear. Then, release the button over the “New” option.
There is a “Delete” option (above) in addition to the “New” option. This “Delete” option is useful. It will delete a window gracefully.
Now, press the right button again near the upper-left corner of Drawterm, and drag the mouse to the lower-right before releasing the button, drawing a rectangle.
You should now have a Rio terminal window, and rc prompt (%). The first thing you can do is to type “
cat readme.rio” (or read it from here if it's missing3).
To get ahead of yourself, knowing that you can use the “Delete” option (above Drawterm image) to close each new window gracefully, type “
riostart”4 at the Rio5 rc prompt (%).
1 Obtain the source code from http://swtch.com/drawterm/ 2 Drawterm is available as a package for many Linux-based distributions. 3 The file may be missing for a new user. It can be copied with “
% cp /usr/glenda/readme.rio readme.rio”. 4
% riostart https://sdf.org/tutorials/VPS_Plan9.html#riostart 5 You should now see a grey screen. This is rio, the Plan 9 window manager. http://doc.cat-v.org/plan_9/misc/rit-intro
When you have found a window layout that you like, you might like that persisted between sessions, so that you don't have to place the windows again. We can start rio using multiple ways. When we drawterm in our 9front vps the
$home/lib/profile script is executed. Since the service type (
echo $service) is of type cpu we see that rio is started as
rio -i riostart . Looking at the manual page we see that the -i option takes certain “window” commands that instruct rio in what positions to load the windows and which application to run in them, it also mentions the
wloc command which prints the window layout for the current session. By putting the contents of wloc in the
$home/bin/rc/riostart script then we can have a persistent layout on all rio sessions.
Sam is a text editor. While the cursor is over the sam window, press the right button of your mouse and drag the cursor over the file name. Release the right mouse button once the cursor is over the file name. The cursor pointer will change to a square. Press the right button, while the square cursor is over the lower panel, to load the file in the lower panel.
% sam /rc/bin/termrc.local
A few words about (w) writing the file, and how to (q) quit “sam”. Commands (sam -d) are typed in the upper panel, while edits are typed in the lower panel. Press the left mouse button to activate the upper panel, or the lower panel. Type a 'w' in the upper panel, then press the carriage return. This saves the file. Type a 'q' in the upper panel, then press the carriage return. This quits “sam”.
Sam uses it's own cut/paste buffer. Exchange it with Rio's cut/paste buffer by using the <rio> option in the middle button (2) menu of sam.
The following edit (
% sam -d) will work from the VM console rc prompt, or from the upper sam panel.
% mkdir samlearn % cd samlearn
% cp /lib/ndb/local local2 % sam -d local2 -. local2 /ip= "Press the Carriage return, following the line output." s/ip=/#ip= $+1 a ip=YOUR_IP sys=plan9 dom=plan9 dns=18.104.22.168 . w q %
% cp /rc/bin/termrc.local termrc.local2 % sam -d termrc.local2 -. termrc.local2 $+1 a ip/ipconfig -g 22.214.171.124 ether /net/ether0 YOUR_IP 255.255.255.0 ndb/cs ndb/dns -r . w q %
% cd samtest % cp /lib/ndb/local local-1ed
% ed local-1ed 291 /ip= ip=127.0.0.1 sys=localhost dom=localhost s/ip=/#ip= #ip=127.0.0.1 sys=localhost dom=localhost $ #ip=127.0.0.1 sys=localhost dom=localhost a ip=YOUR_IP sys=plan9 dom=plan9 dns=126.96.36.199 . w 341 q %
% cp /rc/bin/termrc.local termrc.local-1ed % ed termrc.local-1ed
% ed termrc.local-1ed 424 $ cpu=CP a ip/ipconfig -g 188.8.131.52 ether /net/ether0 YOUR_IP 255.255.255.0 ndb/cs ndb/dns -r . w 510 q %
|ED||ed Cheat Sheet||http://sdf.org/?tutorials/ed|
A brief mention of acme, for those who are attending the SDF Plan 9 Boot Camp.
|A Tour Of The Acme Editor||https://archive.org/details/atouroftheacmeeditor|
|Acme Editor, Acme Mail, Plan 9 demo (short)||https://www.youtube.com/user/slawmasta|
|A command from sam can be typed in acme||http://sam.cat-v.org/cheatsheet/|
|Section: 3.5. Editing commands||http://www.covingtoninnovations.com/michael/blog/0807/newbie-guide.pdf|
|C Programming||Plan 9 C Programming|
|http://acme.cat-v.org/||The Acme User Interface for Programmers|
|Plan 9 Acme videos||Plan 9 Acme Intro - Part 1, 2, & 3|
|acme||interactive text editor and shell|
|sam||screen editor with structural regular expressions|
1.) From a Plan 9 Rio rc prompt.
You can use Abaco to browse the web1. (Abaco is available in a default Plan 9 system.) You'll need to have your IP configured and DNS working in order to browse the web. After that, you'll have to run “webfs” and then2 “abaco”. If you don't have a “/usr/$user/lib/webcookies” file, touch it once. (You may want to add “webfs” in your “$home/lib/profile” just before plumber and rio.)
% touch /usr/$user/lib/webcookies
% webfs % abaco
It's possible to use
readweb3 without running
% readweb http://sdf.org/?tutorials/Plan_9_rc
When abaco starts, you can go to a webpage by clicking “New” with the middle button of the mouse, typing the address in the row below the one with “Del Snarf Get …” (see the previous figure: it's the one where the current legacy address is), and pressing “[Enter]” on your keyboard. You can follow links by clicking on them, as is usual, with the left button (the shape of the cursor won't change, though).
% man -P readweb
1 An http URL. 2 Both commands are used on one line with a separator: “
% webfs; abaco”. 3 Another way to run Abaco.
The “webfs” process is used to illustrate the “slay” command. The “ps” (
% ps | grep webfs) command will show the processes.
% webfs % webfs
% slay webfs
Press the left mouse button to highlight (grey) the “slay” output text. Press the middle mouse button to select “send”. Release the middle mouse button to complete the “send” to rc (
% slay webfs | rc).
You may want to add1 a user to your system once you get the hang of things. There is really no need to create a new user when you are first starting out. It's safer to use the Drawterm Rio rc prompt (%) for the following task, should there be a need for the “[Backspace]” key.
To create a new user, you must connect to the file server console by typing: “con -l /srv/fscons”. Once at the file server prompt (
prompt:), create a new user. Replace USER with what you want your new user to be named: “uname USER USER”. You will need to add that USER to the “sys” group if you want it to be able to change system configuration files. Again, change USER to what your new user name is: “uname sys +USER”. Exit the file server console prompt (
prompt:) by typing: “ctrl+\”. You will now be at the “
> > >” prompt; type “q” to quit the “
> > >” prompt.
% con -l /srv/fscons prompt: uname USER USER prompt: uname sys +USER prompt:
prompt: >>> q %
The following steps assume that you have edited files while user “glenda”, have run “% fshalt” from the VPS console rc prompt (%), been able to “[r] - reset or start” the VM from the VPS Maintenance Shell, and have used Drawterm successfully. Enter the new “USER” name after a VPS Maintenance Shell “reset or start”.
|This “user glenda task:”, or “font task”, is now a cautionary note (06 Oct 2020). Use the next line to determine.|
|Due to the recent SDF 9xen image, 9front PARODY, an edit to “/sys/lib/newuser” is needed before proceeding.|
|The line “font=/lib/font/bit/vga/unicode.font” can change to “font = /lib/font/bit/pelm/unicode.8.font” or “font = /lib/font/bit/pelm/unicode.9.font”|
user[none] ← Enter new “USER” name.
Verify your new “USER” login with
lc -l. Stop if
pwd does not show your new “USER” name.
Initialize the new user environment2 with
% /sys/lib/newuser, from the VPS console Plan 9 prompt (%).
At the VPS console Plan 9 rc prompt (%), enter these two separate lines. Replace “new_USER_name” (below) with the new “USER” name.
% echo 'key proto=p9sk1 dom=plan9 user=new_USER_name !password=PASSWORD' >/mnt/factotum/ctl % aux/listen1 -t tcp!*!ncpu /bin/cpu -R &
Start Drawterm from the local operating system.
$ ./drawterm -a YOUR_IP -c YOUR_IP -u USER
You might want to configure your system's timezone1. Identify the timezone with “lc” (
% lc /adm/timezone). Assuming that the CET time zone is appropriate, login as the user “adm” and “cp /adm/timezone/CET /adm/timezone/local”. Last, login as the user “glenda” and edit the “TIMESYNCARGS” line in the “/rc/bin/termrc” (or “/rc/bin/cpurc”), using an NTP service. Set it to “TIMESYNCARGS=(-n pool.ntp.org)” and reboot.
% lc /adm/timezone
% cp /adm/timezone/CET /adm/timezone/local
% sed 5q /rc/bin/termrc #!/bin/rc # terminal startup #TIMESYNCARGS=(-rLa1000000) TIMESYNCARGS=(-n pool.ntp.org) NDBFILE=/lib/ndb/local %
% sam /rc/bin/termrc
1 Taken from Plan 9 Wiki Installation Instructions, SETTING UP CORRECT TIMEZONE section.
When using Drawterm1 to connect to the SDF Plan 9 cpu server, your local files will be available at “/mnt/term”: “
% lc /mnt/term”. You can copy files between the SDF Plan 9 VPS and your local os without the use of additional protocols. In other words, when working with Drawterm, your environment is a composite of your local os and the Plan 9 system – technically it is a three node grid, because the Drawterm program acts as an ultra-minimal independent Plan 9 terminal system, connecting your host os to the SDF Plan 9 cpu server.
% lc -l /mnt/term
1 Taken from Expanding your Grid …CPU AND DRAWTERM CONNECTIONS BETWEEN MULTIPLE MACHINES.
While there are many similarities between UNIX and Plan 9, there are specific commands which may be unfamiliar1 to UNIX users. However, some of these commands have their roots in early UNIX systems as well as BTL Research UNIX.
% fshaltfrom the Plan 9 VPS console rc prompt (%), then at the “VPS Maintenance Shell” select [r] - reset or start.
% fshaltfrom the 9front VPS console rc prompt (%), then at the “VPS Maintenance Shell” select [r] - reset or start.
% fshaltfrom a Drawterm Rio rc prompt (%), is okay. Close the local Drawterm application separately.
% fshalt syncing.../srv/fscons...prompt: venti... halting.../srv/fscons... prompt: done halting
Press ctl-] to continue, if viewing where the VPS console rc prompt (%) once was.
Press the “[Enter]” key to access the VPS Maintenance Shell. From the VPS Maintenance Shell Press [r] - reset or start, or [q] - Disconnect.
From the VPS Maintenance Shell Press [s] Force Shutdown (not an OS shutdown) before starting the SDF 9front VPS. Ping the SDF Plan 9 VPS IP address (YOUR_IP) to determine if the VPS is running with networking.
1 README (slightly outdated) If you think of it as UNIX, you'll often be frustrated because something doesn't exist or works differently. 2 The “-r” option may cause problems, please avoid.
|1||Due to the recent SDF 9xen image, 9front PARODY, some content in this section is redundant.|
|2||The SDF 9xen 9front PARODY effort integrated selected 9front programs, for the convenience of Boot Camp participants.|
|3||9front to 9xen PARODY fixes are coming soon (07 Oct 2020).|
|4||A 9front VPS is ready for rehearsal, or release, (09 Oct 2020). Recent communication|
|5||evaluate 9front redirects to 9front on an SDF VPS.|
From the SDF shell prompt:
$ ls /ftp/pub/sdf/plan9/dist/9front/386/bin
From the SDF Plan 9 Rio rc prompt:
% mkdir /usr/$user/testbin % ftpfs -a firstname.lastname@example.org ftp.sdf.org % cp /n/ftp/pub/sdf/plan9/dist/9front/386/bin/mothra /usr/$user/testbin/mothra % cd /usr/$user/testbin % lc -l
At the Plan 9 Rio rc prompt, type “
cd te” then “
INS key provides an auto-completion feature within the Rio window system.
% cd te
% cd testbin % webfs % mothra -k
Evaluate 9front “mothra” with option “-k”:
% vt % ssh email@example.com
1 Run the 9front
vt command before the 9front
ssh command. 2 From the 9front man page: ssh [ -d ] [ -R ] [ -r ] [ -t thumbfile ] [ -T tries ] [ -u user ] [ -h ] [ user@]host [ -W remote!port ] [ cmd args …]
SDF periodically runs a Plan 9 Boot Camp which is open to anyone with an SDF user1 account. Of the various VPS that SDF offers2, the SDF Plan 9 Boot Camp VPS is the only VPS provided without subscription, to SDF MetaARPA3 members. These Plan 9 Boot Camps are announced about 30 days before they begin and are often set around the International Workshop on Plan 9 conference4. They are usually a seasonal occurrence and run for about 2 months.
Why learn Plan 9 as a group? Plan 9 wants a community. Yes you can learn a lot on your own but Plan 9 was designed with a network of machines and users in mind.
Activities of the SDF Plan 9 Boot Camp include:
During the SDF Plan 9 Boot Camp you are encouraged to make screenshots and videos of your Self Guided Discoveries and share your experiences on plan9-l to inspire others to do the same. Participants in the Plan 9 Boot Camps also get a contrib directory on
ftp://ftp.sdf.org (in pub/sdf/plan9/contrib). This directory persists and can be used perpetually for Plan 9 related sharing.
Discoveries, or challenges, are mentioned on plan9-l or live on twitch.
|Russ Cox's A Tour Of The Acme Editor||https://archive.org/details/atouroftheacmeeditor|
|Plan 9 demo, narrated by John Floren (full)||https://youtu.be/obKnSDbaBlw|
|Acme Editor, Acme Mail, Plan 9 demo (short)||https://www.youtube.com/user/slawmasta|
A self guided challenge:
|Plan 9: Not dead, Just Resting, Ori Bernstein|
|31:09 - The essence of Plan 9 is 9p and name spaces.|
SDF Fall 2020 Plan9 Boot Camp “Tea Note” Presentation5
Some “Tea Note” Presentation commands from the Rio rc prompt (%).
|date||date, clock - date and time||http://man.9front.org/1/date|
|file||file - determine file type||http://man.9front.org/1/file|
|hg||hg - Mercurial source code management system||http://man.9front.org/1/hg|
|memory||memory - print memory statistics in human-readable format||http://man.9front.org/8/memory|
|mk||mk, membername - maintain (make) related files||http://man.9front.org/1/mk|
|plumb||plumb - send message to plumber||http://man.9front.org/1/plumb|
|plumber||plumber - file system for interprocess messaging||http://man.9front.org/4/plumber|
|sshfs||sshfs - secure file transfer protocol client||http://man.9front.org/4/sshfs|
|sysinfo||sysinfo, sysupdate - report information about, update the system||http://man.9front.org/1/sysinfo|
|sysupdate||download latest sources||
|who||who, whois - who is using the machine||http://man.9front.org/1/who|
Other “Tea Note” Presentation examples from the Rio rc prompt (%).
|Some hints about Plan 9|
|Plan 9's system console is a TTY, not a VT|
|In UNIX almost everything is a file, in Plan 9 everything is a file|
|Plan 9 is more like UNIX than Linux is like UNIX|
|Environment variables are stored and manipulated in /env|
|System configuration is in /cfg|
|Login configuration is in /rc/bin (termrc or cpurc, also .local files)|
|System types: cpu vs. term|
|Hello World, an example||
These communication resources are dependent on the preference of the “Boot Camp” participants, during a scheduled SDF Plan 9 Boot Camp. Some previous timely resources are
$ com, plan9-l,
$ bboard, mastodon.sdf.org, and wiki.sdf.org. The resources are mentioned in below.
|room 'plan9' in 'com'|
% readweb http://doc.cat-v.org/plan_9/2nd_edition/README.html
% topng </dev/screen >screenshot.png % png screenshot.png
INSkey provides an rc prompt auto-completion feature, within the Rio window system.
|Plan 9 from Bell Labs||https://9p.io/plan9|
|Glenda, the Plan 9 Bunny||https://9p.io/plan9/glenda.html|