安裝套件庫
cd /etc/yum.repos.d/ wget http://download.openvz.org/openvz.repo
匯入套件庫的憑證
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
安裝 OpenVZ 核心
yum install vzkernel.i686
注意:
如果是 CentOS 5.x 較低版本,可能是 ovzkernel.[ARCH], ARCH 可能是 i386, i686 或 64-bit 的 x86_64。
安裝完成後,需檢查幾個項目:
/boot/grub/grub.conf:
title CentOS (2.6.32-042stab037.1) root (hd0,0) kernel /vmlinuz-2.6.32-042stab037.1 ro root=/dev/VolGroup00/LogVol00 sysfs.deprecated=1 initrd /initrd-2.6.32-042stab037.1.img
/etc/sysctl.conf:
有相同的項目必須作註解。
# for OpenVZ net.ipv4.ip_forward = 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
/etc/selinux/config:
SELINUX=disabled