Setting up your Virtual Machine
on the CS Department VMware Server
Ó

CS-502 Operating Systems
Fall 2007

Hugh C. Lauer
Adjunct Professor
Worcester Polytechnic Institute

For this course, you will need a virtual machine capable of running OpenSUSE Linux version 10.2. Many students will set up their virtual machines on their own PCs using the free VMware Player (for those instructions, see here: – .doc, .html). For students without access to a PC of sufficient capacity or performance, an alternative is available using the VMware Server application running on csopt4, a large server machine in the Computer Science department. This document describes how to set up your virtual machine environment on that server, so that you can access it remotely from another computer.

Getting Started

You will need two things to get started: –

·        A CS Department account and login ID. To obtain one, visit

http://www.cs.wpi.edu/Account

and fill in the form, giving your CCC account, student ID, etc. If it asks you for a “certificate,” simply click “Okay.” Where is asks for which CS systems you need an account, click “Other” and type in the box “VMware.” In the Notes section, specify “Professor Lauer, for CS-502.”

Once you have received your account and password, log in to any CS Department machine and change your password to something that you can remember.

·        A VMware client, i.e., a small application program that runs on your computer and serves as a graphical interface to the VMware Server. You can obtain a free copy of VMware client by visiting this web page: –

http://www.vmware.com/download/server/

Select VMware Server 1.0.3 (the newest), click Download Now, accept the terms of the license, and download the VMware Server Windows client package (or the equivalent VMware Server Linux client package) and install it on your PC.

There does not appear to be a VMware client for the Macintosh.

Installing the CS-502 Virtual Machine

A copy of a virtual machine for the x86_64 architecture can be found on csopt4 at

/xtra_space/CS-502/CS-502_Fall-07_x86_64.zip

To create your own virtual machine, do the following: –

·        Using PuTTY or some other secure shell application, log into csopt4.wpi.edu. You may do this on campus or remotely. Change your directory to /xtra_space. Note that this directory is only visible from csopt4; several other machines in the Computer Science Department have their own, directories with the same name, but these are not the same directory and not accessible from csopt4.

Create a new directory under /xtra_space with your user ID as its name. Change your working directory to that new directory, and execute the following command:–

unzip /xtra_space/CS-502/CS-502_Fall-07_x86_64.zip

This will unpack a copy of the 64-bit virtual machine into your directory.

That’s all there is to it (almost).

Getting your Virtual Machine ready

To get your virtual machine ready for execution, do the following : –

·        Start the VMware client application (also called the VMware console) that you previously installed. Select the Remote Host radio button and enter csopt4.wpi.edu as the host name. Also enter your CS Department user ID and password. You should see a screen that resembles the following: –

The left-hand panel may or may not be visible. If it is not visible, click the funny little icon below the Snapshot menu item at the top of the window to view it. This panel lists the known virtual machines on the server. The list may vary from time to time.

Click the Home tab, and then click the second icon in the right panel labeled “Open Existing Virtual Machine.” In the dialog box, browse to the directory you created in the previous step — i.e., where you expanded your copy of the clone virtual machine. You should find a file called SUSE Linux 64-bit.vmx, the configuration file for the virtual machine that you just unpacked. Select, open, and accept this file.

A new virtual machine called CS-502_Fall-07_x86_64 will now appear in the left panel. Notice that it might have the same name as other virtual machines. In addition, a new tab will appear in the right-hand panel showing the status and the properties of your virtual machine.  

·        You should rename your virtual machine to something unique, such as your user ID or your name. To do so, right click on it in the left panel and select “Rename.” You should also edit the settings of this machine by right clicking and selecting “Settings…” You will then get the Virtual Machine Settings dialog box shown below.

Click the Options tab and select Permissions to restrict access to your virtual machine. If you don’t restrict access by this setting, access will be determined by the file permissions in your directory in /xtra_space. The Permissions screen of the Options tab looks like this:–

·        You need to check one other setting to help protect your work when you make the inevitable mistakes in the kernel. Click on the Hardware tab of the Virtual Machine Settings dialog box, and then click on Hard Disk 2 in the left hand panel.

In the lower right, an “Advanced…” button will appear. Click this to bring up another dialog box, shown below. In this dialog box, be sure that the Independent box is checked and and that the Persistent radio button is selected. Doing so will keep the disk separate from any snapshots you take, thereby protecting your work, even when you need to roll back to a previously stable state.

Also, for the primary Hard Disk (i.e., SCSI 0:0), be sure that the Independent box is unchecked. This makes your system disk eligible for snapshots.

Starting your Virtual Machine for the first time

You are now ready to start your virtual machine. In the VMware Console, click Start this virtual machine. 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 on the next page. In this dialog, VMware is telling you that it wants to change the hardware address of the virtual 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.

Note regarding Networking: In the instructions for setting up your virtual machine using VMware Player, there is a discussion at this point about Bridged versus NAT networking. This is not relevant when running on csopt4, because you must use NAT networking. The reason is that the network in the CS Department server room is closely managed, and therefore it will not recognized Bridged virtual machines with unknown MAC addresses.

Select the Create radio button and click OK. The machine will begin to boot and eventually display a SUSE Linux boot screen resembling the one shown on the next page. This screen fills the tab for your virtual machine, and the window will resize itself as necessary.

If you do nothing at this point, the virtual machine will boot the default option (openSUSE 10.2). The numbers after the operating system identification are the version of the kernel. In the future, you will need to control the boot options; do this by clicking in boot screen, then using the arrow keys to select the desired option, 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 select 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 option. 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.

Logging in

Your login ID is 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 particular, note the little green “Gecko” icon in the lower left corner. This is functionally equivalent to the “Start” button in Windows. Click it to get a menu of program items and other commands.

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 general 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 following:–

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 options will be presented in a dialog box. Accept these and click Next to return to the Network 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 (128.0.0.1) 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 Management 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 identity, and finally delete the student identity.

Caveats and features of VMware Server

There are two important caveats that students using VMware on the CS Department server must be aware of.

Warning: Your virtual machine on csopt4 is not backed up! If you need to save and protect any files that you create on your virtual machine, you must explicitly copy them out of the virtual machine to your normal CS user directory. Also note that VMware Server does not implement the shared folder facility that is available in VMware Player and VMware Workstation.

Warning: It is very easy to exit the VMware client without first shutting down your virtual machine. Your virtual machine will continue running, and it will be locked. If later, the server itself shuts down for any reason, you will have a hard time restarting your virtual machine. Contact the instructor if this happens to you.

As a matter of courtesy, disable any screen saver that your virtual machine may be using. Screen savers consume lots of CPU power and virtual memory in the host operating system, and this is not a good thing to do in a server that you are sharing with others.

VMware Server and VMware client provides one other feature not available in VMware Player, namely the ability to take a snapshot. This makes a record of the state of the virtual machine at the instant that the snapshot is taken. If you are dissatisfied with the behavior of your guest system after the snapshot, you can revert to the snapshot and try something else. The snapshot facility is implemented in the Snapshot menu of the VMware client.

VMware Tools     

Installed in your guest operating system are the VMware Tools. This is a set of drivers that improve the performance and operation of the guest operating system in the virtual environment by setting up some private channels between the host and the guest systems. The VMware tools installed in your guest operating system have a tendency to disable themselves when you modify the kernel, even when you reboot back with the original kernel. Among other things, this sometimes causes network connections to stop working.

There are two ways to re-establish the VMware Tools:–

·        Execute the shell command

sudo /usr/bin/vmware-tools-config.pl

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 following 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.

Conclusion

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 “Suspend” the virtual machine by invoking the Suspend command in the Power menu of the VMware client. Later, you may resume where you left off by simply starting the virtual machine again.

Documentation

Documentation for VMware Player can be found here:–

http://www.vmware.com/support/pubs/player_pubs.html

There is a lot of documentation about other VMware systems here:–

http://www.vmware.com/support/pubs/

Documentation about OpenSUSE Linux can also be found on-line at

http://www.novell.com/documentation/opensuse102/

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.



Ó      Copyright 2007, Hugh C. Lauer. All rights reserved. Permission is given for use in courses at Worcester Polytechnic Institute, Worcester, Massachusetts.