Installing And Using OpenVZ On Debian Wheezy (AMD64) - Page 3

2.3 Installing From Proxmox Packages

Add the following line to /etc/apt/sources.list:

vi /etc/apt/sources.list

[...]
# PVE packages provided by proxmox.com
deb http://download.proxmox.com/debian wheezy pve

Add the Proxmox key to apt:

wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -

Update the packages database:

apt-get update && apt-get dist-upgrade

Install the OpenVZ kernel, vzctl, and vzquota as follows:

apt-get install pve-firmware pve-kernel-2.6.32-20-pve vzctl vzquota vzprocps

Next we have to make sure that the correct kernel (the OpenVZ kernel) is booted when you restart the system. In the output of the last command, you should see something like this:

Setting up pve-firmware (1.0-22) ...
Setting up pve-kernel-2.6.32-20-pve (2.6.32-100) ...
update-initramfs: Generating /boot/initrd.img-2.6.32-20-pve
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found linux image: /boot/vmlinuz-2.6.32-20-pve
Found initrd image: /boot/initrd.img-2.6.32-20-pve
done

This means there is also another kernel on the system (3.2.0), and the openVZ kernel (2.6.32) is not the first in the list. So to make the OpenVZ kernel the default kernel, we have two options - adjust the default kernel in GRUB (recommended) or remove the non-VZ kernel(s).

To adjust the default kernel in GRUB, open /etc/default/grub...

vi /etc/default/grub

... and modify the GRUB_DEFAULT line (counting starts with 0; because each kernel comes also with a recovery mode, our OpenVZ kernel is the third kernel, so we need to put in 2 here):

[...]
GRUB_DEFAULT=2
[...]

Update GRUB afterwards:

update-grub

To remove the default kernel, run...

apt-get remove linux-image-amd64 linux-image-3.2.0-4-amd64

... and update GRUB:

update-grub

Now that we have made sure the correct kernel will boot, we can go on.

Create a symlink from /var/lib/vz to /vz to provide backward compatibility:

ln -s /var/lib/vz /vz

Open /etc/sysctl.conf and make sure that you have the following settings in it:

vi /etc/sysctl.conf

[...]
net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth0.proxy_arp=1
[...]

If you need to modify /etc/sysctl.conf, run

sysctl -p

afterwards.

The following step is important if the IP addresses of your virtual machines are from a different subnet than the host system's IP address. If you don't do this, networking will not work in the virtual machines!

Open /etc/vz/vz.conf and set NEIGHBOUR_DEVS to all:

vi /etc/vz/vz.conf

[...]
# Controls which interfaces to send ARP requests and modify APR tables on.
NEIGHBOUR_DEVS=all
[...]

Install vzdump:

apt-get install vzdump

Finally, reboot the system:

reboot

If your system reboots without problems, then everything is fine!

Run

uname -r

and your new OpenVZ kernel should show up:

root@server1:~# uname -r
2.6.32-20-pve
root@server1:~#

Now create the following configuration templates for OpenVZ containers:

vi /etc/vz/conf/ve-basic.conf-sample

#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# UBC parameters (in form of barrier:limit)
KMEMSIZE="14372700:14790164"
LOCKEDPAGES="2048:2048"
PRIVVMPAGES="65536:69632"
SHMPAGES="21504:21504"
NUMPROC="240:240"
PHYSPAGES="0:unlimited"
VMGUARPAGES="33792:unlimited"
OOMGUARPAGES="26112:unlimited"
NUMTCPSOCK="360:360"
NUMFLOCK="188:206"
NUMPTY="16:16"
NUMSIGINFO="256:256"
TCPSNDBUF="1720320:2703360"
TCPRCVBUF="1720320:2703360"
OTHERSOCKBUF="1126080:2097152"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="360:360"
DCACHESIZE="3409920:3624960"
NUMFILE="9312:9312"
AVNUMPROC="180:180"
NUMIPTENT="128:128"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="2G:2.2G"
DISKINODES="200000:220000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"

vi /etc/vz/conf/ve-light.conf-sample

#  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# UBC parameters (in form of barrier:limit)
# Primary parameters
AVNUMPROC="15:15"
NUMPROC="40:40"
NUMTCPSOCK="40:40"
NUMOTHERSOCK="40:40"
VMGUARPAGES="1725:unlimited"
# Secondary parameters
KMEMSIZE="1740800:1847296"
TCPSNDBUF="159744:262144"
TCPRCVBUF="159744:262144"
OTHERSOCKBUF="135168:237568"
DGRAMRCVBUF="135168:196608"
OOMGUARPAGES="1725:unlimited"
# Auxiliary parameters
LOCKEDPAGES="4:4"
SHMPAGES="1152:1152"
PRIVVMPAGES="7680:8448"
NUMFILE="512:512"
NUMFLOCK="50:60"
NUMPTY="4:4"
NUMSIGINFO="256:256"
DCACHESIZE="196608:202752"

PHYSPAGES="0:unlimited"
NUMIPTENT="16:16"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="1G:1.1G"
DISKINODES="80000:88000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="250"

vi /etc/vz/conf/ve-unlimited.conf-sample

#  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# UBC parameters (in form of barrier:limit)
# Primary parameters
AVNUMPROC="unlimited"
NUMPROC="unlimited"
NUMTCPSOCK="1801439850948198"
NUMOTHERSOCK="1801439850948198"
VMGUARPAGES="unlimited"
# Secondary parameters
KMEMSIZE="unlimited"
#TCPSNDBUF="2147483647:2147483647"
TCPSNDBUF="4611686018427387903:9223372036854775807"
TCPRCVBUF="4611686018427387903:9223372036854775807"
OTHERSOCKBUF="4611686018427387903:9223372036854775807"
DGRAMRCVBUF="unlimited"
OOMGUARPAGES="unlimited"
# Auxiliary parameters
LOCKEDPAGES="unlimited"
SHMPAGES="unlimited"
PRIVVMPAGES="unlimited"
NUMFILE="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
DCACHESIZE="unlimited"

PHYSPAGES="0:unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISK_QUOTA="no"

vi /etc/vz/conf/ve-vswap-1024m.conf-sample

#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# This config is valid for VSwap-enabled kernel (which currently means
# any RHEL6-based kernel, i.e. 042test* or 042stab*).

# UBC parameters (in form of barrier:limit)
PHYSPAGES="0:1G"
SWAPPAGES="0:2G"
KMEMSIZE="466M:512M"
DCACHESIZE="233M:256M"
LOCKEDPAGES="512M"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="2G:2.2G"
DISKINODES="200000:220000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"

vi /etc/vz/conf/ve-vswap-256m.conf-sample

#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# This config is valid for VSwap-enabled kernel (which currently means
# any RHEL6-based kernel, i.e. 042test* or 042stab*).

# UBC parameters (in form of barrier:limit)
PHYSPAGES="0:256M"
SWAPPAGES="0:512M"
KMEMSIZE="116M:128M"
DCACHESIZE="58M:64M"
LOCKEDPAGES="128M"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="2G:2.2G"
DISKINODES="200000:220000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"

vi /etc/vz/conf/ve-vswap-512m.conf-sample

#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# This config is valid for VSwap-enabled kernel (which currently means
# any RHEL6-based kernel, i.e. 042test* or 042stab*).

# UBC parameters (in form of barrier:limit)
PHYSPAGES="0:512M"
SWAPPAGES="0:1G"
KMEMSIZE="233M:256M"
DCACHESIZE="116M:128M"
LOCKEDPAGES="256M"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="2G:2.2G"
DISKINODES="200000:220000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"
Share this page:

6 Comment(s)

Add comment

Comments

From: jokajinx@gmail.com at: 2014-08-05 15:15:59


 wget http://download.openvz.org/kernel/branches/rhel6-2.6.32/042stab076.8/vzkernel-2.6.32-042stab076.8.i686.rpm

wget http://download.openvz.org/kernel/branches/rhel6-2.6.32/042stab076.8/vzkernel-debug-devel-2.6.32-042stab076.8.i686.rpm

wget http://download.openvz.org/utils/vzctl/4.3.1/vzctl-4.3.1-1.x86_64.rpm

wget http://download.openvz.org/utils/vzctl/4.3.1/vzctl-core-4.3.1-1.i386.rpm

wget http://download.openvz.org/utils/ploop/1.7/ploop-1.7-1.i386.rpm

wget http://download.openvz.org/utils/ploop/1.7/ploop-lib-1.7-1.i386.rpm

wget http://download.openvz.org/utils/vzquota/3.1/vzquota-3.1-1.i386.rpm

From: jokajinx at: 2014-08-08 20:40:02

if you get this ERROR when you run this

wget -O - http://ovz-web-panel.googlecode.com/svn/installer/ai.sh | sh

Setting up ruby-sqlite3 (1.3.6-2) ...
Setting up ruby1.8-dev (1.8.7.358-7.1+deb7u1) ...
Setting up rubygems (1.8.24-1) ...
Setting up unzip (6.0-8) ...
Setting up zip (3.0-6) ...
Setting up libsqlite3-ruby (1.3.6-2) ...
Setting up g++-4.7 (4.7.2-5) ...
Setting up g++ (4:4.7.2-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (11.5) ...
Setting up libstdc++6-4.7-dev (4.7.2-5) ...
Checking presence of the command: ruby
Fatal error: Panel requires Ruby 1.8 (Ruby 1.9 is not supported).

FIX WITH 

When installer stops do next:

2. ruby -v (output will be probably ruby1.9.1...)
1. apt-get install ruby-switch
3. ruby-switch --list (output - all installed ruby versions -> ruby1.8 & ruby1.9.1)
4. ruby-switch --set ruby1.8
5. ruby -v (output -> ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux])
6. run installer again
 
 

From: Michael Cooper at: 2013-07-04 16:33:03

I getting the following error when I run this command dpkg -i vz*.deb ploop*.deb on all of the files. Can you help please?

 warning: vzkernel-2.6.32-042stab076.8.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID a7a1d4b6: NOKEY


From: cascao at: 2015-03-09 17:42:00

i'm unable to compleat the toturial..help me..

my erro is : 

vzctl: error while loading shared libraries: libvzctl-4.8.so: cannot open shared object file: No such file or directory

...i did everyting on this tutorial...what's wrong?

From: till at: 2015-03-10 07:58:44

Try this:

ln -s /usr/lib64/libvzctl-4.8.so /usr/lib 

From: cascao at: 2015-03-23 17:11:12

 i have done that....

them i get a new erro...  :

 

Fatal error: Ruby 1.8 is not installed. Please install it first.

root@sv:/# ruby -v

bash: ruby: command not found

root@sv:/#

...

wen i do:

root@sv:/# apt-get install ruby-switch

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package ruby-switch

i have just one more week fo end this  and i'm unable to comlete..i really need help on  this...