Computer Science 422
Using User Mode Linux at the U of S in the Penguin Lab
Introduction.
User-Mode-Linux is an application that "emulates" a computer running the
Linux operating system. Thus, you will have a Linux virtual machine running
on top of your Linux machine. There are three things that you need in order
to be able to run User-Mode-Linux: a kernel
patch, a root filesystem, and a distribution-independent copy
of the kernel source directory. Details of this are found at the User-Mode-Linux
site, from which you can get an entire distribution. Alternatively, these
components are stored locally at the U of S on one of our department file
servers. The local copies can be retrieved from the following directory
from any Linux box (penguins, or tux): /cs/cmpt422. In this directory
are the files named uml-patch-blah.bz (the kernelpatch), linux-blah.gz
(kernel source), and the entire 422 directory. On the penguins,
this is all set up for you, if you are working at home, just scp the files
to the appropriate directory on your own machine. The root file system
will have a stripped-down version of Mandrake 9.0 installed, but the kernel
will be distribution-independent.
This instruction document is subject to change, should further details
become available which are required to ease the operation of User-Mode-Linux.
Basic Operation.
First time.
1. Unpacking kernel source. Unzip the kernel source archive using gunzip.
2. Unpack the kernel patch. Unzip the kernel patch using bzcat (man
bzcat). I told you that you needed to remember stuff from 330. You will
need to pipe the output of bzcat to 'patch -p1' so that it will patch the
kernel properly. You must be in the top level of the kernel source for
this command to work.
3. Compile the kernel. This is somewhat simplified from the process
of building a kernel in a real machine (as outlined in the Nutt book).
-
make menuconfig ARCH=um (or alternatively 'make xconfig
ARCH=um'). This will allow you to choose different levels of support
for different functionalities. In particular, there is the option to have
support for many different filesystems, and network interfaces (802.11,
bluetooth, etc.), which you don't really need and will slow down the compile
process significantly. Remove those you are sure you won't need (check
with me if you are uncertain, or read the bulletin board).
-
make modules; make modules_install (optional step needed if you
want module support, which is needed for some assignments).
-
make linux ARCH=um. Now you have a compiled kernel. This creates
a file called 'linux', which is the command that you run to execute your
virtual machine.
4. Obtain root filesystem and related files. This is the contents in the
422 directory. The file control contains instructions on which 'linux'
file gets booted when you run the user-mode-linux application.
5. Invoke User-Mode-Linux. This is done with the command 'control
start' from the same directory as your root filesystem. This boots
the virtual machine and provides a login screen.
6. There is only one account on this machine: root. It has the
password: root.
Subsequent invocations and modifying kernels.
1. You will only have one kernel which is named 'linux'. If you
want backup kernels, you can copy the old 'linux' files to other names,
and then edit the control file to properly point to the kernel which you
want to boot.
2. Mounting filesystems from the virtual machine. This is necessary
for module support and helpful for accessing files from your home directory,
or from the local machine. From a virtual machine window (as root, of course):
you type: mount -none virtualmntpoint -f hostfs realmntpt, where
the mountpoints are named appropriately.
Sharing the resources on the Penguins
Each group will have a directory where they set up the proper source
code. This will be /u1/uml/groupname. When you have given me the names
of the students in your group, we will set up the permissions so that only
those students (and the instructor and TA) have access to that directory.
This is then your space for the remainder of the term. Note that this means
your work will be on only one of the penguin machines, which is NOT BACKED
UP. Any changes you make should be saved in your home directory. Be careful
to remember where this modified code must be placed in the source code
tree, as you will not have enough space in your home directory for the
entire kernel source (over 100 MB).
Emergency Operations
We should need none. This document will change if that statement proves
false.