User Mode Linux: Coming to a Kernel Near You, Part 1 - page 3
What Exactly is User Mode Linux?
UML might not be production quality yet, but it's in heavy use by a number of beta testers, and of course the more, the merrier. In these days before it's integrated into the main, production kernel, you need to follow two installation steps in order to add it to your machine. I'm going to expressly cover methods that utilize either the RPM or Debian package management system. If you desperately feel the need to build it from source, I recommend that you do a lot of reading before you start. I've included a resource list at the end of Part 2 of this article.
The two steps involved in installing UML are first to install the UML's kernel (not to be confused with your main machine's kernel, we're not replacing it), and then to add the UML's filesystem. To install the kernel, if you're running a Debian system or want to try it on a Debian-related distribution, then type the following:
apt-get install user-mode-linux
That's it (for the kernel portion of the installation). Really.
If you're using an RPM-based distribution, then start by going to the UML project site on SourceForge (http://user-mode-linux.sourceforge.net/). Click the Downloading It link, scroll down to the Recommended Installation section, and click the specified RPM in the table to download the (approximately 1.8 MB) file. Once you've got the file downloaded, change to the directory you placed it in, and type as root or while su'ed into the superuser account:
rpm -ivh user_mode_linux
Press the Tab key to expand the filename and press Enter. This action will install the kernel for you.
Once you have the kernel installed, you'll need to add a UML filesystem. Which filesystem you choose depends on what distribution you want to run on your virtual machine. There are a number of choices available in the download section of http://user-mode-linux.sourceforge.net/. The abbreviations are md for Mandrake (www.mandrake.com), rh for Red Hat (www.redhat.com), toms for Tom's Linux (www.toms.net/rb/), co for Conectiva (www.conectiva.com), and debian for, well, Debian (www.debian.org).
These filesystem snapshots are all offered in .bz2 format, so you type
bunzip2 filename to unpack them.
By default, UML expects you to be working within X, and therefore opens a pair of login windows as you start the system_giving you an error if you aren't in X. I'm going to focus on running this in X since the purpose here is to introduce you to UML, not to send you fussing with the thing trying to get it to run exactly the way you want it.
If you're not interested in trying to figure out how to get this to work the way you want, then by far the easiest method is to run your UML within the GUI. All you have to do from here is type the following to try out your virtual Linux system from the X Window System with:
Once your UML has started, then it will open a pair of virtual consoles, one of which is shown in Figure 1.
There are two login accounts enabled by default. One of them is the root user, with the clever password root (you'll obviously want to change that as soon as possible if anyone else has access to the system), and the other is the account user with the password user (another one you might want to change). The first time you log in the system might require you to change the password, so be prepared.
Mind you, this is the equivalent of installing a new, isolated, generic box. If you're out to develop software that doesn't require networking or beta test (again without needing networking) then this might be exactly what you're looking for. If not, read on.
Note: If you insist on not using the GUI, then you have a bit of work ahead of you. See http://user-mode-linux.sourceforge.net/input.html for coverage of this feature. One example of running a UML on one of your host's virtual consoles, involves typing something like the following in the first virtual console:linux ubd0=/home/dee/Downloads/root_fs.rh-7.2-server.pristine.20020312 con=tty:/dev/tty1
In Part II of this article, we will examine how to connect your UML to the outside world and polishing up your UML configuration.
Dee-Ann LeBlanc is an award-winning technical author with 11 books and
over seventy articles in print. Along with writing, Dee-Ann teaches,
develops courses, and also consults when time allows. Learn more at
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 2Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 3Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative
- 4Linux Top 3: Fedora, Ubuntu and Gluster Lose Community Leaders
- 5Red Hat Enterprise Linux 7 Finally Hits the Big Time