Why User-Mode-Linux (UML)
How to run UML in UTCS
UML Networking
Compile Your Own UML Kernel
Project Ideas
More Questions
If you want to know more about UML:
UML can run on any UTCS linux machines (e.g., "publinux" hosts). You can do the following and more without root access:
First, copy the root file system (root_fs_utcs) to your directory. The file is about 17MB.
cp /projects/uml/fs/root_fs_utcs .
To run UML:
/projects/uml/bin/linux ubd0=root_fs_utcs eth0=mcast
The root password for this virtual linux host is "root". To shutdown UML, login as root and type "halt".
You can run multiple instances of UML, in the same or different linux hosts. However, each instance will need its own separate root_fs_utcs file because linux will write to it. (To save some space, see sharing file systems.)
This version of UML is 2.4.19-8um. I compiled it to include netfilter & tcpdump, but to exclude some uncommon modules or those needed root to set up (see config file /projects/uml/config/uml.config-2.4.19). The root file system is a version of Debian 3.0 tailored to UTCS's departmental file system structure. Here are the changes I made: I pre-mounted the host's / onto /mnt/host and created links for /v, /u, /stage, etc., so that you can access your UTCS home directory as well as /lusr (/usr/local). To save more space, it reuses /usr from the host as well. Obviously, you can only access those host files that you have permissions as an ordinary user in UTCS host (even though you are now root in UML). Their uid/gid may be numeric because you haven't had a record in your UML's /etc/passwd file yet.
You may also use the following utilities:
Note that this instruction and root file system are suitable for use in UTCS only. If you want to run UML in your home computer, you may need a complete root file system and/or a different kernel. You can download those from original UML homepage.
With UML, you can easily build your own network and explore networking.
If you include the "eth0=mcast" option, the network is already up (at eth0). All you need to do is to assign an IP address:
ifconfig eth0 192.168.1.1 up
Be careful about other UMLs already running in the same UTCS LAN who may use the same IP address as yours.
If you want to have your own private UML network that will not be affected by other users running UML, you can give the following argument instead of "eth0=mcast":
In a limited way, you can also connect to the real world. Specific the following for "eth0":
eth0=slirp,FE:FD:01:02:03:04,/projects/uml/bin/slirpOnce you boot up UML and login, do
ifconfig eth0 10.0.2.15 up route add default gw 10.0.2.15 mv /etc/resolv.conf /etc/resolv.conf.local cp /mnt/host/etc/resolv.conf /etc/resolv.confNow you can make outgoing TCP connections to the Internet (but no incoming connections). Remember to restore "/etc/resolv.conf" if you no longer use this.
lynx -source http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.bz2 > linux-2.4.19.tar.bz2 bzcat linux-2.4.19.tar.bz2 | tar xf -
lynx -source http://unc.dl.sourceforge.net/user-mode-linux/uml-patch-2.4.19-8.bz2 > uml-patch-2.4.19-8.bz2and apply the patch:
cd linux-2.4.19 bzcat ../uml-patch-2.4.19-8.bz2 | patch -p1
make xconfig ARCH=um make dep ARCH=um make linux ARCH=umThe result is the binary file "linux" in this directory and you can use it in place of my linux-uml.
make modules ARCH=umbut you must install them inside UML -- run UML (using the old kernel), login as root, cd to the above UML source directory in the host file system, and do:
make modules_install ARCH=um
Here are a few commonly asked questions about running UML in UTCS:
There is a limitation which you use the host file system: any files you create while being root of UML will have your UTCS uid as the owner. That is, you cannot create files with root owner or chown to root. If the program you run has a problem with this, you may have to work on a file system "local to UML" instead of the host file system. (See below).
dd if=/dev/zero bs=1M count=100 > root_fs_2 /sbin/mke2fs root_fs_2This creates a 100MB file-system file root_fs_2. If you want it bigger or smaller, change the number 100 (MB).
Add an extra command-line option each time you run UML: ubd1=root_fs_2
Once UML is running, login as root and mount the file system:
mkdir /local mount /dev/ubd/1 /localDo a "df -k" -- you now have 100MB in /local.
First you need to find out the device names at your host machine for these two UML virtual consoles. To do that you can login to UML as root and run "dmesg". Find the strings like "Virtual console N assigned device '/dev/pts/X'". Then, in your host machine, run "screen /dev/pts/X" to be connected to the virtual console. You can also do that with a new xterm as: "xterm -e screen /dev/pts/X"