Installing the OpenVZ Kernel
The simplest Linux distribution to setup OpenVZ hosting support for is CentOS, as a kernel and packages are supplied by the OpenVZ developers at http://wiki.openvz.org/Main_Page . The steps to install the kernel are on a CentOS 5 system are :
- Setup the OpenVZ YUM repository with the commands :
cd /etc/yum.repos.d
wget "http://download.openvz.org/openvz.repo"
rpm --import "http://download.openvz.org/RPM-GPG-Key-OpenVZ"
- Install the kernel with the command
yum install ovzkernel
. Or if you want a kernel that can host both Xen and OpenVZ, useyum install ovzkernel-xen
. - Edit /boot/grub/menu.lst and make sure the
default=
line refers to the new OpenVZ-capable kernel section - typically this will need to be set todefault=0
- Edit /etc/sysctl.conf and append the following lines :
# 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
- Edit /etc/sysconfig/selinux and change the
SELINUX=
line toSELINUX=disabled
- Reboot the system, and verify that it boots into the new kernel.
Installing OpenVZ Utilities
Once you have the kernel on the host system, other needed utilities can be installed as follows :
- Install the OpenVZ tools with :
yum install vzctl vzquota
- Start the OpenVZ daemon with :
/etc/init.d/vz start
- Run the command
vzlist -a
to verify that the tools are working and kernel support is usable.
Once this is done, you can add this system as an OpenVZ host in Cloudmin at Host Systems -> OpenVZ Host Systems .