Click to See Complete Forum and Search --> : User-Mode Linux


Dun'kalis
12-30-2002, 01:51 AM
User-Mode Linux is a method for running a Linux kernel as a user process. Its very cool to mess with, and can be useful. Installing it is easy, but can be a pain.

First, go to user-mode-linux.sf.net, and download the RPM, apt-get the debs, or download the source archives. I don't have either packaging system installed, so I used the tarballs. Its easy. Download uml_utilities, uml-patch, and, to test it, root_fs_toms. I made a directory in home for this, uml-stuff/

tar jxvf uml_utilities-version.tar.bz2
cd uml_utilities-version
make && make install

Now, you need a kernel source tree to apply the uml-patch to. First, check some things:

ls -l /usr/include | grep asm
If it outputs /usr/include/asm as a symlink to your kernel source, it would be in your best interest to download a fresh tree from www.kernel.org. Get 2.4.19, and unpack it in your uml/ directory in home.

Now, lets patch it, and get ready to run it. First, copy the uml-patch to the kernel directory, and descend down to it. Lets apply the patch...

bunzip2 uml-patch.bz2
patch -p1 < uml-patch

Time to finish up!

make menuconfig ARCH=um
make linux ARCH=um
Unbzip the root_fs_toms, copy it to your nice new kernel directory as root_fs, cd down, and type:

./linux
Login as root (password root), and let the fun begin. Ever want to know what happens when you type the feared "rm -rf /"? Try it. You can't cause any damage to your real filesystem!

I'll be back later with a root_fs capable of compiling software. As a side note, give a development kernel a shot with UML!