We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the Wiki Team page for instructions how to help or browse through our new wiki at wiki.linux-vserver.org to find the information already migrated.

Fedora Core 3 How To

This howto is supposed to guide you through the process of installing a new box with fedora core 3, turning it into a host, create a vserver and get it updated to the latest packages available. This HowTo? should also work for Fedore Core 2.

What about Fedora Core 1 and older Redhat Linux releases?
This Howto only covers FC2/FC3 since they are based on Kernel 2.6.x. If you have a Fedora Core 1 box, feel free to use the FedoraHowTo. But be aware that Fc1 and older are already in "legacy"-mode regarding their support from redhat/fedora so updates to vital parts of the os might come either slow or don't show up in prebuild form at all. You've been warned.

A. Requirements

  1. What do I need to get started?
    • The Fedora Core 3 CD Set ( 3 CDs )
    • Internet connection for updates and kernel-download
    • a spare computer to install on
  2. Do I have to use a blank computer?
    • This howto assumes you have a blank (read: nothing installed) computer. Vserver doesn't require that of course, but for the the sake of a stable and clean system, it is a requirement of this howto.
  3. Do I have to have multiple offical IP Addresses?
    • Short Answer: Yes
    • Long Answer: No, for a start they can be private and you can use Destination-Nat (man iptables) to make services on a vserver available to the outside world. This is not recommended though.

B. Host installation

  1. Fedora Core installation
    It's assumed that you know how to do a basic setup of Fedora Core in general, thus only a few things required/recommended for a vserver system are listed here
    • Do a minimalistic install - you don't want to use the host server for anything but beeing host (installing sshd might be a good idea anyway)
    • If you want to use reiserfs, pass the option "reiserfs" on the fedora boot prompt (warning: ext3 is recommended for the vserver. If you want to use reiserfs with vserver, you have to mount your reiserfs partitions with the "attrs" mount option, or you won't get all the securities of vserver)
    • You'll have to build your own kernel, thus installing the kernel-development group is a good idea
    • Vserver are installed in /vservers, so it might be a good idea to create a seperate partition for them ( make it big enough!! >8 GB for a full install per server )
    Besides these hints, do a normal install of Fedora Core 3 on your system.
  2. Fedora Core update
    Since Core 3 is out for quite some time now, many packages have been updated. The original fedora supplied tool for updating is yum. Since the vserver-tools use apt4rpm, we're going to use apt here too. To get a good apt and a fast repository, we're going to use the freshrpms.net version
    • download apt (latest release as of this wirting is [apt-0.5.15cnc6-1.1].
    • install it using rpm -ihv apt-0.5.15cnc6-1.1.fc3.fr.i386.rpm
    • initialize the repository database and upgrade of the system: apt-get update && apt-get upgrade
  3. New vserver enabled kernel
    The Fedora default Kernel release is highly patched already and thus might not be compatible with the patches supplied by linux-vserver.org. For this reason, we are going to use a vanilla-kernel (read: an unmodified original linux kernel) from kernel.org. If you do require a patch supplied by redhat/fedora this howto doesn't work for you, please check the contact page for ways to contact us, maybe someone can help you out. (As a general outline, get the src-rpm for your desired kernel version and try to locate the patch within to apply manually *after* you applied the vserver patchset.)
    • Ftp to a local kernel.org mirror ( usually the url ftp://ftp.<country-code>.kernel.org should work, e.g. ftp.de.kernel.org for germany)
    • Go to /pub/linux/kernel/v2.6/
    • Get the latest linux-2.6.??.tar.bz2 ( where ?? is the kernel subversion, by the time of this writing, the latest is 11)
    • Get the matching .sign file
    • Once both files are downloaded, verify the pgp signature of the archive:
    Add the linux kernel OpenPGP? signature to your local gpg by running gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E
    Now verify the kernel: gpg --verify linux-2.6.??.tar.bz2.sign linux-2.6.??.tar.bz2 ( for more details about this, visit [Kernel.org])
    • Move the kernel archive to /usr/src (mv linux-2.6.??.tar.bz2 /usr/src/) and unpack it (tar -xjf linux-2.6.??.tar.bz2)
    • Donwload [the Patchset] now (by the time of this writing, the latest version is 1.9.5-rc2 against kernel 2.6.11)
    • Run the patch against the kernel from within /usr/src ( patch -p0 < patch-2.6.??-vs1.9.5-rc2.diff )
    • Now enter the linux-2.6.?? source directory and run make menuconfig. You need to make sure all the required vserver options are enabled, besides that, build a kernel as usual. ( on help how to build a custom kernel, please google ;) )
    For the 2.6.11 kernel, maybe others, SELinux should be disabled as it conflicts with vserver, and an initrd should be built using the mkinitrd script for udev.
  4. Using the vserver kernel
    Before you can make use of the kernel, we need to do some minor modifications to the /etc/fstab and the /boot/grub/grub.conf. Redhat/Fedora uses LABEL for partitions, which might be considered a nice idea but requires a kernel patch we don't have installed. For our kernel to work, the real device needs to be defined, thus the fstab needs to be changed. Depending on your setup, this can be only / or some more. To find out, which partitions is what, do a simple mount to get a list of mounted devices and compare them with the labled locations in the /etc/fstab. For example if / is mounted on /dev/hda1, you'll have to modify LABEL=/ to be /dev/hda1. Do the same for the kernel options (root=...) in grub.conf. Do not use the vserver-kernel only. Keep a working backup-kernel ready so you know you can reboot to a working system neverthe less.
    Reboot :)
    If you didn't break your kernel setup and i didn't loose you on the way to this line, you should have a vserver enabled kernel ready by now.
  5. Vserver utils
    A vserver enabled kernel might be nice, but its pretty pointless unless you have some tools to make use of its functionality.
    • Download [util-vserver](v0.30.204)
    • Run rpmbuild on it (rpmbuild --without xalan -tb util-vserver-0.30.204.tar.bz2) (if you don't have rpmbuild installed do apt-get install rpm-build)
    Sidenote: To avoid the dependency problem for xlana-j (dropped from FC3 release) we build using --without xalan here, all other dependencies should be fixable in case they occur. If you don't want to use dietlibc either, add a second --without dietlibc to the rpmbuild command.
    • Install the compiled package (rpm -ihv /usr/src/redhat/RPMS/i386/util-vserver-*0.30.204-0.i386.rpm)
  6. Getting Fedora Core 3 Support into Vserver utils
    This version of the veserver utils uses - as mentioned earlier - apt to install the client os. Since as of today the utils don't know about fc3, we have to add it manually:
    • Copy the fc2 folder in /etc/vserver/.distributions to fc3 (cp -R /etc/vserver/.distributions/fc2 /etc/vserver/.distributions/fc3)
    • Change all references to Core 2 to now point to 3 in the apt/sources.list using a text editor of your choice (e.g. /core/2/i386 becomes /core/3/i386)

C. VServer creation

  1. Build a new vserver
    The first step is to build a basic new server. The vserver-utils do have a very nice cli tool to do so with automatic use of latest packages available due to the incorporation of apt.
    To build a new server with the name "servername" and an IP adress of 1.2.3.4 based on FedoreCore 3 do:
    • /usr/lib/util-vserver/vserver-build --force -m apt-rpm -n servername --hostname=servername.mydomain.tld --netdev=eth0 --interface 1.2.3.4 --netmask 255.255.255.0 -- -d fc3
    This will create all required configfiles and build the server in /vservers for you. Once installed and updated, you can ...
    • start it with vserver servername start
    • enter the newly created vserver, use vserver servername enter

Congratulations - You're done ;)