Installing an operating system on a PC

In this exercise you will install an operating system. The one chosen is minix, a modest OS originated for teaching purposes by Andrew Tanenbaum and used as a platform for the early development of linux, which came to overshadow it. Instead of installing minix on an actual PC you will use a virtual one provided by VMware.

The exercise for you to perform

Log in on your class laptop as "student", start the GUI (startx &), and launch a terminal window (click corresponding icon). Now you are going to in effect obtain the "installation disk" for the minix operating system. Do so by transferring the file minix_R3.2.1-972156d.iso.bz2 to your local home directory (local means "on your computer") from the file server.

scp   ~     [ use the supplied password when prompted ]

Check its size:

ls  -l  minix_R3.2.1-972156d.iso.bz2

Around 250MB, but it's a compressed file. Uncompress it:

bunzip2  minix_R3.2.1-972156d.iso.bz2

Examine the result:

ls  -l  minix*

This is the uncompressed version, about 650MB. It is an iso file, that is, a bit-for-bit copy of the minix installation CD, but with those bits stored in a different place. Namely, in a file not on a CD. But the same bits. As a source from which to install minx on a hard disk, VMware can use the bits in either form. You may have seen a demonstration of installing an operating system from a CD (or DVD) onto a computer's hard disk. In this exercise, we'll do it virtually. The source will be the iso file instead of a CD. And the destination will be the simulated hard disk of a virtual PC, not the physical disk of an actual one.

Given that we have just obtained the CD to install from, we need the target hard disk on which to install. It will be the disk belonging to a virtual machine. Let's create one. Do that with VMware. Launch VMware from your terminal window:

vmplayer  &

In the graphical VMware Player program, choose "Create a New Virtual Machine." In the ensuing screen tell it to "Use ISO image" and browse to your iso file. It's full name is /home/student/minix_R3.2.1-972156d.iso. "Open" it. Click forward ("Next" button) a couple of screens to the one that gives a name to the virtual machine you are creating (it says "Virtual Machine Name" at the top). It calls it "FreeBSD" but please change that to "minix". Click forward another couple screens to the "Finish" button, and press it. At the next screen, "Close". The new machine boots. In the process, it finds the virtual minix installation CD in its virtual CD drive and gives control over to it (dismiss any dialog boxes about updates and devices). There is text on your virtual screen (the interior of the VMware Player window holds your virtual screen). Running the CD is what got you that text, it came from the CD. It encourages you to install minix to your hard disk, by logging in as root then running "setup". (Don' worrry it isn't going to install minix on your laptop. There are 2 machines here, the laptop and the newly minted virtual one, whose hard disk is where minix will go.) Go ahead, log in as root then run setup. Since there are 2 machines and but 1 mouse and 1 keyboard, the machines must one-at-a-time share those input devices. If the laptop controls them and you want to transfer control to the VM, click inside the VMware Player window (then you can respond "root" to the "minix login: " prompt). To do the opposite, releasing the input devices from the VM back to the host machine, press the ctrl-alt key combination. After typing "setup" follow the prompts. Basically you should accept all the defaults by pressing Enter a bunch of times. At some point a few files will be copied (from the virtual CD to the virtual HD) then a message tells you it's done. Type "shutdown" to shut down the in-RAM copy of linux that the installer CD set up and ran on. You will then boot the other copy of minix, the one you just placed in the virtual HD of your VM. When minix shuts down it may appear to hang. You can intervene to shut the machine down with its virtual power button. It's found in VMware Player's "Virtual Machine" menu, select "Power" and then 'Power Off Guest". At that point VMware Player may terminate. In your laptop's terminal window re-launch it:

vmplayer  &

The VM titled "minix" shows up. Click to highlight it then press the green-arrow "Play virtual machine" icon. The virtual machine boots, from its virtual hard disk, to a "login: " prompt. There, log in as root (no password). Congratulations, you have installed and are now running an operating system. Optionally, VMware Player will let you expand it to full screen if you want. In it, run something just to prove you can. For example:

cal  12  1941

prints the calendar for December, 1941. That's the same as in linux. But try:


It gives a usage message but no calendar. In linux, it gives the calendar of the current month. What does that prove? That this is not linux. It's minix.

If you want to play around a little, there is a "fortune" command that prints little aphorisms. There is a benchmark program called "worldstone" that runs all kind of stuff and measures how long it takes (it takes too long, interrupt it with ctrl-C). You could print out a report of disk space in your filesystem with df. Linux has df too, but here the filesystem nomenclature is different. minux has a c compiler, "cc" command. If you had time you could do something goofy to create a C program (without having to learn how to use the available vi editor), compile it, and run it:

echo '#include <stdio.h>' > hello.c
echo 'int main()' >> hello.c
echo '{' >> hello.c
echo 'printf ("Hello World\n");' >> hello.c
echo '}' >> hello.c
cc  hello.c  -o  hello

As installed here minix lacks any graphical interface. It does include the source code for a lot of the available utilities under the /usr/src directory. For example, the source for our "cal" program can be viewed as:

more  /usr/src/commands/cal/cal.c

Scroll up and down with the up and down arrows, or PgUp and PgDn keys. Scroll all the way to the bottom to get out.

But we are not here to explore minix itself, only to use it as an example OS showing how an OS is installed onto a PC and how virtual machines can be substituted for real ones in doing so. If you burned the iso file to a physical CD, and had a physical PC at hand, you could stick the CD into the physical PC and boot. The installation would proceed exactly as it did here.

When you are done playing in minix, shut it down:

shutdown  -h  now

Release the mouse to the host OS so you can go to VMware Player's "Virtual Machine" menu and turn off the power.


If you are further interested:
  minix home page
  an article about minix.
  minix author Andrew Tanenbaum











(possible operational problem  -
/org/gnome/settings-daemon/peripherals/touchpad/touchpad-enabled needs to be set in order to use the touchpad mouse)