User-mode Linux at IMADA
In the following we describe how to install and use User-mode Linux (UML) for DM510 at IMADA.>
Please note that I was told, that all
machines in the IMADA pool will run Ubuntu 9.10 (karmic) when you
start with this assignment. This is not true right now (Feb. 11th),
and only some machines run Ubuntu 9.10. Everything was tested on
Ubuntu 9.10 and I strongly recommend to use such a system. The machine
running Ubuntu 9.10 are adina, carmen, desdemona (logon2), gretchen,
iphigenia, isabella, tatiana, tosca (logon1). You can of course login
to these machines via the ssh
command.
How to install User-mode Linux at IMADA
Login at any IMADA machine and write
mkdir dm510 cd dm510
Next, get the source code for the Linux kernel 2.6.32.3 and unpack it
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.3.tar.bz2 bunzip2 linux-2.6.32.3.tar.bz2 tar -xvf linux-2.6.32.3.tar rm linux-2.6.32.3.tar
Enter the directory containing the kernel source files:
cd linux-2.6.32.3
To make this a working copy of UML you also need a root filesystem, that you can copy to your directory. The filesystem is based on a Debian 5.0 system. Note, that the root filesystem has a size of approx. 250MB, and that the uncompressed kernel sources use than 300MB (this gets even worse when compiling the kernel, what we will do next).
cp /home/daniel/dm510/root_fs .
You are now ready to start compling the kernel and using UML.
How to compile User-mode Linux
We need a configuration file fore compling the linux kernel. Create it with
make defconfig ARCH=um
Now we're ready to compile the kernel. Do it with
make ARCH=um linux
and have a cup of coffee or tea, because this will take a while. When the compilation is finished, you will find a file called linux
in your directory. Everything is set to start UML.
How to run User-mode Linux
User mode linux is started with
./linux
When running UML, you can login using the user name root
with
no password. If you want to access data from your home directory inside UML, you have to mount the corresponding directory. This is done with
mount none /mnt/tmp -t hostfs -o /home/your_imada_login/dm510
Of course your_imada_login
has to be replaced by your IMADA login. The corresponding directory will be mounted as a subdirectory of /mnt/tmp
inside UML. To stop the UML system you can run the command halt
. After starting UML you two new windows will appear, your desktop should approx. look like the following:
UML Frequently asked questions (FAQ)
- My kernel panics, if I start User Mode Linux. What is the reason?
- Where can I get more information on UML?
- How was the root file system created?
- I want to run UML at IMADA using Putty from my Windows machine without X at home.
There can be many reasons for that. But if you stopped UML by just closing the window where UML was running in, there will be still two processes named linux
left, and UML will start with a kernel panic next time. You have to kill these processes, for example with killall -9 linux
. After that, UML should start again. It is a good idea to stop UML always with the command halt
.
The User-mode Linux Kernel Home Page can be found here.
The root file system was created with a small script, you usually need to have root access to a machine to be able to create a root filesystem. If you are really interested take a look here.
To do this /etc/inittab
in the root file system needs to be changed slightly. You need a running user mode linux - comment out the last two lines in /etc/inittab
, and restart user mode linux.
# Launch 2 xterms # 1:2345:respawn:/sbin/getty 38400 tty1 # 2:23:respawn:/sbin/getty 38400 tty2