Tag Archives: openvz

OpenVZ + HyperVM install

Had a lot of clients lately that were trying to install OpenVZ with HyperVM on the servers and were failing and this because of a few reasons: wrong partition scheme, installing only HyperVM with no Openvz or doing the install wrong, etc.

So i decided to put in here a few things about this type of install and what you need and how to do it.

Firstly you need to make sure that the partition scheme on the server is right for OpenVZ, a right partition scheme for a Virtuozzo based install will look like this:

/boot – 2G-10G – boot partition

swap – 2xRam Memory – swap partition

/ – all the space left – main root partition


/boot – 2G-10G – boot partition

swap – 2xRam Memory – swap partition

/ – 2G-10G(or more) – main root partition

/vz – all space left – virtuozzo partition, all vps’s files will be here

Now for the OpenVZ install i have modified the OVZinstall so that it will not download any templates as this will b downloaded by the HyperVM installation and will speed up the install a bit.

To install OpenVZ and HyperVM on a server do the following:

1. Install OpenVZ

setenforce 0

cd /root

wget http://repo.hostechs.com/index.php?dir=ovz%2F&download=ovzhypervm.tar.gz

tar -zxvf ovzhypervm.tar.gz

cd ovzhypervm

sh ovzinstall.sh

shutdown -r now

2. Install HyperVM

wget http://download.lxlabs.com/download/hypervm/production/hypervm-install-master.sh

sh ./hypervm-install-master.sh –virtualization-type=openvz

After HyperVM is installed you are all done, try and access your HyperVM CP: http://machine-name:8888  .

This should work just fine on any Debian/Fedora/Centos x86 install, not intended for 64bit yet as i did not finish the OVZinstall script for 64bit machines.

If anyone tries this and encounters any problems or have any questions please let me know.


OpenVZ installer

I am working for the last few days to finish the first release of a OpenVZ installer.

This OpenVZ installer will be for the start a script write in Bash which will download, check and install from A to Z a OpenVZ server including downloading a few templates.

The script will be released under a GPLv3 license so it will be free.

Project name: OVZinstall

General functions:

– Check if OS is supported and select installation type for the installed OS

– Import repositories

– Check if OpenVZ is already installed

– Check the CPU type and memory available and download/install appropriate kernel

– Set values in sysctl.conf

– Install vzctl, vzquota etc. packages

– Download a few templates

The script will save a log file under /var/log/openvz-install.log so if there will be any issues during the install we will know why.

The first release will be available only for x86 systems, will try later to add 64bit also.

The idea is that the script is supposed to save some time if you have to install plain OpenVZ servers.

Currently it was tested on Debian 4 and Centos 5 OSs and seems to be doing the job just fine.

During the following week i am planing to test it on Centos 4.7 and Fedora Core OSs also .

A small issue at the moment is that i can’t test it against a system with over 4Gb of RAM and/or running a Quad core CPU as i don’t have this hardware just laying around. Would be helpful if someone has access to this hardware and wants to test it and provide me with the output.

Any input is appreciated.

Virtualization with OpenVZ – OpenVZ Kernel Install

OpenVZ is known as being the free version of Virtuozzo(created by the guys at Parallels, former SwSoft) and i have to say that it is working really nice if you know your way around shell commands as this one comes without any Control Panel to manage the Containers and resources.

There are some nice Panels out there that can be used with OpenVZ and one of the is HyperVM created by the guys from LxLabs.

Anyway, will talk right now about installing the OpenVZ kernel/package on the server using command shell.

For this to be completed you need a fresh installed server(recommend CentOS 5) and root access to the server.

First we have to install the kernel for OpenVZ:

[root@test ~]#cd /etc/yum.repos.d

[root@test yum.repos.d]#wget http://download.openvz.org/openvz.repo

[root@test yum.repos.d]#cd /

[root@test /]#yum -y install ovzkernel

After the kernel was installed we have to enable IP forwarding :

[root@test /]#vi /etc/sysctl.conf

Change the following lines to look like this:

net.ipv4.ip_forward = 1
kernel.sysrq = 1

And add this at the bottom of that file:

net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

At last edit the grub.conf(menu.lst) file to let the server know to boot our new kernel by setting the default boot kernel:

[root@test /]#vi /boot/grub/grub.conf

Change the default value: default=0

Reboot the server:

[root@test /]#reboot or [root@test /]#shutdown -r now

If you are doing everything remotely and want to test the kernel and make sure that the server will boot up even if the kernel fails you can try the following:

[root@test /]# grub

grub> savedefault --default=0 --once

grub> quit

Run the reboot command now.

After the server is back up check to see what kernel is using:

[root@test /]#uname -r

And if everything is fine you should see the new kernel.

The next thing to do is to install the operation commands:

[root@test /]#yum -y install vzctrl vzquota vzpkg

When the Yum will finish installing the commands the only thing left to do is to try and start OpenVZ and if is working:

[root@test /]#/etc/rc.d/init.d/vz start
Starting OpenVZ: [ OK ]
Bringing up interface venet0: [ OK ]
Configuring interface venet0: [ OK ]