I’ve started the
process of creating vservers for testing the i/o limits. I decided to document
all of my steps. I’ll continue this but it won’t resume until end
of the week. I thought I should send the instructions along for peer review. I’ve
sent the message as HTML so that the modest formatting will remain intact.
It’s in 3 parts;
parts A and B should apply to anyone installing vservers. Part C, which details
the actual creation of vservers is incomplete and focused on debian and ubuntu
versions of linux.
Part A details the
installation of a plain vanilla kernel. Since most distributions use modified
kernels I explicitly included a step where you try out a plain kernel without
the vserver patches so that you’ll know if something breaks because of
the plain vanilla kernel or because of the vserver stuff.
By necessity, Part A
will be somewhat vague because I don’t even know what kernel modules I
need, let alone the ones you will need. If in doubt, compile everything as a
module (imho).
Here are the
instructions. If someone wants to WIKI them, I’ll update part C in the
wiki when I complete my steps. Otherwise, send me revision notes (cc the
mailing list please) and I’ll include them in my final doc.
PART A: PREPARE A VANILLA KERNEL
- download a vanilla kernel and unpack (i.e. tar jxvf linux-2.6.11.5.tar.bz2)
- cd into the kernel folder (i.e. cd linux-2.6.11.5)
- Configure the kernel using your favorite utility
(i.e. make config, make menuconfig, make
xconfig, make gconfig)
NOTE: Leave out x25 (not even as a module)
- run make
to build the kernel
- run make
install and make modules_install
to install the kernel modules
- you may need to build the initrd.img file (i.e. mkinitrd -o /boot/initrd.img-2.6.11.5 2.6.11.5)
- you may need to add the kernel to your grub menu.
This varies dramatically between distributions. Leave one of your known
good kernel entries in the menu.
- reboot, ensure to use the new vanilla kernel
- If everything works ok, proceed with the vserver
installation, otherwise go back and fix the problems.
PART B: PREPARE A VSERVER ENABLED KERNEL
- cd back one folder so that you are outside of the
kernel source (cd ..)
- download the vserver patch into the same folder
that holds your linux kernel source folder. (i.e. typing ls should show something like: linux-2.6.11.5/
linux-2.6.11.5.tar.bz2 linux-vserver-1.9.5.tar.bz2)
- uncompress the patch (i.e. tar jxvf linux-vserver-1.9.5.tar.bz2)
- apply the patch to the kernel (i.e. patch -p0 < patch-2.6.11.5-vs1.9.5.diff)
- cd into the kernel folder (i.e. cd linux-2.6.11.5)
- Configure the kernel with the relevant new
changes by using make oldconfig. Accept the default options unless you
know a reason to do otherwise
- edit .config and change the line
CONFIG_LOCALVERSION to something like this:
CONFIG_LOCALVERSION="-vserver" in order to differentiate your
new kernel from the vanilla kernel you made in part A
- run make
to build the new kernel
- run make
install to install the new kernel
- run make
modules_install to install the kernel modules
- you may need to build the initrd.img file (i.e. mkinitrd -o initrd.img-2.6.11.5-vs1.9.5-vserver
2.6.11.5-vs1.9.5-vserver)
- you may need to add the kernel to your grub menu.
This varies dramatically between distributions. Leave one of your known
good kernel entries in the menu.
- reboot, ensure to use the new vserver enabled
kernel
- If everything works ok, you can now create
virtual servers
THIS SECTION
BELOW IS INCOMPLETE! BEWARE! (ESPECIALLY AFTER STEP 9)
PART C: CREATE A VIRTUAL SERVER
- download the tools for the vserver and unpack
(i.e. tar jxvf
util-vserver-0.30.204.tar.bz2)
- cd into the tools folder (i.e. cd util-vserver-0.30.204)
- run ./configure
to configure the tools. You may have to resolve dependency problems at
this point. I had a few but the instructions provided with the error
helped in all cases.
- run make
and if all works well, run make check to
confirm things are good.
- if all is well, install the tools by running make install
- NOTE: At this point, the installation will
become somewhat distribution specific. I am using Ubuntu 4.1 (Warty) as
the host and I am also using it as the guest operating system. Fedora
core has the best support so you may want to use the current release of
Fedora for both your host and guest. If you want Ubuntu/Debian, these
instructions will work for you:
- Ensure you have the debootstrap package installed
(i.e. apt-get install debootstrap)
- mkdir
/vservers (if your / partition is low on disk space,
consider either mounting new filesystem on /vservers or creating a
vservers folder on another filesystem and linking it to /vservers - you
will need a lot of disk space here)
- Create the new ubuntu disk image. If you want to
use debian, google for debootstrap and you should see alternate syntax to
use for the debootstrap program. (i.e. to create a virtual server named
"vsa" with the ip address "192.168.1.99" and the host
name "vsa.mynetwork.com" use this command: vserver vsa build -m debootstrap --hostname vsa.mynetwork.com
--netdev eth0 --interface 192.168.1.99/24 -- -d warty -m
http://archive.ubuntulinux.org/ubuntu)
- After much installing and configuring you will be
prompted with a message similar to "I: Base system installed
successfully." which means your vserver is setup.
- Start the vserver named "vsa" by
running the command vserver vsa start
- Enter the vserver named "vsa" by
issuing the command vserver vsa enter
--
Matthew Nuzum
<[EMAIL PROTECTED]>
www.followers.net -
Makers of “Elite Content Management System”
View samples of
Elite CMS in action by visiting
http://www.elitecms.com