http://www.linux-vserver.org/api.php?action=feedcontributions&user=80.200.247.51&feedformat=atomLinux-VServer - User contributions [en]2024-03-28T11:38:34ZUser contributionsMediaWiki 1.20.2http://www.linux-vserver.org/Installation_on_CentOSInstallation on CentOS2007-08-24T08:50:20Z<p>80.200.247.51: /* Install a guest */ Corrected small error in example description</p>
<hr />
<div>== Install CentOS 5 ==<br />
<br />
My CentOS 5 installation is a DVD install with only the "Desktop - GNOME" group selected.<br />
<br />
On restart, a number of questions (timezone/security level/etc) are asked. At this stage set the "SELinux" option to disabled. If you skip this step, then simply modify the /etc/sysconfig/selinux file and disable selinux from there. You will need to reboot before this takes effect, but its okay to wait until you have installed the kernel before doing this (just to save some time :)<br />
<br />
== Install the vserver kernel ==<br />
<br />
I have found using Daniel's fedora kernel rpm's work great with CentOS 5, so I downloaded the relevent kernel RPMS files<br />
<br />
wget -c http://rpm.hozac.com/dhozac/fedora/6/vserver/i386/kernel-2.6.20-1.2936.fc6.vs2.2.0.1.i686.rpm<br />
<br />
Then install the kernel...<br />
<br />
rpm -ivh kernel-2.6.20-1.2936.fc6.vs2.2.0.1.i686.rpm<br />
<br />
Double check the grub file to make sure its the bootable kernel (/boot/grub/grub.conf). If all is okay we are ready to restart the server.<br />
<br />
At this stage (before the reboot) I also modify the hosts sshd config file, so it doesn't listen to every interface on the server. This blocks any guests attempt to run sshd.<br />
<br />
vi /etc/ssh/sshd_config<br />
<br />
and add the line "ListenAddress 192.168.0.1"<br />
<br />
<br />
== Install util-vserver (from source via RPM) ==<br />
<br />
At this stage I had to add some packages to my installation<br />
<br />
sudo yum install rpm-build gcc-c++ e2fsprogs-devel beecrypt-devel doxygen tetex-latex<br />
wget ftp://rpmfind.net/linux/fedora/extras/5/i386/dietlibc-0.30-1.fc5.i386.rpm<br />
wget ftp://rpmfind.net/linux/fedora/extras/5/i386/dietlibc-lib-0.30-1.fc5.i386.rpm<br />
sudo yum localinstall dietlibc-0.30-1.fc5.i386.rpm dietlibc-lib-0.30-1.fc5.i386.rpm<br />
<br />
Now we are ready to make the util-vserver rpm's<br />
<br />
wget -c http://ftp.linux-vserver.org/pub/utils/util-vserver/util-vserver-0.30.213.tar.bz2<br />
rpmbuild -tb util-vserver-0.30.213.tar.bz2<br />
<br />
And finally, install the new rpms<br />
<br />
sudo yum localinstall /usr/src/redhat/RPMS/i386/util-vserver*<br />
<br />
== Post installation steps ==<br />
<br />
Make certain /proc entries visable (required every boot, so install the vprocunhide start script on boot)<br />
<br />
sudo /sbin/chkconfig --add vprocunhide<br />
sudo /etc/init.d/vprocunhide start<br />
<br />
== Install a guest ==<br />
<br />
As root, try the following to test your installation (this example installs a CentOS 5 guest)<br />
<br />
sudo vserver testing01 build -m yum --context 4040 --hostname=test01.test.loc \<br />
--interface eth0=eth0:192.168.101.101/255.255.0.0 -- -d centos5<br />
<br />
yum will install the minimal packages now. After the yum process completes i got this error: <br />
<br />
/usr/lib/util-vserver/distributions/fc6/initpost: line 105: 3587 Killed<br />
$_VSERVER "$vserver" exec bash -c ': >/tmp/startwait' >&/dev/null<br />
<br />
Some part of the script is broken it seems, but it won't affect the install. At this point you must be able to start and enter your vserver install. To start it the vserver do,<br />
<br />
sudo vserver testing01 start<br />
<br />
And to enter the vserver, do <br />
<br />
sudo vserver testing01 enter<br />
<br />
Now you must be inside the centos5 install, you can start installing the packages you need now. <br />
In case yum is not installed, you can do it via the following in the host system<br />
<br />
sudo vyum testing01 -- install yum<br />
<br />
To get out of the vserver to the host you should use <br />
<br />
Ctrl+d<br />
<br />
If all goes well you now have a working setup :)</div>80.200.247.51