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.
Vserver installation "from scratch" (Fedora Core 4)
You're a fan of [Fedora Linux]? You want to play around with Linux-Vserver's or use them in production? But you are new to this and want an easy way to (quickly) start with a running system?
Note: If you didn't want a VServer installation guide to Fedora Core 4, maybe you were searching for a guide like this: [The Perfect Setup - Fedora Core 4]
This guide is aimed to assist you in a plain and basic installation "from scratch" to a running VServer enabled host system with also one installed basic guest system. It is assumed that you have basic knowledge of Linux administration and Fedora 4.
What you need:
- The Fedora Core installation CDs (you can get them for example from the [Fedora Inode mirror in Austria])
- a bit of clue in server administration (to avoid another bot system in the net)
- working internet access (of course) to download remaining stuff
- enough time to work through this guide (and probably enough coffee and pizza ;-) )
What you don't need:
- Money (this guide is based on free available soures; donations to the developers are appreciated though)
- paid support tickets (they won't assist you - better look on the [Mailing List] or on the IRC channel)
Okay, let's start:
1. installing the host system
- boot from the FC4 CD and install a basic system (e.g. custom and "minimal" plus development tools; main services should always run on the guest system)
- IMPORTANT: do not activate SElinux (except you know exactly what you're doing!)
- Hint: It usually makes sense to create a '/vservers' partition to contain the guest systems - if you need more space, you can easily move that partition to a new, larger disc and prevent long downtimes
- enter the system and upgrade it to the latest updates.
2. Installing a vserver enabled kernel
- IMPORTANT: There are two methods of installing a vserver kernel on Fedora Core 4: Source and RPM. Use one or the other, do not do both.
A. Installing the kernel from source
cd /usr/src
wget ftp://ftp.probe-networks.lkams.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.4.tar.bz2
tar xjf linux-2.6.12.4.tar.bz2
cd /usr/src
wget http://www.13thfloor.at/vserver/s_rel26/v2.0/patch-2.6.12.4-vs2.0.diff.bz2
bzip2 -d patch-2.6.12.4-vs2.0.diff.bz2
cd linux-2.6.12.4
patch -p1 < ../patch-2.6.12.4-vs2.0.diff
- copy the latest config from your /boot directory to the kernel source tree and configure your VServer options:
- example (still do this even if you don't want to change anything to apply the VServer options into the configuration):
cd /usr/src/linux-2.6.12.4
cp /boot/config-2.6.13-1.1526_FC4 .config
make menuconfig
- select the Linux VServer option in the kernel config and modify to taste
- If you are using an x86_64 system do not forget to enable the IA32 emulation if you want to use 32bit guests on your system!
- exit and save configuration
- build your new kernel and install it
- example (IMPORTANT: you have to use your relating boot /dev entry!):
- make bzImage && make modules && make modules_install && make install && grub-install /dev/XXX
- (you may want to take a cup of coffee and/or a pizza while this is running, depending on your hardware)
- important note: You may want to activate your VServer kernel in /boot/grub/grub.conf as your default kernel before doing the grub-install command so that it's loaded on reboot by default. To do this, just change the default=N to point to your VServer entry (starting with first entry beeing default=0; just count down then)
- reboot your system and continue with step 3.
B. Installing the host system from rpm
- Daniel Hokka Zakrisson has provided rpms for both the vserver-kernel and util-vserver software. To activate his repository of software add the following file to your /etc/yum.repos.d/ directory:
name=Daniel Hokka Zakrisson's packages for Fedora $releasever - $basearch - vserver
baseurl=http://rpm.hozac.com/fedora/dhozac/$releasever/$basearch/vserver
gpgkey=http://rpm.hozac.com/fedora/conf/keys/RPM-DHOZAC-GPG-KEY
enabled=1
- reboot your system and continue with step 3.
3. Installing the vserver utilities on the host system
- IMPORTANT: Like the vserver kernel, util-vsever can be installed by source or by RPM. Use both will result in problems.
A. Installing the vserver utilities from source
- download the latest util-vserver alpha release and (if applicable) also the latest patch from the latest [stable release] and apply the patch (if applicable)
cd /usr/src
wget http://www.13thfloor.at/vserver/s_rel26/v2.0/util-vserver-0.30.209.tar.bz2
tar xjf util-vserver-0.30.209.tar.bz2
cd util-vserver-0.30.209
- build and install the util-vserver tools to root (fits best into FC4 directory structure philosophy I think)
- IMPORTANT: At this point, make sure you have installed dietlibc and beecrypt/-devel by using:
yum install -y dietlibc beecrypt-devel
-
- cd /usr/src/util-vserver-0.30.209
-
- make && make install && make install-distribution
- test the installed system
- Note: we used the [testme.sh] script from Herbert to test the system
- example:
- replace the FC4 yum with a patched version
- as shown in the util-vserver source the actual yum (at least V2.4.0 and earlier) do not honor the chroot sysem properly. Pre-2.4.0 could work through a work-around within the vyum utility, actual 2.4.0 yum doesn't work with V 0.30.208 of util-vserver at all. So I have applied the (util-vserver sourced, recommended) patch to the actual 2.4.0 rpm package and uploaded this for public as [Binary] and [Source] rpm's. Recently this is the 2.4.0-0.fc4 sourced rpm, so it should work with any FC4 system.
- Installation example:
- start /etc/init.d/vprocunhide and add it to boot scripts
- read Proc-Security for this issue
- /etc/init.d/vprocunhide start
- chkconfig --add vprocunhide
- chkconfig vprocunhide on
- just to be on the save side: Set the "barrier" attribute to the "vservers" base directory:
- further information can be found on the alpha util-vserver page at "2.4 to 2.6 transition"
- setattr --barrier /vservers # your basedir to come here; default is as shown
- copy the PGP keys to the distribution directory of the utils (otherwise it will not be found on guest build time)
- cp -r /etc/pki/rpm-gpg/ /lib/util-vserver/distributions/fc4/pubkeys/
Now the FC4-vs2.0 host is ready to
3. build the first guest system
- prepare your vserver build command "on paper" by reading and understanding vserver XXX build --help
- set up your vserver using your prepared command, the following example builds one for testing purposes only
vserver test build -m yum --hostname=test.example --interface test0=eth0:192.168.0.1/24 -- -d fc4
- install the yum package (and maybe also some others, see section 4) into your guest host so you can easily work on with further installations from inside the guest
- important note: Internal package management must be activated with vserver <vservername> pkgmgmt internalize before you can use it from within a guest!
- vyum <vservername> -- install -y yum
- example: vyum test -- install yum
- for further packages to be installed from the host system use vyum <vservername> -- install <package> [<package> [<package> ...]]
- further packages could also be installed from within the guest using the yum install <package> [<package> [<package> ...]] command (if you have internalized the managment)
- Caution (with openssh and pam) on FC4 guests: Due to the "audit" package pam authentication (also used with openssh) installs the options for using "pam_loginuid.so" into the /etc/pam.d/* files. Comment those out as this module will not load within a guest. This probably is also necessary on updates later on, if the configs get changed. This module will not be needed within a guest anyhow (wroter Herbert on the mailing list) ....
- example commented line in /etc/pam.d/sshd:
- # session required pam_loginuid.so
- fill in a nameserver into /etc/resolv.conf so that the guest can use one
- example: nameservers nnn.xxx.yyy.zzz
- check IP-binding of your activated services, and read section 4
4. Things you might want to consider / remember
- remember to set a password for root and/or necessary user/s (vserver XXX enter on the host may help to do that ;-) )
- use pwconv and pwck to create a shadow file within the guest
- ensure that each instance of sshd, httpd, etc. binds only to its relating ip(s) to avoid annoying debugging sessions ....
- probably helpful and/or necessary rpm packages to install into each guest:
- yum (if you want internal package management; must be initalized!)
- openssh-server (if you want to have remote shell access)
- rootfiles (alwys good if you want to use "root" usage)
- vim-minimal (or any other editor you might like to edit any text file, e.g. joe)
- passwd (otherwise you might not be able to change your passwords)
- system-config-date (if you want o easily set a timezone for the guest)
- which (always helpful)
- vixie-cron and crontabs (to have a working crond/crontabs)
- sendmail or postfix or any wanted mailserver (to have a mailsystem as well)
- xinetd (if you want services to be started by this)
- remember: /etc/pam.d/* might contain "pam_loginuid.so" - you must comment this out for each package using this on a guest (e.g. crond, login, remote, sshd)!
- if you want your guest/s to start/stop on booting/shutdown, fill a tag into /etc/vservers/<vserver-name>/apps/init/mark and activate this in an /etc/init.d/vservers-<tag> script
- example (to be issued on the host certainly):
- echo default >/etc/vservers/test/apps/init/mark
- chkconfig add vservers-default # existing from util-vservers
- chkconfig vservers-default on
- read comments in /etc/init.d/vservers-default to understand this procedure
After this steps you should have a running host system with a guest system into it. The guest system can be "booted" (started) by using the vserver <vservername> start command, shutdown (stop) is done by vserver <vservername> stop command (both issued on the host system).
If you want some special procedure described on this page (which should be of public interest), either add yourself (you're welcome) or [mail to the autor]. Pls do NOT mail the autor for any support purposes, use the mailing list or IRC channel instead!
For further issues like more configuration etc. please read through the further documentation on this site.