OpenVZ Installation

Follow the below steps to install OpenVZ in your server.

1. Add the openvz repo.

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
yum -y install ovzkernel

2. Adjust the sysctl.conf

vi /etc/sysctl.conf 
# Controls IP packet forwarding
net.ipv4.ip_forward = 1 
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1 
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
sysctl -p
shutdown -r now
uname -r

3. Install openvz tools.

yum install vzctl vzquota vzpkg

4. Start

/etc/init.d/vz start

5. Download pre-created templates from http://download.openvz.org/template/precreated/ to your server.

cd /vz/template/cache/
wget http://download.openvz.org/template/precreated/centos-6-x86.tar.gz

6. Create a VPS

vzctl create 101 --ostemplate centos-5-x86 --config vps.basic

7. Set hostname

vzctl set 101 --hostname veeble --save

Now you have a installed openvz and created a virtual server with it!!!