How to Install OpenVZ 7 on CentOS 7
Last Updated on Tuesday, 20 February 2024 07:54 Written by BiRU Saturday, 17 February 2024 11:52
This is a complete guide to converting a CentOS 7 server to a OpenVZ host server.
The recommended pattern to install OpenVZ is to use the ISO and install it on the bare metal.
However, that isn't always possible, so in this tutorial, we'll explain how to install OpenVZ on CentOS.
You'll need a server with CentOS 7 x86_64 installed.
I'll be using CentOS 7.9.
Update
Ensure you have everything up to date.
yum update && yum upgrade
Get OpenVZ releases
yum -y localinstall https://download.openvz.org/virtuozzo/releases/openvz-7.0.17-347/x86_64/os/Packages/p/python-subprocess32-3.2.7-1.vz7.5.x86_64.rpm
#yum -y localinstall https://download.openvz.org/virtuozzo/releases/openvz-7.0.17-347/x86_64/os/Packages/o/openvz-release-7.0.17-29.vz7.x86_64.rpm
#yum -y localinstall https://download.openvz.org/virtuozzo/releases/openvz-7.0.16-552/x86_64/os/Packages/o/openvz-release-7.0.16-7.vz7.x86_64.rpm
yum -y localinstall https://download.openvz.org/virtuozzo/releases/openvz-7.0.15-628/x86_64/os/Packages/o/openvz-release-7.0.15-4.vz7.x86_64.rpm
yum -y install epel-release
- Note: If you get
Requires: disp-helper-scripts
, use the.15
version.
Install
yum install python3
rpm -Uvh http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/r/readykernel-scan-0.11-1.vl7.noarch.rpm
rpm -Uvh http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/z/zstd-1.4.4-1.vl7.x86_64.rpm
rpm -Uvh http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/v/vzlinux-release-7-1.vl7.91.x86_64.rpm
Cleanup
mv /etc/yum.repos.d/CentOS-* /root/
rpm -e --nodeps --justdb json-c
yum -y erase jansson
yum -y localinstall http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/j/jansson-2.10-1.vl7.1.x86_64.rpm
yum -y localinstall http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/j/json-c-0.11-13.vl7.1.x86_64.rpm
rpm -e --nodeps --justdb nspr nss nss-pem nss-softokn nss-softokn-freebl nss-sysinit nss-tools nss-util
yum -y localinstall http://repo.virtuozzo.com/vzlinux/7.9/x86_64/os/Packages/n/nss-3.67.0-4.vl7.x86_64.rpm
yum -y install nss-softokn-freebl.i686 nss-tools
yum -y install prlctl prl-disp-service vzkernel *ploop*
yum -y update
Check grub
# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : Virtuozzo 7 (3.10.0-1160.42.2.vz7.184.10)
1 : CentOS Linux (3.10.0-1160.53.1.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-6a03f95fe90f43b786afa291f08bbbf6) 7 (Core)
# grub2-editenv list
saved_entry=Virtuozzo 7 (3.10.0-1160.42.2.vz7.184.10)
Reboot
reboot
Initial Settings
modprobe ploop pfmt_ploop1 pfmt_raw pio_direct
Install OpenVZ kernel and other packages.
yum -y install prlctl prl-disp-service vzkernel
Install quota tools
yum -y install vzctl vzquota ploop
Install all available Linux Distro templates
yum -y install *ez.noarch
Reboot
reboot