Install openvz

Posted in: Virtual Private Servers (VPS) |

This is a rather short and simple mostly copy/paste guide on how to install openvz from http://www.openvz.org . I have been working with this product for only a short time but I have found it to be very nice. Since it is based off the same technology that Virtuozzo uses it should be just as stable. The only real downside is that it does not have a fancy gui, I for one can deal with that for a testing enviroment! It also works fine for a production enviroment if you want to host VPS from it. Future guides will cover the actual configuration, this is simply installing it and NOT setting up any VPS. The openvz has a lot of documentation on their website which can also be useful. I am only installing the centos 4 minimal and regular because that is all I would believe most people would want, the website has some more. Hint Hint! Don’t use fedora core!! Also they only have the templates for yum for Centos 4 so using the centos 3 image is hard. They also have images for fedora core with the yum templates if you want to get them. In time I may try to release an image wih cPanel already installed.


pico -w /etc/sysctl.conf
Add the following:

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Of course we will want to enable all the iptables modules so we can get things like apf working so do the following:
pico -w /etc/sysconfig/iptables-config
and where you see IPTABLES MODULES=”" change it to
IPTABLES_MODULES=”ip tables ipt REJECT ipt tos ipt limit ipt multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length”

Now continue installing openvz

mkdir /usr/local/src/vz
mkdir /usr/local/src/vz/kernel
cd /usr/local/src/vz/kernel
wget http://download.openvz.org/kernel/022stab061.1/ovzkernel-smp-2.6.8-022st…
rpm –ivh ovzkernel-smp-2.6.8-022stab061.1.i686.rpm
lilo –v –v
lilo –R 2.6.8-022stab061

If you have grub edit the /etc/grub.conf and set the default=0 instead of running the lilo commands.

cd ..

wget http://download.openvz.org/utils/vzctl/2.7.0-25/vzctl-2.7.0-25.i386.rpm
wget http://download.openvz.org/utils/vzctl/2.7.0-25/vzctl-lib-2.7.0-25.i386….
wget http://download.openvz.org/utils/vzctl/2.7.0-25/vzctl-2.7.0-25.i386.tar….
wget http://download.openvz.org/utils/vzctl/2.7.0-25/vzctl-lib-2.7.0-25.i386….
wget http://download.openvz.org/utils/vzquota/2.7.0-7/vzquota-2.7.0-7.i386.rp…
wget http://download.openvz.org/template/utils/vzrpm44/4.4.1-22.5/vzrpm44-4.4…
wget http://download.openvz.org/template/utils/vzrpm44/4.4.1-22.5/vzrpm44-pyt…
wget http://download.openvz.org/template/utils/vzpkg/2.7.0-18/vzpkg-2.7.0-18….
wget http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11….
wget http://download.openvz.org/template/metadata/centos-4/vztmpl-centos-4-2….
wget http://download.openvz.org/template/utils/vzrpm43/4.3.3-7_nonptl.6/vzrpm…
wget http://download.openvz.org/template/utils/vzrpm43/4.3.3-7_nonptl.6/vzrpm…

wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/python-sqlite-1.1.6-1…
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/python-elementtree-1….
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/python-urlgrabber-2.9…
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/centos-yumconf-4-4.5….
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/yum-2.4.2-2.centos4.n…
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/sqlite-3.2.2-1.i386.r…

rpm -Uvh *rpm

I had no trouble installing them all at once but apparently some people were not able to. If you have trouble with that rpm command try using this one as suggested by “funkytaco” below.
rpm -Uhv vzquota*.rpm
rpm -Uhv vzctl*.rpm
rpm -Uhv vzyum*.rpm
rpm -Uhv vzpkg*.rpm
rpm -Uvh vzrpm43*.rpm
rpm -Uvh vztmpl*.rpm

cd /vz/template/cache/
wget http://download.openvz.org/template/precreated/centos-4-i386-minimal.tar…
wget http://download.openvz.org/template/precreated/centos-4-i386-default.tar…

Thats it!

Leave a Reply