User Mode Linux (UML) is pretty amazing: you run a complete Linux installation inside your normal system. This is what's called a virtual machine. If you've seen VMWare in action, you'll know what I mean.
There's an enormous amount of old information floating around on UML. The most important thing to know is: from kernel 2.6.9, UML is standard in the kernel; it doesn't need to be patched. Below are the steps to get an UML instance running on Fedora Core 3, but other distributions will probably be fine as well. In virtual machine terms, the host is your normal, real system. The guest is the virtual machine.
Part A, if you want to run Fedora Core 3 on a "stock" kernel (you can skip this if you want):
$ make bzImage && make modules && make install
Part B, compiling the guest kernel:
$ cd ~/uml</tt> $ ./vmlinux udb0=Debian-3.0r0.ext2</tt>
If all's well, a boot sequence should be shown, and after 10 seconds, a login prompt. Login with root.
If your UML instance runs, shut it down. As root, load the tun/tap kernel module which provides UML with a virtual network device:
# modprobe ethertap
Then start your UML instance again, passing it a number of options for networking:
$ ./vmlinux ubd0=Debian-3.0r0.ext2 eth0=ethertap,tap0,fe:fd:0:0:0:1,10.0.0.37
This tells the UML instance that for network device eth0:
After the UML instance started, bring up the eth0 device, remove unnecessary routes and add the default gateway:
# ifconfig eth0 10.0.0.27 netmask 255.255.255.0 # route del -net 10.0.0.27 dev eth0 netmask 255.255.255.0 # route add default gw 10.0.0.37
You will probably put UML instances in the background. Now where have they put the power button? Download the UML tools from here: http://prdownloads.sourceforge.net/user-mode-linux/uml_utilities_20040406.tar.bz2
Unpack and install them as follows:
$ tar xfj uml_utilities_20040406.tar.bz $ cd tools $ make all $ su - # make install DESTDIR=/
This will install the following files:
/usr/bin/uml_net /usr/bin/tunctl /usr/bin/uml_mkcow /usr/bin/uml_mconsole /usr/bin/uml_watchdog /usr/bin/uml_moo /usr/bin/uml_switch /usr/bin/jailtest /usr/lib/uml /usr/lib/uml/port-helper
To test, shut your UML down if it was running (on the prompt of the guest, type "shutdown -h now"). Then start it again, and pass the umid option with an identifier, like so:
./vmlinux umid=debian ubd0=Debian-3.0r0.ext2
Open another console on the host and test it as follows (bold is your input):
$ uml_mconsole debian
On the prompt, type "version" and press enter. The console should respond:
OK Linux (none) 2.6.9 #1 Sun May 1 16:00:28 CEST 2005 i686
Exit with CTRL-D. Check out the HOWTO, section 10 for an overview of all possible commands.
http://edeca.net/articles/bridging/
See also Cheap VPS Hosting.