Follow Slashdot stories on Twitter


Forgot your password?

User Mode Linux 77

Ravi writes "There is commercial grade software like VMware (which does full virtualization) as opposed to open source approaches like Xen which do partial virtualization. But besides these two, there is a very interesting piece of software called User Mode Linux (UML), which can be used to create virtual Linux machines within a Linux computer. Unique to UML is that support for it has been incorporated into the mainstream Linux kernel tree and it is now a fully supported part of the official Linux kernel. On this note, UML gains a lot of significance. UML has been created and maintained by Jeff Dike, who is known throughout the Linux technical community. And when someone who has created a popular software decides to author a book on the subject, then that book is sure to hold a lot of promise. So when I came across the book titled User Mode Linux, authored by Dike under Bruce Perens' Open Source Series, I just couldn't resist getting my hands on it." Read on for the rest of Ravi's review.
User Mode Linux
author Jeff Dike
pages 330
publisher Prentice Hall
rating 9
reviewer Ravi
ISBN 0131865056
summary Guidance from UML's creator on setting up and putting to work your own instances of User Mode Linux virtual machines.

In the first chapter, Dike compares UML and various other virtualization technologies, lists several ways in which UML can be put to use, and provides a brief history of UML in which he shares with the reader the trials and tribulations he faced in getting the UML patch incorporated in the official Linux kernel tree.

In the next chapter, "A quick look at UML," Dike walks the reader through setting up UML to work in one's Linux distribution, which includes downloading the UML-enabled Linux kernel binary and the file system, and then booting into UML. Here we get a taste of the utilities which are used to modify in real time the configuration parameters of UML from the host OS. This chapter gives a sound introduction to what goes on behind the booting of UML and how it differs from the host OS in which it is running. For instance, the author aptly explains with the aid of examples that UML is at the same time a process and a kernel.

Chapter 3, "Exploring UML," dissects a UML instance in more detail. Here the author explains how one can connect devices to the running UML instance using the uml_mconsole utility. Common tasks like adding swap space, attaching and detaching devices as well as setting up networking are essentially the same in UML as in any normal Linux distribution, there are a couple of extra steps needed in setting these up in a UML instance. This chapter gives a taste of accomplishing these tasks.

But is it possible to access the same UML file system simultaneously by different users? Normally, this could corrupt the file system. So what is the workaround? The solution is in the use of COW ("Copy on write") files. Dike shows how multiple users can access the same UML instance (each user having full root access) without corrupting the underlying file system using COW files. And this forms the basis for the 4th chapter of this book, "A second UML instance." In this chapter, one also gets a peep into setting up networking between two UML instances but all the advanced networking concepts are explained in a separate chapter of their own.

The next chapter, "Playing with a UML Instance," takes the reader through a variety of things one can do with UML. For example, the author shows how one can just plug in a tar file to a block device and then access it in the UML instance. He also demonstrates how to run X inside UML.

Next, the book goes into a detailed analysis of the various file systems that could be used in UML. Here the author explains the various ways of mounting a directory on the host as a UML directory. In fact you can easily mount your home directory into a UML instance and access your files from inside the UML.

One cannot enable networking in UML quite the same way as in a normal Linux distribution. This is because the UML runs as a process within another Linux distribution. So for networking to work properly between the UML instance and the host system or between different UML instances, a device called TUN/TAP has to be configured first. Also one has to configure the host system to allow the UML instance access to the outside world; this could include tasks like enabling IP forwarding, routing packets to and from the UML, and bridging the host side of the virtual interface to the physical ethernet device. Chapter 7, "UML Networking in Depth," takes a broad look into these networking aspects of UML. I especially liked this chapter because this opens up avenues for people who are interested in learning more about networking. For example, following what has been covered in this chapter, one can -- given enough memory -- set up a network lab on one's machine consisting of a series of UML virtual machines and practice things like switching and bridging. At the end of this chapter, the author gives a step-by-step explanation of setting up a multicast network consisting of three UMLs and three two-node networks, and another UML acting as a switch.

In running UML virtual machines on a host system, at some point of time, it becomes inevitable that one has to manage these virtual systems from within the host. Tasks such as increasing or decreasing the memory allocation to a particular UML instance, hot-plugging a block device, starting or stopping the UML, and so on will have to be carried out on a regular basis especially if the host is a production system. One can install the uml utilities package on one's Linux server to take care of all these tasks from outside the UML. Chapter 8, "Managing UML Instances from the Host," takes a broad look at just that. This chapter covers configuring the different aspects of UML using the UML management console.

The next two chapters cover the nitty-gritty details of configuring UML in a small and large server setup, respectively. When UML is run in production environments, the security of the system takes precedence, and these chapters focus not just on the configuration details, but also on explaining how to run UML securely.

A look around the web will throw up lots of UML file systems and UML-enabled Linux kernels. But the best way (also the most secure way) of getting a UML kernel is to download the official Linux kernel source and compile it yourself. Chapter 11, "Compiling UML from Source," takes a detailed look at compiling the official Linux kernel from source. Here the author explains each and every UML specific option which could be enabled in the configuration file of the kernel prior to compiling it.

In "Specialized UML configurations," Dike demonstrates how to set up a small UML cluster using Oracle's ocfs2. The interesting thing is that the shared storage device which is common for all clusters and which consists of expensive hardware is just a file when implementing a UML cluster. Through this chapter, the author displays the true power of UML and explains how a UML could be used in stimulating hardware which is difficult or expensive to acquire.

The last chapter of the book gives a road map of UML and lists the enhancements that might take place in UML in the future. More specifically, he talks about the externfs filesystem, whose purpose is to allow any reasonable external data to be imported as a UML filesystem, about captive UML, putting a UML instance inside Apache, and so on.

The book also contain two short appendices which list the command line options while booting a UML instance, as well as a short reference on the UML utilities which could make it easier to manage the UML instances on ones machine.

With the continuing increase in processor speeds and availability of cheap memory, it has become feasible to use virtualization technology in production machines. UML can be put to use in diverse situations such as server consolidation where multiple UML instances running on a single machine accomplish the tasks of multiple physical server machines; in education, where each student can be assigned a complete virtual Linux lab setup with root access; in application development; and in disaster recovery practice.

User Mode Linux is a result-oriented book with stress given to accomplishing tasks rather than concentrating on theory alone. That said, this book has enough details to give a broad idea about UML and its implementation. That it was written by Jeff Dike gives this book a lot of credibility over books written on the same subject by others. UML being a niche area, anyone who is interested in this subject will gain a lot from this book.

Ravi Kumar is passionate about GNU/Linux. And likes to share his thoughts through his blog on GNU/Linux. You can purchase User Mode Linux from Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

User Mode Linux

Comments Filter:
  • by whargoul ( 932206 ) on Monday June 05, 2006 @04:36PM (#15475164) Homepage
    UML = "Unified Modeling Language" - let's not add a new meaning to this acronym as it's sure to be confusing when someone starts talking about reading and writing UML on their UML workstation.
    • by l4m3z0r ( 799504 ) <kevin@uberstyl e . n et> on Monday June 05, 2006 @04:43PM (#15475235)
      No, please replace UML in everyones minds with User Mode Linux so never again will the horror that is Unified Modeling Language be forced upon us.
      • Offtopic (Score:2, Insightful)

        by bill_kress ( 99356 )
        May I ask what you do for programming/modeling? I use pieces of UML because it works--it is a valid way to convey my design to my co-workers and we can implement together.

        Class diagrams are ubiquitous these days, and I can't come up with a better way to show program flow than a sequence diagram. Most of the rest I could live without on a smallish sized project, but when you are using multiple architects, many of the others become useful.

        If you have used something better (I don't love UML, it's anything bu
        • Re:Offtopic (Score:2, Offtopic)

          by hyfe ( 641811 )
          Class diagrams are ubiquitous these days, and I can't come up with a better way to show program flow than a sequence diagram.

          Don't confuse UML with Class Diagrams and Flow Charts, as I was using them long before I had ever heard of UML; the concepts really are intuitive and self-explanatory. Ditching UML doesn't mean ditching them, it just means ditching the specific UML standard and use something sane instead..

          .. which everybody kinda seem to be doing anyways. Mostly everybody I've seen using "UML" dia

          • Okay, we agree that there are diagrams that are useful for communication.

            Somebody comes along and standardizes these "Useful Diagrams", collects them into a group and gives them a name and draws some examples so that we can all be talking about the same thing and understand each others diagrams.

            As far as I know, this is all UML is. They have certian specific recomendations on how and when you should use these diagrams, but that is adapted per team/team size.

            Makes me wonder if your problem might really be a
            • Your stance kind of seems like saying "I like to write email but I don't believe in dictionaries"

              Yes, provided correct spelling would be an hinderance to actually understanding my emails (like if I insisted on a 15-century British Dictionary being correct).. and yes, just as with people hating XML, it's the misuse that's making me hate it. I mean, that follows pretty much from the definition of 'misuse' :)

        • or better yet, show me an example of one of your design documents that you think does a great job of conveying your design to someone else?

          Unfortunately I can't do that as I'm pretty sure it would be violating contracts with my employer, however one thing thats worked extremely well for us in the past, is building the class specifications in a wiki(this is usually during implementation though rather than prior to and ends up being documentation after the project is 'complete') most of our implementation
          • I tried that, but the problem is that I never found a wiki that allowed UML-style diagrams to be built by multiple users. You could (and we did) easily draw one in visio and upload it as a jpeg, but that's really not much better than just creating the document and checking it into version control.

            Did you find a Wiki that did a good job of UML-style design, and if so, please let me in on it!
      • No, please replace UML in everyones minds with User Mode Linux so never again will the horror that is Unified Modeling Language be forced upon us.

        I actually like Unified Modeling Language when used appropriately.

        If you hate UML, you've probably only seen class diagrams. I hate them, too. I find that they tend to get out of sync with reality and aren't that easy to read anyway (why put the complete list of methods in with the inheritance structure? too much information!). Tools that generate code from th

    • You could be writing UML on a UML workstation at UML (University of Massachusetts Lowell)
    • UML = "Unified Modeling Language" - let's not add a new meaning to this acronym as it's sure to be confusing when someone starts talking about reading and writing UML on their UML workstation.

      The world is filled with short lived acronyms that should is only understandable in it's context. However, UML = "Unified Modeling Language" is just hubris produced by a company that demands a shitload of money for a shitty process.

  • Looks like the book is not actually available for download from the Perens Series [] web page yet.
  • UML? (Score:1, Informative)

    by cpux ( 970708 )
    You mean that Unified Modeling Language I spent a semester learning and to this day can't stand cause the professor was a knucklehead?
    • My knucklehead teacher was some Hungarian guy (nothing against Hungarians) that spoke very broken english.. trying to explain UML and Rational Rose.. oh the fun I had.
    • I wouldn't blame the Prof. I will re-read that book I bought and see if I still think it's a theoretically good idea badly implemented. But only when I'm really bored, or I need to (i.e. it's in a job definition).
  • by chroma ( 33185 ) * <{chroma} {at} {}> on Monday June 05, 2006 @04:44PM (#15475253) Homepage
    I wanted to use User Mode Linux to simulate a complete production environment for a recent project. The big problem was that it didn't support the latest thread libraries. This was a big impediment to get Java running. Does the newest UML support running Java server apps?
    • You might try just using a chroot'ed installation of your software. If you have a linux installation in /home/foo/testsystem, you will need to mount the proc system in /home/foo/testsystem/proc/. There is no problem with mounting the proc filesystem in multiple directories.
    • Yeah, UserModeLinux was suggested to me also for an embedded project I work on. But the issue of having the UMLkernel be the one you need, yet your host is different, whacked out patches that don't match up to known kernel versions, yada, yada....

      I went and got Qemu, and that works much better. After a few days I have a script that builds all the code, makes an img file and configures the whole show to be networked when running. Oh and works in windows too.

    • Why not just use vmware? It's free now. Well, it's in beta, but the final free version should be coming out "real soon now". It's been very good for me on both windows and linux except that sometimes a bug in alpha centauri makes windows 98 halt... not sure if that's vmware or win98 except that I've never seen it before. Regardless, right now I have a Windows 98 VM on my Ubuntu laptop and a Debian sarge VM on my WinXP desktop (for different reasons.)
    • by nicferrier ( 901213 ) on Monday June 05, 2006 @06:40PM (#15476136)
      the very latest UML (in kernel 2.6.17?) does have support for NPTL.

      Having said that I have succesfully run Sun and GNU Java in the 2.6.15 UML and 2.6.8 UML neither of which support NPTL. It's just like the old days, you end up with a lot of processes. It's ok for simulating environments though.

    • by rimu guy ( 665008 ) * on Monday June 05, 2006 @10:34PM (#15477246) Homepage

      UML Works great with Java apps. We've been hosting Java user's on UML VPSs since 2003 (latterly we are using Xen).

      The version of UML we are using does not have NPTL (/lib/tls) support. This is probably what you're referring to. I've seen patches for NPTL support, so this is either fully supported now or 'on its way'.

      Great Java Hosting (with or without /lib/tls) []

  • by Anonymous Coward
    Funny how this stuff comes into the picture after the hype has already passed us ages ago. I mean, UML's were very nice when it first started but it is IMO also a very good display as to why some things simply won't work on Linux. For example; UML's are nice but if you don't have the SKA patch its becoming tedious on your system, if not impossible, to run several UML's on the same box. And yes; the UML support has been added to the kernel, sorta. Ofcourse they didn't include everything, if you really wish t
    • I too was impressed with UML. But all the information I found on it is years old and there doesn't seem to be any new progress. And I agree the lack of SKAs kernel integration is disappointing.

      UML is an awesome idea and I would love to see it become more popular, but I just don't see it going anywhere.
    • But the very usefull SKA patch has /never/ made it into the kernel tree. I mean, wtf?

      Well, considering there's a SKAS0 mode now which doesn't require patching the host kernel, this isn't that big a deal anymore. Running Linux on a host kernel without the SKAS patch isn't really a performance killer anymore.
  • by martinultima ( 832468 ) <> on Monday June 05, 2006 @05:01PM (#15475394) Homepage Journal
    But the technology itself kicks ass. For example, my Web site is hosted by [], which offers User Mode Linux-based servers for very low prices, which means you can have full root access without needing a dedicated server – not trying to get off topic or advertise or anything, just mentioning a very good example of the technology in use.
  • QEMU ? (Score:2, Interesting)

    by pterjan ( 740570 )
    When I read There is commercial grade software like VMware (which does full virtualization) as opposed to open source approaches like Xen which do partial virtualization. I think, don't he know QEMU ( ? The sentence tells commercial apps do full virtualisation and open source ones do partial virtualization...
    • Re:QEMU ? (Score:3, Informative)

      by psmears ( 629712 )

      From the site you linked to:

      The QEMU Accelerator is free to use, but it is a closed source proprietary product.

      ... so perhaps not the best example of an open source virtualisation app. (The QEMU accelerator is needed to true virtualisation like the other examples being discussed—without that, QEMU is just a processor simulator, and so runs 5–10 times slower—at least, according to its own web page!)

      [OT: Apologies for the boldface—the new style doesn’t allow italics inside

  • After trying several different "virtual" servers, I ended up at Linode [], which uses User Mode Linux. I run two servers: a personal domain for mail, web, etc. and a file server for my employer.

    I can install any distribution I want, or pick from a set of initial distributions they provide. The kernel is the only software component I can't change. I can update to newer versions or apply security patches as often as I want, without waiting for the administrator of the system to do it.

    The web-based interf

  • OpenVZ [], which is a subset of the commercial Virtuozzo product, is being lobbyed for inclusion in the kernel.

    Although Xen [] requires patching of the kernel, it is the best performing open source virtualization layer at present.
    • FreeBSD Jails and OpenSolaris Zones are current open source solutions as well and their performance likely matches if not excels over para-virtualization solutions such as Xen.
      • Indeed, OS-level virtualization approach (as in Solaris Zones, Jails or OpenVZ) performance can not be beaten by para-virtualization approach just because OS-level virt. has the least possible overhead (and, say, does not have an overhead of running multiple kernels which both Xen and UML have).
  • I was given a free copy of the book, by the publisher, in exchange for posting about it or telling my friends about it.
    In short, the books is not written for the pragmatist. It is written to give a pretty good description of the internals of UML, which is honestly, not very useful.

    A couple of chapters devoted to usage and practical applications would help.
    A comparison where uml is better than other alternatives would help.

    The literature also gets buried in its own details, just as if it is reading like sou
  • Virtualization is neat, but now you get to have multiple levels of system administration. It's not clear that this will improve security, but it's definitely going to mean more files to misconfigure.

    The Linux/Xen/UML world seems to be trying to get to a secure microkernel operating system, with user-mode drivers and limited-authority operating system components. The way they're getting there is wierd, but it might work. Or it might turn into the biggest configuration nightmare since Sendmail.

  • Isn't loadable module support still considered a huge security hole in UML? Last I heard (from a guy who used and liked UML), to have a prayer of being secure, the UML kernel had to be built with no module loading support, because you could just build a module for the UML kernel, load it in, and make it do things in the host environment at will?

    I dunno, to me, that leaves UML in the category of "interesting toy", even "useful for development"... but not really something you can safely use in production. Or

To do two things at once is to do neither. -- Publilius Syrus