Using User-Mode-Linux in UTCS

Prof. Yongguang Zhang, October 1, 2002

Why User-Mode-Linux (UML)
How to run UML in UTCS
UML Networking
Compile Your Own UML Kernel
Project Ideas
More Questions

Why User-Mode-Linux (UML)

In a nutshell, User-Mode-Linux (UML) is to run a full-blown Linux on top of Linux. It gives you a virtual linux machine that you can do anything in it without needing a dedicated physical machine or root privileges in UTCS.

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:

How to run UML in UTCS

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.

UML Networking

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 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":

The idea is that if you carefully set up your own multicast address/port, and set a small ttl (like 1), you can have your own UML network not to interfer with others. The network device seen by UML will be ethn.

In a limited way, you can also connect to the real world. Specific the following for "eth0":

Once you boot up UML and login, do
	ifconfig eth0 up
	route add default gw
	mv /etc/resolv.conf /etc/resolv.conf.local
	cp /mnt/host/etc/resolv.conf /etc/resolv.conf
Now 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.

Compile Your Own UML Kernel

Soon you will want to compile your own linux kernel.

Project Ideas

More Questions?

UML Homepage has complete documentation, HOW-TO, FAQs, papers, presentations, source code, mailing-lists, etc.

Here are a few commonly asked questions about running UML in UTCS:

History of this document
  • [Jan/19/2003] networking with SLiRP
  • [Oct/01/2002] major upgrade, uml to 2.4.19-8um and fs to debian 3.0
  • [Nov/26/2001] add some Q&A
  • [Oct/25/2001] add 2.4.12-4um -- some UTCS linux is 2.4.10 now
  • [Oct/15/2001] upgrade from 2.4.9-1um to 2.4.9-5um (>=2.4.9-6um won't work on UTCS linux 2.2.19)
  • [Sep/18/2001] creation