Change Cent OS to OpenVZ (just for clarity reasons, so the OpenVZ kernels will not be mixed up with non OpenVZ ones). Remove extra arguments from the kernel line, leaving only the root=... parameter. The modifed portion of /etc/grub.conf should look like this:

Step #9 - Configuring sysctl

There is a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in /etc/sysctl.conf file. Here is the relevant part of the file; please edit it accordingly.

Step #10 - Configuring SELinux

SELinux should be disabled. To that effect, put the following line to /etc/sysconfig/selinux:

SELINUX=disabled

Step #11 - Conntracks

In the stable OpenVZ kernels (those that are 2.6.8-based) netfilter connection tracking for VE0 is disabled by default. If you have a stateful firewall enabled on the host node (it is there by default) you should either disable it, or enable connection tracking for VE0.

To enable conntracks for VE0, add the following line to /etc/modprobe.conf file:

options ip_conntrack ip_conntrack_enable_ve0=1

Note: in kernels later than 2.6.8, connection tracking is enabled by default

Step #12 - Rebooting into OpenVZ kernel

Now reboot the machine and choose "OpenVZ" on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.

Step #14 - Starting OpenVZ

# /sbin/service vz start

Note: OpenVZ is now set up on your machine. To load OpenVZ kernel by default, edit the default line in the /boot/grub/grub.conf file to point to the OpenVZ kernel. For example, if the OpenVZ kernel is the first kernel mentioned in the file, put it as default 0. See man grub.conf for more details.

1 Comment(s)

Comments

When you download the kernel, make sure you have the right one. If you have a SMP (or hyperthreading) CPU make sure you download the SMP version of the kernel (ovzkernel-smp) and if you have 4gb of ram or more make sure you get (ovzkernel-entnosplit)

Utilities

With the newest version of OpenVZ, you should get the utilites aready included on the kernel install. So you may not need to install the utils.

Add DNS

It is best to add a DNS server after you add the ip address to the server:

vzctl set 112 --ipadd 192.168.6.112 --save

Centos Template Cache

Sometimes it is best to download a precompiled version of the Centos-4 template. Creating your own template can cause problems at times.