Install openvz

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!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Great installguide - sysctl.conf issue though?

Hi,

Great installguide; i tried it and it appears to be working just fine.

Tip for others; to be able to use yum in your VPS you need to run this;

# vzyum 101 install yum (if 101 is the ID of your VPS)

openvz

Thanks for the comment, I am actually in the process of making a guide for configuring the openvz for stuff like yum and basic services. In time I will also make another explaining the different plans and what all the values mean in the configs. I just need to work on it all ;)

cPanel templates

Are there cPanel templates available for CentOS 4.2 ? How would you install them?

CentOS 4.2

No cPanel yet, however all you need to do is:

vzyum 101 install yum
vzyum 101 install perl

then ssh into the server and simply run the installer.

I am looking at possibly building a template for cPanel, maybe even with hardening but I think that may be a little too much ;) Building a plain cpanel should not be bad though.

FYI for Grub users

Question, after rebooting to the ovz kernel and following this readme, why aren't utils like vzctl installed? I hit vz[TAB] and locate vz and do not see them installed? I guess I'll try installing the RPMS as mentioned in the official tutorial next.

FYI for Grub users:
It should be obvious unless you never used lilo, but instead of:
lilo –v –v
lilo –R 2.6.8-022stab061

edit /etc/grub.conf and set the openvz kernel as the default kernel. Mine was the first kernel listed, so I set the default= line to:

default=0

(GRUB enumerates the listed kernels by starting at 0)

Unrelated FYI to eth00:
You have this URL listed twice:
wget http://centos.cs.ucr.edu/centos/4/apt/i386/RPMS.os/python-urlgrabber-2.9...

grub fixes

Thanks I usually work on lilo based systems and forget about that other bootloader at times ;-)

I went ahead and updated it for grub as well as removed that url listed twice.

CentOS 4.2

It looks like this is the order I had to install the vz* RPM's for them to resolve their dependencies with each other:

rpm -Uhv vzquota*.rpm
rpm -Uhv vzctl*.rpm
rpm -Uhv vzyum*.rpm
rpm -Uhv vzpkg*.rpm
rpm -Uvh vzrpm43*.rpm
rpm -Uvh vztmpl*.rpm

[root@river cache]# vz
vzcalc vzdqcheck vzmemcheck vzpkgcache vzrpm
vzcfgvalidate vzdqdump vzosname vzpkgls vzsplit
vzcpucheck vzdqload vzpid vzpkgrm vzyum
vzctl vzlist vzpkgadd vzquota
[root@river vz]# service vz start
Starting OpenVZ: [ OK ]
Bringing up interface venet0: [ OK ]
Configuring interface venet0: [ OK ]

rpm

Thanks I added a comment about that as well, it worked fine for me but others may have trouble.

Unsuccessful

When I try to install OpenVZ, it's okay.
But when I boot machine, Kernel Panics and machine do not boot.

Help needed immediately. (If you wish, I could pay for this.)
Please contact me on MSN: sinan@k.ro

Thank you.

openvz install

Without more information it is kind of hard to figure out what you have going on. First I would suggest going to the openvz site and getting the latest files. If that still causes problems you need to look further into what is causing the crash and if it works fine with a stock kernel - if not it is probably hardware/driver related.

User guide

If you are still thinking about the creation of a user guide you may contact me directly. OpenVZ is unnecessarily hard to understand at first. The template cache, should instead be called a template archive. Cache should refer instead to the private area. It should be made clear if modifications are ever made to the a private area instance by any utility that would effect all the VPSes based on that private area. I suspect that template management is simple and understandable but the lack of clear explaination on the OpenVZ site makes this tough. The user guide offers almost nothing under "template management".

Powered by Drupal - Theme created by Danger4k