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 use 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
- Once the repository is added issue the following command to install the vserver kernel.
- For Single processor systems
yum install kernel-2.6.13-1.1532_FC4.vs2.0.1.0.pre2.1
-
yum install kernel-smp-2.6.13-1.1532_FC4.vs2.0.1.0.pre2.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. The use of 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
- IMPORTANT: At this point, make sure you have installed dietlibc and beecrypt/-devel by using:
yum install -y dietlibc beecrypt-devel
- build and install the util-vserver tools to root (fits best into FC4 directory structure philosophy I think)
cd /usr/src/util-vserver-0.30.209
./configure --prefix=
make && make install && make install-distribution
B. Installing the vserver utilities system from rpm
- Issue the following command to install the vserver utils.
yum install util-vserver util-vserver-devel util-vserver-lib util-vserver-sysv util-vserver-build util-vserver-core
4. Final host configuration
- You now have the Vserver kernel and utils installed, you are almost ready to create your first Vserver, but first we must prepare the host.
- test the installed kernel to see if it is operational
- Note: we used the [testme.sh] script from Herbert to test the system
- example:
cd /usr/src
wget http://vserver.13thfloor.at/Stuff/SCRIPT/testme.sh
chmod 700 testme.sh;./testme.sh
- replace the FC4 yum with a patched version
- FC4's yum does not work with chroot system correctly, so we must replace it. I have applied the patch to the actual 2.4.0 rpm package and uploaded this for public as [Binary] and [Source] RPM's.
- Installation example:
rpm -U http://muh.at/rpm/yum-2.4.0-0.chroot.fc4.noarch.rpm
- Start /etc/init.d/vprocunhide and add it to boot scripts:
/etc/init.d/vprocunhide start
chkconfig --add vprocunhide
chkconfig vprocunhide on
- Set the "barrier" attribute to the "/vservers" directory:
- Further information can be found on the alpha util-vserver page at "2.4 to 2.6 transition"
setattr --barrier /vservers
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/ /usr/lib/util-vserver/distributions/fc4/pubkeys/
Now your FC4-vs2.0 host is ready to go.
5. Build your first guest system
- IMPORTANT: It is wise to prepare your vserver build command "on paper" before rushing ahead as a rebuild will take several minutes. For a list and description of all vserver build options read the output of vserver XXX build --help
- Set up your vserver using your prepared command. It should look similar to the following.
vserver test build -m yum --hostname=test.example --interface test0=eth0:192.168.0.1/24 -- -d fc4
- install the yum package into your guest host and activate Internal package management
vyum test -- install yum
vserver test pkgmgmt internalize
- IMPORTANT: Internal package management must be activated with vserver <vservername> pkgmgmt internalize before you can use the 'yum' command from within a guest.
- You can now "boot" into the system.
vserver test start
vserver test enter
6. Configure your first guest system
- You are now booted into your brand new Vserver. A few things need to be set up before you can get going however
- Create a shadow file within the guest and check it for errors
pwconv
pwck
- Add a valid nameserver into /etc/resolv.conf so that the guest can use one
nameservers 192.168.0.1
- To install further packages to the guest from the host use vyum <vservername> -- install <package>
- Caution: On FC4 Guests, due to the "audit" package, pam authentication (also used with openssh) enales "pam_loginuid.so" in the /etc/pam.d/* files. Comment those out as they are unessesary and will not load within a guest. This probably is also necessary on updates later on, if the configs get changed.
- example of commented line in /etc/pam.d/sshd:
# session required pam_loginuid.so
7. Things you might want to consider / remember
- Probably helpful and/or necessary rpm packages to install into each guest:
- openssh-server (if you want to have remote shell access)
- rootfiles (always 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, nano)
- passwd (otherwise you will 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 (to have a mailsystem as well, you may also use postfix)
- xinetd (if you want rpc services)
- After you've installed and configured your services within the guest OS it's always a good idea to ensure that each server instance binds only to its relating ip(s) to avoid annoying IP conflict.
- If you want your new guest to start on host bootup, add a one-line tag to /etc/vservers/<vserver-name>/apps/init/mark. All marked vservers will be activated with a corrisponding a /etc/init.d/vservers-<tag> script (usually just a copied and renamed /etc/init.d/vservers-default)
echo default >/etc/vservers/test/apps/init/mark
chkconfig add vservers-default
chkconfig vservers-default on
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]. Please do NOT mail the author for any support purposes, use the mailing list or IRC channel instead!
For further issues like more fine-grained configuration etc. Please read through the further documentation on this site.