Difference between revisions of "Installing openVZ on Cent OS"

From Notes_Wiki
m (Saurabh moved page Installing openVZ on Cent OS 5.5 to Installing openVZ on Cent OS: Better name for page)
m
Line 1: Line 1:
=Installing openVZ on CentOS 5.5=
<yambe:breadcrumb>OpenvZ</yambe:breadcrumb>
=Installing openVZ on CentOS=


Installation steps have been learned from http://wiki.openvz.org/Quick_installation
Installation steps have been learned from http://wiki.openvz.org/Quick_installation


Following steps can be used to install openVZ on CentOS 5.5 machine:
Following steps can be used to install openVZ on CentOS machine:
#Download openvz.repo file from http://download.openvz.org/openvz.repo
#Download openvz.repo file from http://download.openvz.org/openvz.repo
#<tt>mv openvz.repo /etc/yum.repos.d</tt>
#<tt>mv openvz.repo /etc/yum.repos.d</tt>

Revision as of 14:40, 9 January 2013

<yambe:breadcrumb>OpenvZ</yambe:breadcrumb>

Installing openVZ on CentOS

Installation steps have been learned from http://wiki.openvz.org/Quick_installation

Following steps can be used to install openVZ on CentOS machine:

  1. Download openvz.repo file from http://download.openvz.org/openvz.repo
  2. mv openvz.repo /etc/yum.repos.d
  3. yum install [o]vzkernel.x86_64 vzctl.x86_64 vzquota.x86_64
  4. Edit file '/etc/sysctl.conf' so that it has
    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
  5. Disable SELinux
  6. Enable forwarding of packets in iptables firewall
  7. Create a folder where you want to store openVZ related stuff. Create symbolic link of choosen folder as /vz.
  8. Download templates from http://download.openvz.org/template/precreated/ to '/vz/template/cache. #:For centos template we need to rename it to -default template using 'mv centos-5-x86_64.tar.gz centos-5-x86-64-default.tar.gz' as for some reason vzctl tries to append `-default' when we create containers using centos template.
  9. Optionally Edit file '/etc/grub.conf' and change title of kernel with word stab in it to openVZ. Remove all parameters passed to this kernel except "ro root=...". The setup works better without doing this as it does not leads to printing of too many messages during boot.
  10. Reboot into openVZ kernel

Note that container filesystems get stored in /vz/private/<container_id>