How to install OpenVZ Kernel in Linux Server
In order to install OpenVZ, we need to add the OpenVZ repository to yum:cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm –import http://download.openvz.org/RPM-GPG-Key-OpenVZNow open openvz.repo.
vi openvz.repo
and disable the [openvz-kernel-rhel6] repository (enabled=0) and enable the [openvz-kernel-rhel5] repository instead (enabled=1):
Open grub.conf and check Openvz kernel is set to default or not. You can check the default value as per Openvz kernel. But by default it will automatically take Openvz at the top of the grub.conf means at the 0th position.yum search ovzkernel
yum list ovzkernel*
yum install ovzkernel*
vi /etc/grub.conf default=0save the file and quit. Now go to grub prompt by using the below command:
[root@server~]# grubNow fire the below command on grub prompt to reboot the server using the openvz kernel once.
Probing devices to guess BIOS drives. This may take a long time.
GNU GRUB version 0.97 (640K lower / 3072K upper memory)[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub>
savedefault – -default=0 – -onceNow, reboot the server.
shutdown -rf nowI want to use CentOS 5 in my virtual machines, so I download a CentOS 5 template:
cd /vz/template/cache
wget http://download.openvz.org/template/precreated/centos-5-x86.tar.gz
IP forwarding is not enabled [WARNING] If you are getting above warning message then follow the below steps:/etc/init.d/vz restart
vi /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 0 —-> make it 1
save and quit the file
Please use the below commands to install vzctl and vzquota commands on the server
yum install vzctl vzquota