OpenVZ Installation and configuration

Follow the below steps to install OpenVZ on your server.

1. Add the OpenVZ repo.

cd /etc/yum.repos.d
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 to your server.

cd /vz/template/cache/

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 installed OpenVZ and created a virtual server with it!!!

About The Author

Scroll to Top