Installation on Fedora

From Linux-VServer

Revision as of 21:11, 21 October 2011 by Glenn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Author:  C Campbell
OS:      Fedora Core 6
Project: Vserver Installation
This wiki entry was tested on Fedora Core 6, but should work for any Fedora.

Hardware is a pizza box 1U server single proc:
Intel(R) Pentium(R) 4 CPU 2.40GHz stepping 04
1 GB Memory
Intel i845 Chipset

It is possible to install everything needed using yum.

First consider that Vserver requires a customer kernel provided by

Daniel Hokka Zakrisson's packages for Fedora

Of course, YOU can build your own Vserver kernel from source.
Cannot recommend this guide for production level.
Much of this information was ripped from this wiki entry:

The base FC 6 is a minimal custom install from CD 1 - 2.

All additional packages and updates were installed using yum.

Disk considerations

When creating the base system, if possible, partition only needed space and leave free space
available for things like apache content, or vservers.  Its recommended that vservers have a
partition of there own, but if possible create a partition for EACH vserver.

Disable SELinux

As instructed by the FC 5 Vserver wiki, the following steps were taken to disable SELinux.
 Would love to know more about SELinux and leave it enabled on the base system.  

 sudo vi /etc/selinux/config

 sudo yum -y upgrade

At this point I rebooted to make sure SELinux disabled, but you can wait until later.

Install util-vserver

 sudo yum install util-vserver

Install the custom kernel

Create a new yum repository file.

 sudo vi /etc/yum.repos.d/dhorac-vserver.repo

Paste this:

name=Daniel Hokka Zakrisson's packages for Fedora $releasever - $basearch - vserver

Modify your existing Fedora updates yum repository file

 sudo vi /etc/yum.repos.d/fedora-updates.repo

Add this line to each repository block

exclude=kernel kernel-smp yum

Remove your existing kernel

To find your existing kernel

 uname -a

This will be different depending on your kernel

 sudo yum remove kernel-2.6.18-1.2868.fc6

 sudo yum install kernel

If you have a multi- core or processor machine use kernel-smp 

Watch Yum and make sure you see the kernel downloaded from Dhozac, not fedora updates


 /sbin/init 6

When your machine reboots check to make sure the kernel loaded

 uname -a

You should see something like this


The important bit is "fc6.vs2"

At this point I tried to create a vserver but found out that I needed 


FYI: you will need util-vserver{-core,-lib,-i386,-sysv,-build}

 sudo yum install util-vserver-build

Install chroot Yum

 sudo yum update yum

Now you should have a chroot version of yum (yum.noarch 3.0.1-2.fc6.chroot)
To make sure
 sudo tail /var/log/yum.log

At this point we're ready to build a vserver.

Build a vserver

For this vserver I created a 10GB partition called /vserver1.

My base server is on 192.168.1/24 so I'll stay on that subnet.

I'll call my vserver bianca.

Context has something to do with unique UIDs in the kernel.

For more on all the build options 

 vserver build build --help
Here is a bash script you can use to create a vserver. 
echo "$SUDO /usr/sbin/vserver $VSERVER build /
-m $PM --context $CONTEXT /
--hostname=$HOSTNAME --interface $INTERFACE=$IP /
--rootdir $ROOTDIR --pkgbase $PKGBASE -- -d $DIST -- rsyslog"
At this point you'll wait for yum to get started, then you'll see expected yum download output.

Yum will download kernel hook packages and then it will download a minimal set of user packages.

The yum process finishes as expected, but I got this warning/error:

/usr/lib/util-vserver/distributions/fc6/initpost: line 105:  3587 Killed
$_VSERVER "$vserver" exec bash -c ': >/tmp/startwait' >&/dev/null

Not sure which part of this script is broken, but it did not impact the install, so move on.

Technically at this point you should be able to start the vserver.

 sudo vserver bianca start

 sudo vserver bianca status

This will take you "inside" the Vserver to a shell.

 sudo vserver bianca enter 
Now, if you entered the vserver, get out of the vserver and stop it.
 Ctrl + D
 sudo vserver bianca stop
 sudo vserver bianca status

Install minimal packages 
The FC 5 wiki entry talks about unmanaged guest package management
Here the guest is able to run its own yum.
# to enable unmanaged guest
vyum gast -- install yum
vserver gast running && vserver gast stop
vserver gast pkgmgmt internalize
I decided to use "managed guest" package management.
Here the base server will update the guest (vserver)
The vserver must be stopped for these vyum steps.

 sudo vyum bianca -- install openssh-server

 sudo vyum bianca -- install vim-minimal

 sudo vyum bianca -- install passwd

After each of these commands you'll see normal yum install output.
Now enter your vserver.
sudo vserver bianca start
sudo vserver bianca enter
Make sure you see a different bash prompt now, which means your in the vserver.
Now setup your shadow passwd file and set root passwd.

passwd root
Set the nameserver by modifying resolv.conf
echo "nameserver" >> /etc/resolv.conf
Set the timezone file.
cp -f /usr/share/zoneinfo/<your timezone> /etc/localtime

Things to keep in mind.

Most of the problems I encountered were network related.

1.  Modify your firewall.  

Fedora has a firewall in place by default and it will block your Vserver.

	Check your firewall.

	 sudo /sbin/iptables -L 

2.  SSHD will not work until you either change the Listen from all interfaces
on your base machine, or change the port for your Vserver SSHD.
Otherwise they collide.
Personal tools