Difference between revisions of "Installing openVZ on Cent OS"

From Notes_Wiki
m
m
Line 12: Line 12:
#Enable packet forwardng in /etc/sysctl.conf  (net.ipv4.ip_forward=1)
#Enable packet forwardng in /etc/sysctl.conf  (net.ipv4.ip_forward=1)
#Create a folder where you want to store openVZ related stuff. Create symbolic link of choosen folder as /vz.
#Create a folder where you want to store openVZ related stuff. Create symbolic link of choosen folder as /vz.
#Download templates from http://download.openvz.org/template/precreated/ to '<tt>/vz/template/cache</tt>. #:For centos template we need to rename it to -default template using '<tt>mv centos-5-x86_64.tar.gz centos-5-x86-64-default.tar.gz</tt>' as for some reason vzctl tries to append `-default' when we create containers using centos template.
#Download templates from http://download.openvz.org/template/precreated/ to '<tt>/vz/template/cache</tt>.  
#'''Optionally''' Edit file '<tt>/etc/grub.conf</tt>' 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.
#'''Optionally''' Edit file '<tt>/etc/grub.conf</tt>' 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.
#Reboot into openVZ kernel
#Reboot into openVZ kernel


Note that container filesystems get stored in /vz/private/&lt;container_id&gt;
Note that container filesystems get stored in /vz/private/&lt;container_id&gt;

Revision as of 06:42, 12 March 2014

<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 vzkernel.x86_64 ovzkernel.x86_64 vzctl.x86_64 vzquota.x86_64
  4. Disable SELinux
  5. Enable forwarding of packets in iptables firewall
  6. Enable packet forwardng in /etc/sysctl.conf (net.ipv4.ip_forward=1)
  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.
  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>