View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > User-mode Linux

From LQWiki

Jump to: navigation, search

User-Mode Linux has become a part of the mainstream 2.6 Linux kernel and allows you to run Linux on top of Linux. This tool can be very useful when learning Linux as it allows a student to destroy his Linux install and replace it quickly with a fresh one (take backup before playing with the install of course).


Description

User-mode Linux consists of a binary (called linux) that behaves as a linux kernel, but can be called from within a running Linux system.

From the site:

User-Mode Linux is a safe, secure way of running Linux versions and Linux processes. Run buggy software, experiment with new Linux kernels or distributions, and poke around in the internals of Linux, all without risking your main Linux setup.

User-Mode Linux gives you a virtual machine that may have more hardware and software virtual resources than your actual, physical computer. Disk storage for the virtual machine is entirely contained inside a single file on your physical machine. You can assign your virtual machine only the hardware access you want it to have. With properly limited access, nothing you do on the virtual machine can change or damage your real computer, or its software.

How to start

How you start depends on your distribution, however, this tutorial gives you an overview that you can adapt to your needs. This tutorial uses SuSE as an example.

yast2 -i uml-utilities
wget ftp.gwdg.de/pub/opensuse/distribution/SL-10.1/inst-source/suse/i586/kernel-um-2.6.16.13-4.i586.rpm
rpm -ivh kernel-um-2.6.16.13-4.i586.rpm
  • Install Linux into a directory
yast2 dirinstall

In this example, we install Linux to /usermodelinux.

  • Start User mode linux
cd /boot
./vmlinux-um
  • Verify that you get an error like
VFS: Cannot open root device "98:0" or unknown-block(98,0)
Please append a correct "root=" boot option

This is because User-mode Linux tries to start from /dev/ubd0 as initial ramdisk and cannot find this.

  • Download an initrd from the project's home:
wget http://switch.dl.sourceforge.net/sourceforge/user-mode-linux/Debian-3.0r0.ext2.bz2
bunzip2 Debian-3.0r0.ext2.bz2
  • Start your User-mode linux
./vmlinux-um ubd0=Debian-3.0r0.ext2
  • Your User-mode Linux now starts

See also


Personal tools