Abstract Presents step-by-step instrunctions to define a virtual hard drive and virtual machine in a suitable GNU/Linux host, then install the August 2, 2014 version of the Bell Labs plan9.iso therein producing a functional Plan 9 stand-alone terminal. |
Except where otherwise noted, content in this document
is licensed under the standard Creative Commons
Attribution–ShareAlike 4.0 International License.
|
Up: Top |
Click on the lines following to jump down to their content:
Subsection 3-1: Define the Virtual Disk
Subsection 3-2: Download the Plan 9 Installation ISO
Step 3-2-1: Enable vmadm to Create Images
Step 3-2-2: Download the ISO image
Step 3-2-3: Validate Checksum and Decompress
Subsection 3-3: Define the Plan 9 Virtual Machine
Step 3-3-1: Page 1 of 5 — General
Step 3-3-2: Page 2 of 5 — First Boot Source
Step 3-3-3: Page 3 of 5 — RAM and CPUs
Step 3-3-4: Page 4 of 5 — Disk Drive
Step 3-3-5: Page 5 of 5 — Advanced Options
Subsection 3-4: Customize the Virtual Machine Configuration
Step 3-4-1: Overview Panel of Customization
Step 3-4-2: Processor Panel of Customization
Step 3-4-3: Sound Panel of Customization
Step 3-4-4: Video Panel of Customization
Subsection 3-5: Install Plan 9 from the ISO
Step 3-5-1: Task configfs of Plan 9 Installation
Step 3-5-2: Task partdisk of Plan 9 Installation
Step 3-5-3: Task prepdisk of Plan 9 Installation
Step 3-5-4: Task fmtfossil of Plan 9 Installation
Step 3-5-5: Task mountfs of Plan 9 Installation
Step 3-5-6: Task configdist of Plan 9 Installation
Step 3-5-7: Task mountdist of Plan 9 Installation
Step 3-5-8: Task copydist of Plan 9 Installation
Step 3-5-9: Task bootsetup of Plan 9 Installation
Step 3-5-10: Task finish of Plan 9 Installation
Subsection 3-6: Reboot Plan 9 from the Virtual Disk
While logged onto the vmadm user in the XFCE GUI environment of the p9host system built in the previous section (or other system that supports virt-manager), open the Virtual Machine Manager application. The screen should look a lot like:
Left-click on the Edit menu bar item, then left-click on the Connection Details item that is pulled down. This will act upon the current (and only) connection, localhost:
The Overview tab shows general information about the "localhost" hypervisory environment:
The Virtual Networks tab shows only the default and inactive NAT virtual subnet the hypervisor has provisioned (this project will not utilize this facility):
After left-clicking on the pull-down icon to the left of the IPv4 Configuration header in the display, the Virtual Networks tab shows status information about the br0 network interface the hypervisor has active, including its address:
The Storage tab shows status information about the storage pools
the hypervisor is managing, which currently offers only the
automatically installed default pool.
Default is a filesystem directory pool, meaning its virtual
disks ("volumes" to virt-man) are carved out of the filesystem
in which resides the Location directory, in this case, the
p9host root partition.
Thus the utilization information applies to the p9host root
filesystem.
I want to install Plan 9 into a different type of storage
pool, and begin defining the storage by left-clicking on the
Add Pool icon as shown:
We'll name it after the physical device the pool will manage. To select the pool type, we left-click on the pull-down icon:
left-click on the Disk item:
allow the Source path to default to /dev/sda, and left-click on the Finish icon:
You should see a new pool below the default pool in the column on the left:
Left-click on that new item:
and we see its details. Notice volumes in this context are real disk partitions.
We will allocate the remaining 75 GB of free space on the drive to create the fourth primary partition, starting by left-clicking on the New Volume icon:
I will name it to remind me this is the Plan 9 virtual disk, you can call it what you please. To more easily set the maximum and initial values to all that's allocatable, we type in a number larger than what is available in the Allocation box, then left-click on the Max box:
which sets both to the correct maximum. As there is a bug with trying to actually get that amount, we back them both down by one by left-clicking once on the Decrement icon of the Max box:
Happy with the choices, we left-click on the Finish icon to make it so:
Although it now is seen in the list of volumes, the available space on the disk has not updated.
To resolve that we left-click on the Refresh Volumes list icon:
and now the space utilization is correct.
Now that the area to carve up for virtual machine filesystems has been provided, we leave the Connection Details dialog by pulling down the File menu icon and left-clicking on the Close item that pops up:
which returns us to the main virt-man window:
We are ready to download the Plan 9 installation ISO which means leaving the Virtual Machine Manager application for a little while, then we will return to define the Plan 9 virtual machine.
The first step toward downloading the Plan 9
installation ISO is to enable vmadm to download
into the /var/lib/libvirt/images directory.
In a root shell terminal session, run the following
commands (modified as needed for your project):
cd /var/lib/libvirt
chgrp vmadm images
chmod 775 images
ls -lh
Your session should look like this (an additional
ls display before the mkdir is shown here):
From the Application Menu pull-down icon, left-click
on the Web Browser item.
This will bring up Iceweasel (the name Debian chose
for Firefox when permission to call Debian's
package Firefox was denied).
The
main page of the Bell Labs wiki
is the place to start from.
Go there by entering
http://www.plan9.bell-labs.com/wiki/plan9/plan_9_wiki
as the URL to visit.
Left-click on the link to
Download Plan 9
under the "Get Plan 9" heading:
to bring up the page with the links to the downloadable ISO file and the checksums file. Do not left-click on the ISO link; rather, copy the link's URL by a right-clink on the link and a left-click on the Copy Link Location item that pops up, as shown:
Now get to a shell prompt for the vmadm user (not root) and run the "cd /var/lib/libvirt/images" command. Then type "wget -c '", right-click on the terminal screen, left-click on the Paste item that pops, type another apostrophe, then press the Enter key. This starts the download (your speed will likely vary from mine). When it has finished successfully, run an "ls -lh" command to verify it exists and has the right timestamp. This sequence of commands should look almost identical to this:
Now you need to validate the ISO file's SHA1 checksum. Go back to the browser and open the ISO checksums file by a left-click on the file's link:
Scroll to the line for the ISO file just downloaded and select it by a left-click drag from the first character on the first line to the last character on the second line and release. Then right-click on the selection and left-click on the Copy item that pops up:
Go back to the vmadm command prompt and type "echo '",
then right-click on the terminal and left-click on the
Paste item that pops up, then type the following exactly:
' | awk '{print $10" *"$11}' >plan9.sha1sum
and press the Enter key.
Once that goes well, run the "sha1sum -c plan9.sha1sum"
command to validate the ISO file.
If that is "OK", next decompress the ISO by running a
"bunzip2 plan9.iso.bz2" command.
Remove the no longer needed plan9.sha1sum file and lastly
check your work with another "ls -lh" command.
It should all look pretty much like this:
Return to the Virtual Machine Manager application's main window and left-click on the Create a new virtual machine icon:
My vm's name reflects its future role: Plan 9 Bell Labs Server, but you may use what you think best. The default installation type is what this recipe calls for. We left-click on the Forward icon to proceed.
We select the "Use ISO image:" radio button and left-click on its Browse icon.
We left-click on the plan9.iso line to select it and left-click on the Choose Volume icon.
We left-click on the OS type: pull-down icon and left-click on the Show all OS options item that drops down.
We left-click on the OS type: pull-down icon again but this time left-click on the Other item.
We left-click on the Version: pull-down icon and left-click on the Generic item that drops down.
We left-click on the Forward icon to proceed.
We set these as makes sense for the project platform, remembering they can be adjusted later if necessary, then left-click on the Forward icon to proceed.
We left-click on the Select managed or other existing storage radio button and left-click on its Browse button.
We left-click on the sda item under the Storage Pools column.
We left-click on the sda4 item in the second column and left-click on the Choose Volume icon.
We left-click on the Forward icon to proceed.
We left-click on the Customize configuration before install checkbox and left-click on the Advanced options pull-down icon.
A virtual fixed MAC address for the vm's NIC has been suggested.
Prefering to have a MAC address more indicative of the vm using it, I change the last three bytes, but you can choose not to or use different values. Be sure Virt Type and Architecture are properly set. We left-click on the Forward icon to proceed.
We begin the advanced tailoring of the virtual machine prior to its first instantiation that will boot the virtual CD-ROM ISO. I will show all changes my platform receives and skip panels that don't require adjustments. You should review all options on all panels to ensure all are correct for your platform. Visit the virt-manager website and perhaps the libvirt website if you have questions about any of this.
I enter a description of this vm—its mission. You enter what you consider appropriate, what will help members of the vmadm group to differentiate this vm from all the others. I left-click anywhere on the Machine Settings line to pull down its details (note the bottom row of icons is about to be pushed down below the viewing area on my screen).
I left-click on the Enable ACPI: checkbox until it is empty.
If you can see the Apply icon, left-click on it (I can't get it to return but I'm not doomed). I left-click on the Processor item in the left column to change to that panel.
Because I haven't clicked the Apply icon that was pushed off screen, I am asked to apply my changes, which I do by left-clicking the Yes icon in the pop-up. Hopefully this will not be what you experience.
I left-click on the Configuration line to pull down its details and left-click on the Copy host CPU configuration icon to have virt-man fill in the Model.
I check the value reflects reality and resolve any discrepancy. I apply the changes and left-click on the Sound: default item in the left column to change to that panel.
I left-click on the pull-down icon of the Device model: line and left-click on the sb16 option.
I apply the changes and left-click on the Video Default item in the left column to change to that panel.
I left-click on the pull-down icon of the Model: line and left-click on the VMVGA option.
I left-clicked on the Overview item in the left column again to be able to respond to the apply dialog for the video change, but you may be able to simply apply the change. Either way, now that we're finished with setting up the vm, we left-click on the Begin Installation icon.
Now virt-man finishes the customizations,
creates an instance of this vm, and (this
time only) causes it to boot from the
installation device we defined.
If a problem forces me to reboot the installer,
as I don't know if that can be reconfigured
and am really trying to get this cookbook
finished, I have always deleted and recreated
the vm .
If you find a way around that, let me know so I
can document that here.
We are
here
in the Plan 9 Installation Instructions.
A flash of black announces Plan 9 executable
code has started running on your computer!
In short order you should get to the first
question (if not, the Plan 9 Installation
Instructions should be consulted and if
necessary, ask on
#plan9 at freenode
(but be sure you've done your homework and be
respectful).
Assuming you are new to Plan 9, it is VERY
important to avoid experimenting with the
interface by key presses and mouse clicks
not directly in the recipe until you know
what you're doing.
You can get lost very easily and will be on
your own to find your way back to the path.
It may take a LOT of time to figure out how
to recover.
Type 1 and press the Enter key.
After a little while, you'll be asked the
next question:
libvirt supports the default so just press the Enter key for that question and this one:
To facilitate taking screenshots, I will just press the Enter key here to use the default but you can type something somewhat smaller than your actual screen size (although the installer does not make use of the extra pixels, what gets installed will). Good choices are "800x600x16" and "1024x768x16".
For the next question (about the monitor), type in "vesa" but hold off on pressing the Enter key; instead, take a look at that mouse pointer. That is the XFCE pointer and indicates the mouse is not dedicated to the virtual machine.
Now left-click once with the pointer in that general location:
Where did it go?
Well, actually, it's still there, it's just not
apparent because it's solid black just like its
background.
It has changed into the Plan 9 pointer because
the mouse is now dedicated to the virtual machine.
The title bar has been updated with a prefix that
tells you how to release the mouse to X again
(while serving to remind you who owns the mouse
when its pointer is inside the vm sceen).
Now press the prescribed key combo, the Ctrl and
Alt keys to the left of the space bar.
The screen should look like the previous screen
again and the pointer is again free to be moved
outside the vm screen.
Now press the Enter key to continue with the boot.
After a bit of activity, you should be entertained
by the Plan 9 GUI:
Now you can see the Plan 9 cursor hiding in the top left corner of the active Plan 9 window. The XFCE pointer is outside the snapshot of the vm window. You won't be able to move the Plan 9 pointer until you move the XFCE pointer into the vm window and do a left-click (then the XFCE pointer ceases to exist, but you know how to bring it back). You won't need to move the Plan 9 pointer to perform the installation. I did while making the screenshots to point to something, usually the text of immediate interest in the window, like so:
You might have noticed the vm console window is hanging off the bottom of my screen again. I need to do something about that, and so do you if you are also experiencing that. There's nothing in that bar of icons underneath the console's menu bar that we can't active via the menu bar, so let's dispense with it. We move the X pointer to the View item in the menu bar and left-click once to pull down the Toolbar checkbox and left-click on the checkbox:
That worked for me.
If that didn't help you, we can maximize the vm window in the usual XFCE way, a left-click on the min/max icon as shown:
That pulls my Plan 9 windows up a little closer to the menu bar. I hope it helped you sufficiently.
We press the Enter key to start the configfs task:
We simply take the default here by pressing the Enter key (we'll install venti in the next version of the cookbook).
We press the Enter key to start the partdisk task:
The correct response should be obvious. We type it and press the Enter key.
Perhaps it is, indeed. Do not miss an important reality in this analysis—Plan 9 believes it is dealing with a physical hard drive. The project's plan for this hard drive provides for multiple partitions for future use with an MBR that will only be used by Plan 9 virtual machines. Thus we type "y" and press the Enter key.
The installer has suggested it take the entire disk. We have other plans, however. Note that 128 cylinders are almost precisely equal to 1 GB.
We delete the first primary partition and create a new ~20 GB one:
Whence sprang such incantations, you ask? Well, the Installation Instructions include a link:
to the needed tome:
We type a "q" and press the Enter key to finish partitioning.
We press the Enter key to start the prepdisk task:
Make sure it found the partition you intended before you take the default by pressing the Enter key.
This shows how prepdisk thinks we should carve up the partition (somewhat like a primary partition used to provide multiple logical partitions, but this is a facility managed by prepdisk, not partdisk, and can be applied to multiple primary partitions. This breakdown is acceptable for my purposes, so I use the "w" and "q" subcommands per the instructions.
We press the Enter key to start the fmtfossil task (there is only one fossil filesystem to format, so we can accept the default for the question by pressing the Enter key when asked, as shown without a separate screenshot). There are no other responses needed for the task to complete.
We press the Enter key to start the mountfs task (as with the fmtfossil task, there is only one choice, which we handle the same way, and no other responses to make).
Let's look at Sid's view of this activity to observe the invisibility of this virtual disk. The parted utility still does not know how the partition is being used:
and the kernel does not have it mounted:
Thus, all I/O to the partition depends upon the permissions of /dev/sd4 for authorization.
We press the Enter key to start the configdist task, and accept the default to "local" by pressing the Enter key at the appropriate time. There are no other responses to make for this task.
We press the Enter key to start the mountdist task, type in the name of the distribution disk, /dev/sdD0/data, when asked, and press the Enter key.
Since /dev/sdD0/data is the CD-ROM image, we type "/" for this question and press the Enter key.
Now mountdist does its job and returns for the next task.
We press the Enter key to start the copydist task, which does not need any direction from us, but will take a while to copy everything from the ISO to the hard drive—take a decent break.
When finished performing copydist, you should see the following:
We press the Enter key to start the bootsetup task, then, in response to the boot method question, we type in "plan9" and press the Enter key.
In response to the MBR question, we type "y" and press the Enter key.
When finished performing bootsetup, you should see the following:
We press the Enter key to start the finish task.
When Plan 9 accomplishes an "fshalt" command, you can ignore the appearance of continuing activity, since it doesn't shutdown in the sense of most operating systems. The "-r" parameter will cause a reboot to occur but the installer doesn't specify that for its invocation of "fshalt". So we will believe what the message says and feel free to reboot the vm manually.
Since that won't be a problem, we left-click on the Yes icon of the pop-up dialog:
and see the machine does not automatically start rebooting, it is stopped and its RAM is intact. To start it running again, we left-click on the Virtual Machine icon again but this time we left-click on the Run item that drops down:
causing the vm to reboot. It appears pretty much like the boot from the ISO until we get to the first prompt that wants to know what root filesystem to use. We see it will accept a default that sets the device and filesystem to load as the fossil sub-partition of the local hard drive (sdC0). This is want we expected and want, so we press the Enter key:
and get the next question, what user to use for booting purposes; i.e., which user will "own" this incarnation of the root filesystem. For this standard system just installed, that user is glenda (the name of the logo bunny), so we type that in and press the Enter key.
After a little more activity, the display ends up looking something like this (hopefully no smaller than 800x600):
We have arrived at a Plan 9 stand-alone
terminal system at your fingertips!
Start reading through this interactive tutorial
to learn how to work with the GUI (the window
shown in front) if this is all new to you.
Then, if you want to take the time now to
go through the other tutorials, that is fine
(but if this is a 640x480 screen, the acme
tutorial should be deferred until you have
at least 800x600 for it to use).
If, however, you want to get this self-contained
system communicating with the outside world
first, you can defer that step and
proceed to the next section
to transform this platform into a networked,
multi-user, and amazingly distributed yet
highly secure participant in the Plan 9
paradigm.
Up: Top |