Difference between revisions of "Installation on CentOS"

From Linux-VServer

Jump to: navigation, search
(Install util-vserver (from source via RPM))
m (Install the kernel)
 
(26 intermediate revisions by 13 users not shown)
Line 1: Line 1:
== Install CentOS 5 ==
+
== Install CentOS ==
  
My CentOS 5 installation is a DVD install with only the "Desktop - GNOME" group selected.
+
My CentOS installation is a DVD install of CentOS 5 with only the "Desktop - GNOME" group selected.
  
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 :)
+
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 it's okay to wait until you have installed the kernel before doing this (just to save some time :)).
  
== Install the vserver kernel ==
+
== Add the repository ==
  
I have found using Daniel's fedora kernel rpm's work great with CentOS 5, so I downloaded the relevent kernel RPMS files
+
In order to install the necessary packages, you will have to add the repository containing them to your yum configuration.
  
  wget -c http://rpm.hozac.com/dhozac/fedora/6/vserver/i386/kernel-2.6.20-1.2936.fc6.vs2.2.0.1.i686.rpm
+
For CentOS 5 paste the following in '''/etc/yum.repos.d/dhozac-vserver.repo'''
 +
  [dhozac-vserver]
 +
name=Linux-VServer related packages for CentOS $releasever - $basearch
 +
baseurl=http://rpm.hozac.com/dhozac/centos/$releasever/vserver/$basearch
 +
gpgkey=http://rpm.hozac.com/conf/keys/RPM-DHOZAC-GPG-KEY
  
Then install the kernel...
+
For CentOS 6 paste the following in '''/etc/yum.repos.d/dhozac-vserver.repo'''
 +
[dhozac-vserver]
 +
name=Linux-VServer related packages for CentOS $releasever - $basearch
 +
baseurl=http://rpm.hozac.com/dhozac/rhel/$releasever/vserver/$basearch
 +
gpgkey=http://rpm.hozac.com/conf/keys/RPM-DHOZAC-GPG-KEY
  
rpm -ivh kernel-2.6.20-1.2936.fc6.vs2.2.0.1.i686.rpm
+
== Update yum ==
  
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.
+
Before you do anything else, update yum. If you don't, you'll have to sit through lots of "you're using a knackered version of yum. Wait 5 seconds" messages.
  
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.
+
yum update yum
  
vi /etc/ssh/sshd_config
+
Which should pick the version from the dhozac repository.
  
and add the line "ListenAddress 192.168.0.1"
+
== Install the kernel ==
  
 +
To install the kernel, run
 +
yum install kernel
  
== Install util-vserver (from source via RPM) ==
+
To install the kernel on CentOS 6, run
 +
yum --disablerepo=* --enablerepo=dhozac-vserver install kernel
  
At this stage I had to add some packages to my installation
+
Double check the grub file to make sure it is the bootable kernel (/boot/grub/grub.conf). If all is okay we are ready to restart the server.
  
sudo yum install rpm-build gcc-c++ e2fsprogs-devel beecrypt-devel doxygen tetex-latex
+
At this stage (before the reboot) I also modify the host's sshd_config file, so it doesn't listen to every interface on the server, which would block any guest's attempt to run sshd.
wget ftp://rpmfind.net/linux/fedora/extras/5/i386/dietlibc-0.30-1.fc5.i386.rpm
+
wget ftp://rpmfind.net/linux/fedora/extras/5/i386/dietlibc-lib-0.30-1.fc5.i386.rpm
+
sudo yum localinstall dietlibc-0.30-1.fc5.i386.rpm dietlibc-lib-0.30-1.fc5.i386.rpm
+
  
Now we are ready to make the util-vserver rpm's
+
vi /etc/ssh/sshd_config
  
wget -c http://ftp.linux-vserver.org/pub/utils/util-vserver/util-vserver-0.30.213.tar.bz2
+
and add the line "<code>ListenAddress <host IP address></code>".
rpmbuild -tb util-vserver-0.30.213.tar.bz2
+
  
And finally, install the new rpms
+
== Install util-vserver ==
  
  sudo yum localinstall /usr/src/redhat/RPMS/i386/util-vserver*
+
To install util-vserver, run
 +
  yum install util-vserver{,-core,-lib,-sysv,-build}
  
 
== Post installation steps ==
 
== Post installation steps ==
  
Make certain /proc entries visable (required every boot, so install the vprocunhide start script on boot)
+
Make certain /proc entries visible.
 
+
sudo /sbin/chkconfig --add vprocunhide
+
sudo /etc/init.d/vprocunhide start
+
  
== Install a guest ==
+
service vprocunhide start
  
As root, try the following to test your installation (this example installs a fedora core 6 guest)
+
Enable the vservers-default initscript, so that guests marked default are started on boot.
  
  sudo vserver testing01 build -m yum --context 4040 --hostname=test01.test.loc \
+
  chkconfig vservers-default on
--interface eth0=eth0:192.168.101.101/255.255.0.0 -- -d fc6
+
  
 +
== All done! ==
 +
Once your host is setup, you can start [[Building Guest Systems|building guest systems]].
  
If all goes well you now have a working setup :)
+
[[Category:Installation]]

Latest revision as of 13:11, 17 October 2012

Contents

[edit] Install CentOS

My CentOS installation is a DVD install of CentOS 5 with only the "Desktop - GNOME" group selected.

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 it's okay to wait until you have installed the kernel before doing this (just to save some time :)).

[edit] Add the repository

In order to install the necessary packages, you will have to add the repository containing them to your yum configuration.

For CentOS 5 paste the following in /etc/yum.repos.d/dhozac-vserver.repo

[dhozac-vserver]
name=Linux-VServer related packages for CentOS $releasever - $basearch
baseurl=http://rpm.hozac.com/dhozac/centos/$releasever/vserver/$basearch
gpgkey=http://rpm.hozac.com/conf/keys/RPM-DHOZAC-GPG-KEY

For CentOS 6 paste the following in /etc/yum.repos.d/dhozac-vserver.repo

[dhozac-vserver]
name=Linux-VServer related packages for CentOS $releasever - $basearch
baseurl=http://rpm.hozac.com/dhozac/rhel/$releasever/vserver/$basearch
gpgkey=http://rpm.hozac.com/conf/keys/RPM-DHOZAC-GPG-KEY

[edit] Update yum

Before you do anything else, update yum. If you don't, you'll have to sit through lots of "you're using a knackered version of yum. Wait 5 seconds" messages.

yum update yum

Which should pick the version from the dhozac repository.

[edit] Install the kernel

To install the kernel, run

yum install kernel

To install the kernel on CentOS 6, run

yum --disablerepo=* --enablerepo=dhozac-vserver install kernel

Double check the grub file to make sure it is the bootable kernel (/boot/grub/grub.conf). If all is okay we are ready to restart the server.

At this stage (before the reboot) I also modify the host's sshd_config file, so it doesn't listen to every interface on the server, which would block any guest's attempt to run sshd.

vi /etc/ssh/sshd_config

and add the line "ListenAddress <host IP address>".

[edit] Install util-vserver

To install util-vserver, run

yum install util-vserver{,-core,-lib,-sysv,-build}

[edit] Post installation steps

Make certain /proc entries visible.

service vprocunhide start

Enable the vservers-default initscript, so that guests marked default are started on boot.

chkconfig vservers-default on

[edit] All done!

Once your host is setup, you can start building guest systems.

Personal tools