The virtual machine application uses the host processor to simulate the guest processor, and
it uses files on the host system to simulate disks on the guest system. It also simulates other
hardware in the guest system, sometimes by using host hardware directly. For example, the
virtual machines distributed for this course allow you to access your CD or DVD drive and
your USB Flash Drive directly from your guest operating system on your PC.
A goal of this Operating System course is to provide experience in working directly with the
inner layers of a real operating system of the kind used by many people for their daily work,
including the WPI community. You will be exposed both to the breadth and depth of such
an operating system and also to many of its gory details. In order to do this, a safe place
must be provided for you to work — a place where you can make mistakes, crash your oper-
ating system, corrupt disks and data structures, etc., without harming anyone else and even
without harming your own, working PC.
The virtual machine provides this kind of environment.1 For this course, we are providing a
dual processor, dual disk virtual machine with OpenSUSE Linux version 10.2 already in-
stalled. The reason for two processors is to expose you to the issues of concurrent execution
at the kernel level of the operating system. The reason for two virtual disks is to minimize
the chances of losing your work after a crash. The primary disk is the system disk; this con-
tains everything except the /home directory. If it becomes corrupted, you can safely replace
it with a new copy. The other disk contains just the /home directory; this is where you will
work, build new copies of the kernel, etc. If your virtual machine needs to be replaced, you
can still connect your previous home drive to the new one.
The virtual machine comes in two flavors — i386, the name given to Intel and compatible
32-bit architectures, and x86_64, the name given to Intel and AMD 64-bit architectures. Al-
most all students will be able to use the i386 version. The x86_64 version was created pri-
marily for use on the CS Department server csopt4 but may be useful on other hosts.
Installing VMware Player
VMware is a company that makes and sells virtualization systems for commercial and scien-
tific applications. VMware Player is a freeware package from VMware that designed to run vir-
tual machines that were created under some other VMware system. It does not have all of
the capabilities of other virtual machine systems — particularly the ability to take snapshots
and roll back to them. However, it is free, and it is adequate for the purposes of this course.
VMware Server is another free product of VMware that lets you create your own virtual ma-
chines. Many CS students keep a copy of VMware Server on their own PCs or laptops. It has
the ability to take and store a single snapshot, but it lacks some other useful virtualization
features, such as shared folders with the host operating system. (It does, however, run virtual
machines created on other VMware systems.)
The virtual machines for this course were created by the instructor and will be distributed to
students on DVD. There are three parts to setting up these virtual machines using VMware
For many years, the undergraduate Operating Systems course at WPI had a different environ-
ment called the Fossil Lab. This is a laboratory with dedicated hardware on its own network but isolated
from the campus network. See http://fossil.wpi.edu. However, the Fossil Lab requires a student to be
physically present on campus, something that is impractical for graduate students who also hold full time
• Obtain and install a copy of VMware Player.
• Extract the contents of the DVD to an appropriate directory.
• Boot up your virtual machine in VMware Player and make some adjustments for net-
working and for user identities.
Installing VMware Player
Download and install the VMware Player application program to the machine on which you
will work. When you download, be sure to select version 2.0 or later. The VMware Player ap-
plication can be downloaded from here:–
Versions are available for both Windows and Linux desktop environments, but there is no
version for the Macintosh. However, a VMware program called Fusion for the Macintosh can
be found at
You can get a 30-day free evaluation license, but after that you have to purchase it.
If you want to use the free VMware Server, you can download it from here:–
You are on your own with respect to installing and using VMware Server or VMware Fusion.
Back to VMware Player, install the downloaded application as you would any other applica-
tion. There seems to be nothing special about it. However, the installation package suggests
at one point that “Autoplay” be disabled for CD-ROM drives. I did not disable it, but this
might lead to confusion if certain CDs are inserted into a CD-ROM drive while the player is
Expanding the CS-502 Virtual Machines
The DVD distributed in class contains two zip files plus a copy of this document. The zip
• CS-502_Fall_07-x86_64.zip, and
These represent the two versions of the distribution. Expand the one you want, and you will
get a folder with the same name as the zip file If you open this folder, you get something
that looks like:–
The file Home (together with Home-s001, if it exists) is the virtual disk representation for
the /home directory. Protect and take care of these files, even to the extent of backing them
up. This is where you will do your work. (Note that during the course of building a full
Linux kernel, the home disk will grow to about 800 megabytes, and other actions may cause
it to grow larger.)
The VMware Configuration File named SUSE Linux or SUSE Linux 64-bit is a text file
describing your virtual machine. You may peruse it if you wish, but there is no need to edit
it. To start a virtual machine, you need to browse to (or double click on) its VMware Configu-
ration File. The rest of the files are for implementing the virtual machine itself.
Before you can run the virtual machine, you need to decide whether you want Bridged net-
working or NAT networking (i.e., Network Address Translation).
• If you have a home network that freely accepts new connections, choose Bridged.
This causes VMware to forward all network connections directly to and from your
network, making your virtual machine look like a piece of real hardware to the rest of
the machines on your network. Your virtual machine acquires an IP address via
DHCP, just like other machines on your home network. Any other system on the
network can therefore speak to the guest system directly.
• On the other hand, if you are connected to a closely managed network such as the
WPI wireless network on campus, your virtual machine’s MAC address won’t be rec-
ognized and therefore the network will deny you permission to connect. In this case,
choose NAT. This causes a module inside of VMware to translate the IP address of
every packet so that it looks to the outside world as if it were coming from the host
system, not the guest system. The host system then translates the IP addresses of the
replies to look like they were intended for the guest system.
The networking choice is specified in the Ethernet pulldown menu in the center of the title
bar of VMware Player after you start your virtual machine, as shown below and described in
the next section.
Starting your Virtual Machine for the first time
Start VMware Player, browse to and open the folder where you extracted your files, select the
VMware Configuration File, and click open. You may also simply double-click on a VMware
Configuration File to invoke the VMware Player with that file. This boots the virtual machine.
There are two things you need to do before you are ready to use it. These are
• To fix the network configuration; and
• To create a user identity for yourself.
The first thing that should appear is a dialog box like the one below:–
In this dialog, VMware is telling you that it wants to change the hardware address of the vir-
tual Ethernet device of the guest virtual machine (i.e., its MAC address). The MAC address
of a VMware virtual machine is derived from a unique identifier, which in turn is derived
from the path name of the directory in which its configuration file resides. This new MAC
address is intended to keep the new virtual machine from being confused with the original
one distributed to you and with other machines (virtual or real) on the network. By selecting
the Create radio button and click OK, VMware Player generates the new unique ID and an
MAC address and writes it into the VMware Configuration File.
After you click OK, the virtual machine boots up, eventually producing a screen that resem-
bles the one on the previous page. If you do nothing at this point, the virtual machine will
boot the default option (openSUSE 10.2). The numbers after the operating system identi-
fication are the version of the kernel. In the future, you will need to control the boot op-
tions; do this by clicking in boot screen, then using the arrow keys to select the desired op-
tion, and finally pressing Enter.
Note: You transfer the input focus of the mouse and keyboard to the virtual machine by
clicking in its window. You can return the input focus to the desktop by typing
CTRL-ALT. If the input focus is in the wrong place, the virtual machine won’t hear
you type or move the mouse.
Once the focus is in the virtual machine, you may use the up and down arrows to se-
lect the booting option and Enter to invoke that booting option. There is a settable
boot timer that controls how long SUSE Linux waits before booting the default op-
tion. You may set the networking choice at this time.
During booting, the screen will briefly change to a text console, and then it will eventually
change to a graphical login interface.
Your login ID is as student, and your password is CS-502. You will be presented with a
graphic desktop called KDE, the Linux Desktop Environment, shown below. This is the
SUSE Linux equivalent of the Windows desktop, and it is used much the same way. In par-
ticular, note the little green “Gecko” icon in the lower left corner. This is functionally equiv-
alent to the “Start” button in Windows. Click it to get a menu of program items and other
Note: In modern versions of Linux, you rarely have to log in as root. Most of the time,
you should log in as a non-privileged user and use the sudo command to invoke
root privileges where needed. This avoids accidents that are typical in most system
development environments. As a helpful reminder, KDE configures the user root
with a red desktop background that contains warning signs and images of bombs.
Updating the networking configuration
You next need to update Linux to recognize the new network address you just created in the
dialog box above. Although it is possible to do this by editing a text file, that is tedious, time
consuming, and error prone. A better way is as follows:–
Click the “Gecko” icon and select the third tab of this menu, labeled Computer. When the
tab opens, you will see at the top an item entitled Administrator Settings and in
smaller print below it YaST. Click this item to start the YaST program, SUSE Linux’s gener-
al purpose administrative setting tool. You will use YaST a lot; it is much easier than learning
and remembering a book full of arcane shell commands.
When you start YaST, it asks you to enter the root password. This is CS-502, the same as
the password for the user student. You should next see a window resembling the follow-
Select the fourth item on the left, namely Network Devices. This expands the right
window to show several types of network devices. Click on the Network Card icon to
bring up the Network Setup Method window. Choose the “traditional method” and
click Next. This brings up the following window:–
Select the network device that says “Not configured” and click Edit. A set of default op-
tions will be presented in a dialog box. Accept these and click Next to return to the Net-
work Card Configuration Overview window again. Finally, click Finish. This
causes SUSE to reconfigure its networking subsystem and start the network connection.
A convenient way to test the network connection is to open a terminal window (click the
Gecko icon in the lower left and select Terminal Window from the menu). This opens a
traditional Linux/Unix shell. Type the command
% sudo /sbin/ip address
This will list the IP addresses of the local connection (188.8.131.52) and of the newly configured
network card. You can also test the connection by invoking the Mozilla web browser in your
guest operating system or by trying to ping a known network address.
Creating a user identity for yourself
It is helpful to create a user identity for yourself and to get rid of the student identity that
comes with the distribution version of these virtual machines. To do this, go to the YaST
main window and select Security and Users in the left panel. Click on User Manage-
ment in the right window and follow your instincts to add your own identity as a user. (We
suggest that you use your WPI e-mail identity.) Log out, and then log in with this new identi-
ty, and finally delete the student identity.
Installed in your guest operating system are the VMware Tools. This is a set of drivers that im-
prove the performance and operation of the guest operating system in the virtual environ-
ment by setting up some private channels between the host and the guest systems. The most
useful feature is the shared folder between the host and the guest operating system. This is a
folder that lives in both the host and the guest operating system. You can move files into it
from one system and take them out from the other.
Shared folders are supported in VMware Player and VMware Workstation, but not in VMware
On the guest side, the shared folder is mounted in the directory /mnt/hgfs. On the host
side, it must be enabled and configured in VMware Player. The configuration dialog is ac-
cessed from the VMware Player menu as shown below. You will need to “enable” sharing and
specify which host folder you want to share.
The VMware tools installed in your guest operating system have a tendency to disable them-
selves when you modify the kernel, even when you reboot back with the original kernel.
Among other things, this causes the shared folder facility to stop working. It also sometimes
causes the network card to stop working, and you have to go through the process of config-
uring it again, as you did above after the MAC address changed.
There are two ways to re-establish the VMware Tools:–
• Execute the shell command
This uninstalls and then reinstalls the VMware Tools. As part of the installation step, it
recompiles the VMware Tools with the header files of the current operating system
kernel. If it cannot find these header files, it will ask you for a pathname. Rebuilding
VMware Tools takes only a few minutes.
• Reboot with the last known kernel for which VMware Tools worked. Execute the fol-
lowing two shell commands:–
sudo rm /etc/vmware-tools/not_configured
sudo /etc/init.d/vmware-tools start
The first command removes the file /etc/vmware-tools/not_configured,
which was put there by VMware Tools when it tried to start up with a kernel that did
not match the one it was compiled with. Once this file is in place, VMware Tools will
not even attempt to start up.
The second command restarts VMware Tools. Presumably, if the kernel is right, it will
start operating again. In particular, the shared folder will become accessible.
In the unlikely even that your virtual machine becomes so badly corrupted that you cannot
use it, do the following:–
• Unzip the appropriate zip file from the distribution DVD to a new folder
• Open the folder of the old (unusable) virtual machine
• Copy file Home (and Home-s001, if it exists) from the old virtual machine folder to
the new one. This will replace the corresponding files in the new virtual machine
folder. Do not copy the folder Home.vmdk.lck or any other file or folder with the
• Boot and initialize the new virtual machine as described in this document.
You should now have a brand new virtual machine, but with the /home drive taken from
your old one. Your work on the Linux kernel should be intact.
That’s it. Enjoy your virtual machine. You are now ready for your first kernel project. When
you are ready to take a break, you may power off your virtual machine by invoking the
“leave” tab from the Gecko menu and selecting the appropriate option. You may also “Sus-
pend” the virtual machine by simply exiting VMware Player. When you open VMware Player
again and select your virtual machine in the dialog box, it resumes where you left off.
Documentation for VMware Player can be found here:–
There is a lot of documentation about other VMware systems here:–
Documentation about OpenSUSE Linux can also be found on-line at
This includes a getting started guide, a user’s manual, and administrator’s manual, and other
information. Do not try to print these. Together, they are over 1000 pages.