Installing an Open VZ Container

These assume you are setting up a 64bit Centos container from the template centos-5-x86_64 in container 101

vzctl create 101 –ostemplate centos-5-x86_64
vzctl set 101 –ipadd 192.168.0.?? –save
vzctl set 101 –nameserver –nameserver –save
vzctl set 101 –save –hostname ??

Set the memory to 1GB

vzctl set 101 –save –vmguarpages 262144
vzctl set 101 –save –oomguarpages 262144
vzctl set 101 –save –privvmpages 262144:393216

and Disk to 10GB

vzctl set 101 –save –diskspace 10G

Start and enter the container

vzctl start 101
vzctl enter 101

Installing an Open VZ Container

Installing OpenVZ on Centos5

These instructions assume a clean base install of Centos 5.2 – 64Bit

cd /etc/yum.repos.d
rpm –import

Edit the file /etc/sysctl.conf and append the following lines to the end

# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Reboot the server

Install extra tools

yum install vzctl.x86_64 vzquota.x86_64
wget -c
rpm –nodeps -Uvh vzyum*.rpm
yum install vzpkg vzyum vzrpm43-python vzrpm44-python vzctl-lib

Download precreated templates from

and copy to /vz/template/cache

Installing OpenVZ on Centos5