Virtualization

Install OpenVZ OS level virtualization on CentOS

OpenVZ OS level virtualization OpenVZ is an interesting OS-level server virtualization solution, also known as container virtualization. OpenVZ is popular for Virtual Private Servers (VPSs). Each Virtual Private Server is called a container and acts like a standalone server, with its own reboot capability, root access, users, IP addresses, memory, processes, files, applications, system libraries and configuration files. OS-level virtualization has low overhead, giving it better performance than solutions such as VMWare. It also supports live migration. Its disadvantage is that it supports only Linux operating systems. Installing OpenVZ on CentOS

  1. Download the OpenVZ repository and import its RPM key with the following commands.

    
    [root@Ezylinux ~]# wget -O /etc/yum.repos.d/openvz.repo http://download.openvz.org/openvz.repo
    [root@Ezylinux ~]# rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ
  2. Install OpenVZ kernel

    [root@Ezylinux ~]# yum install vzkernel
  3. Edit the settings in sysctl.conf.

    [root@Ezylinux ~]# vi /etc/sysctl.conf
    
    net.ipv4.ip_forward = 1
    net.ipv6.conf.default.forwarding = 1
    net.ipv6.conf.all.forwarding = 1
    net.ipv4.conf.default.proxy_arp = 0
    net.ipv4.conf.all.rp_filter = 1
    kernel.sysrq = 1
    net.ipv4.conf.default.send_redirects = 1
    net.ipv4.conf.all.send_redirects = 0
  4. Remember to disable SELinux.

    [root@Ezylinux ~]# vi /etc/sysconfig/selinux

    SELINUX=disabled

  5. For a 2.6.8-based or earlier kernel with the firewall enabled, also add the following option to /etc/modprobe.conf.

    options ip_conntrack ip_conntrack_enable_ve0=1
  6. Install vzctl and vzquota with this command (in case the yum install command above did not install them).

    [root@Ezylinux ~]# yum install vzctl vzquota
  7. Finally, enable the vz service and reboot to load vzkernel in place of the current kernel.

    [root@Ezylinux ~]# chkconfig vz on
    [root@Ezylinux ~]# reboot

That is all for now. The next article will explain how to create a VM in OpenVZ.

EOF.← Back to articles