= Linux-VServer Kernel Installation =
In Linux-VServer, the host and all guests use the same kernel. Depending on your needs, there are several ways to install this. == Debian SID (a.k.a. Debian Unstable) == Debian SID is everything but unstable, despite the "unstable" in it's name. You just get new packages every day, but no one forces you to install them. To install Linux-Vserver here you simply do: <code> apt-get install linux-image-vserver-686 </code> Depending on your machine, you may want to install another vserver kernel. Debian provides quite a number of kernels for various scenarios, you can get a list of them with <code> apt-cache search linux-image | grep vserver </code> == Fedora Core == TODO == Mandriva == TODO == Ubuntu == TODO == Compilation from Source == This chapter has been taken from [Step-by-Step Guide 2.6], but with simplifications and little adaptions. === Getting the kernel and patches === You'll need the vanilla kernel sources (i.e. those from [kernel.org]) and (of course) a Linux-VServer patch for the kernel you intend to use. At the [main page], below the headline "Downloads" you'll find a table of supported kernel versions and patches. In this document, I'll just use Linux 2.6.14.4 and Linux-VServer 2.0.1. First, we'll create a directory for our sources, if you already got one, feel free to skip this step and/or adjust the paths to your needs. <code> # Create a directory for our sources mkdir ~/src # Switch to that directory cd ~/src </code> Now that we have a place to store our sources, we need to fetch them. We start with the vanilla sources. <code> # Get Linux 2.6.14.4 sources wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.4.tar.bz2 # Extract them tar xjf linux-2.6.14.4.tar.bz2 </code> Now it's time to get the Linux-VServer patch and apply it to the sources. <code> # Get the Linux-VServer 2.01 patch wget http://www.13thfloor.at/vserver/d_rel26/v2.1.0/patch-2.6.14.4-vs2.1.0.diff.bz2 # Switch to the kernel directory cd linux-2.6.14.4 # Patch the sources bzcat ../patch-2.6.14.4-vs2.1.0.diff.bz | patch -p1 </code> === Configuring the kernel === Now let's start configuring that copy, I'll only explain some of the Linux-VServer-specific kernel configuration options here (as of 2.0), the rest is up to you ;). You can choose whatever configuration method you like, for example: <code> # Configure the kernel using a ncurses based menu make menuconfig </code> *CONFIG_KERNEL_HZ *:This allows you to specify the frequency at which the timer interrupt will occur. If you don't know what this is, better leave it at the default value of 1000. *CONFIG_SPLIT_X *:This allows you to change the kernel's memory split. Linux uses a 3/1 split by default, that means a process can use up to 3GB of memory and kernel space has 1GB of memory available. This also means, that only about 860MB lowmem are usable, thus if you have 1GB or more RAM, you'd normally need to enable highmem support, which unfortunately comes at some cost. By changing the split, you can get more lowmem available without enabling highmem support, but your processes will be limited to less memory than before. Often this is not a concern, because there won't be any process that needs this much memory. If you, for example, have a box with 2GB of RAM, change the split to 2/2 to make use of that RAM without enabling highmem support. *CONFIG_VSERVER_PROC_SECURE *:Enables Proc-Security (read that page, really, read it! ;) *CONFIG_VSERVER_HARDCPU *:Enables hard cpu limits. Linux-VServer supports a token bucket scheduler to adjust cpu usage of the vservers. If you don't enable this option, the scheduler will only adjust priorities for the vservers, with this option enabled, you can also choose to use the hard scheduler which will put the context on hold if it has used up its cpu tokens. For details, please take a look at documentation specific to this feature. *CONFIG_INOXID_X *:Linux-VServer has a feature that allows you to limit a vserver's disk space usage on a shared partition by tagging files with context information, this option specifies the way the tagging is done. Usually the default should be just fine. For details, take a look at the documenation covering this topic. Note: The kernel configuration allows you to select between different security implementations, one of them is the capability system. As you might know, Linux-VServer uses this system heavily, thus you just have to have this one enabled (it is possible to build it as a module, but for a Linux-VServer system, it's not worth the effort, as you need it anyway). === Building the kernel === Now that we have configured the kernel the way we want it, it's time to build it. <code> # Build the kernel make </code> If you don't happen to have a really fast box, it is a good time to get a new cup of coffee now ;) === Installing the kernel and rebooting === This is distribution specific, but quite often you just need to <code> # make modules_install # make install # shutdown -r now </code> and select the new VServer-Kernel in your bootloader. If this didn't work, you have to read the documentation for your Linux distribution, or you ask google for kernel compilation and installation. -- This page is part of the VServerManual. |