<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Curx</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Curx"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Curx"/>
	<updated>2026-06-29T10:08:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Download/kernel/rhel5/028stab066.7/changes&amp;diff=7964</id>
		<title>Download/kernel/rhel5/028stab066.7/changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Download/kernel/rhel5/028stab066.7/changes&amp;diff=7964"/>
		<updated>2009-11-30T20:19:35Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Changes */  fix typo softirq(s)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Changes ==&lt;br /&gt;
Since {{kernel link|rhel5|028stab064.8}}:&lt;br /&gt;
* Rebase to 2.6.18-164.2.1.el5 kernel, number of CVEs fixed (see below), ext4, driver updates, etc.&lt;br /&gt;
* vzquota: ext4 support&lt;br /&gt;
* Bug fixes for the following issues:&lt;br /&gt;
** a Hardware Node may hang while printing the calltraces for all processes (caused by Alt+SysRQ+p magic key interrupt) due to incorrect NMI handling&lt;br /&gt;
** the default size of &amp;quot;tmpfs&amp;quot; filesystem was set to half amount of Hardware Node's memory&lt;br /&gt;
** two different UDP sockets may be bound to the same port inside a Container which in particular results in &amp;quot;aim7&amp;quot; test suite fail&lt;br /&gt;
** a Container based on Ubuntu 8.04 template may fail to migrate (checkpoint) with the following message: &amp;quot;Error: d_path is invisible /dev&amp;quot; ({{bug|1198}})&lt;br /&gt;
** the control script for the Oracle CSS daemon ('init.cssd', a part of Oracle 11g Release 1 RAC software) may fail to work and fill logs with the following messages: &amp;quot;Oprocd detected system hang while in nonfatal mode. Respawning.&amp;quot;&lt;br /&gt;
** a kernel crash may occur after Packet Generator tool kernel module (pktgen.ko) is loaded ({{bug|1325}})&lt;br /&gt;
** the sched_getcpu() function may return incorrect number if current CPU in case a process was migrated to another CPU via user request ({{bug|1149}})&lt;br /&gt;
* DRBD update up to v8.3.4&lt;br /&gt;
* Improvements:&lt;br /&gt;
** memory reclaiming algorithm has been modified, which resulted in significant NUMA nodes performance improvement&lt;br /&gt;
** &amp;quot;magic&amp;quot; Alt+SysRQ keys management has been enhanced: now disabling SysRQ keys (via &amp;lt;code&amp;gt;echo 0 &amp;gt; /proc/sys/sysrq&amp;lt;/code&amp;gt;) also disables the ability to execute SysRQ key handlers via the /proc/sysrq-trigger file&lt;br /&gt;
** a kmemsize debugging mechanism has been added, which simplifies kmemsize leaks investigation&lt;br /&gt;
** veth driver statistic has been enhanced to report correct &amp;quot;tx_dropped&amp;quot; packets value&lt;br /&gt;
** UDP hash table size has been significantly increased to speed up UDP traffic handling, which is important for example for Containers running Asterisk servers especially in the Full Proxy mode. Alternatively, UDP hash table size can be configured via &amp;lt;code&amp;gt;uhash_entries=&amp;lt;/code&amp;gt;kernel boot parameter&lt;br /&gt;
** softirq statistics can be now monitored via the /proc/softirqs file&lt;br /&gt;
** root on a Hardware Node may now run some new processes even if the overall number of processes/threads on the Node exceeds the value of &amp;lt;code&amp;gt;kernel.threads-max&amp;lt;/code&amp;gt; sysctl. In particular, this feature allows root to login to an overloaded Hardware Node&lt;br /&gt;
&lt;br /&gt;
=== Compatibility ===&lt;br /&gt;
* No new issues&lt;br /&gt;
&lt;br /&gt;
=== Configs ===&lt;br /&gt;
* No OpenVZ-specific changes&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{RHSA|2009-1193}}&lt;br /&gt;
* {{RHSA|2009-1222}}&lt;br /&gt;
* {{RHSA|2009-1243}}&lt;br /&gt;
* {{RHSA|2009-1455}}&lt;br /&gt;
* {{CVE|2007-5966}}&lt;br /&gt;
* {{CVE|2009-1385}}&lt;br /&gt;
* {{CVE|2009-1389}}&lt;br /&gt;
* {{CVE|2009-1895}}&lt;br /&gt;
* {{CVE|2009-2406}}&lt;br /&gt;
* {{CVE|2009-2407}}&lt;br /&gt;
* {{CVE|2009-2848}}&lt;br /&gt;
* {{CVE|2009-2847}}&lt;br /&gt;
* {{CVE|2009-0745}}&lt;br /&gt;
* {{CVE|2009-0746}}&lt;br /&gt;
* {{CVE|2009-0747}}&lt;br /&gt;
* {{CVE|2009-0748}}&lt;br /&gt;
* {{CVE|2009-2849}}&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Performance_tuning&amp;diff=7486</id>
		<title>Performance tuning</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Performance_tuning&amp;diff=7486"/>
		<updated>2009-08-24T15:32:07Z</updated>

		<summary type="html">&lt;p&gt;Curx: a typo repaired&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to improve the performance of an OpenVZ system.&lt;br /&gt;
&lt;br /&gt;
== HW node environment tuning ==&lt;br /&gt;
&lt;br /&gt;
=== Disable unnecessary services ===&lt;br /&gt;
&lt;br /&gt;
Disable all default services that you do not need to use and then reboot your host. &lt;br /&gt;
&lt;br /&gt;
For example, the &amp;lt;code&amp;gt;audit&amp;lt;/code&amp;gt; daemon can significantly decrease performance of linux kernel system calls (up to ~&amp;lt;font color=red&amp;gt;20%&amp;lt;/font&amp;gt;) even if you do not use any audit rules, or even if you just stopped this service without host reboot!&lt;br /&gt;
&lt;br /&gt;
To setup default services, use &amp;lt;code&amp;gt;chkconfig&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ntsysv&amp;lt;/code&amp;gt; in RedHat, or &amp;lt;code&amp;gt;rc-update&amp;lt;/code&amp;gt; in Gentoo, &amp;lt;code&amp;gt;update-rc.d&amp;lt;/code&amp;gt; on Debian&lt;br /&gt;
&lt;br /&gt;
=== Shell scripts performance improvement ===&lt;br /&gt;
&lt;br /&gt;
To improve performance of small shell scripts, which spends a lot of time starting the shell binary itself (like the shell scripts test from the [http://www.tux.org/pub/tux/niemi/unixbench/ unixbench] package), you can set your &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt; environment variable to &amp;lt;code&amp;gt;&amp;quot;C&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To see current settings, type &lt;br /&gt;
&lt;br /&gt;
  # locale&lt;br /&gt;
&lt;br /&gt;
If you want to change it only for the current shell session, do:&lt;br /&gt;
&lt;br /&gt;
 # export LANG=C&lt;br /&gt;
&lt;br /&gt;
If you want to change the default value, modify the &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
If your default &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt; environment variable was set to something like &amp;lt;code&amp;gt;en_US.UTF-8&amp;lt;/code&amp;gt;, you can reduce shell (bash) startup time up to ~&amp;lt;font color=red&amp;gt;15%&amp;lt;/font&amp;gt; with &amp;lt;code&amp;gt;LANG=C&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
== Container tuning ==&lt;br /&gt;
&lt;br /&gt;
=== CPU distribution inside container on SMP hosts ===&lt;br /&gt;
&lt;br /&gt;
If the total number of containers in your host is more than CPUs number, and there are many '''threads''' running inside each container it is better to give just a single VCPU to each container.&lt;br /&gt;
In this case thread memory locality will significantly reduce overhead on SMP memory coherence and overall performance can be increased up to ~&amp;lt;font color=red&amp;gt;50-100%&amp;lt;/font&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
To set the number of CPUs available inside a container, use:&lt;br /&gt;
&lt;br /&gt;
 # vzctl set $CTID --cpus N&lt;br /&gt;
&lt;br /&gt;
=== Network checksumming ===&lt;br /&gt;
&lt;br /&gt;
RHEL 5 based kernel supports IP checksum offload.&lt;br /&gt;
If network ethernet cards in your host support IP checksum offload then you can switch this feature on also for the virtual network devices (venet, veth).&lt;br /&gt;
&lt;br /&gt;
To check current offload setting for the hardware ethernet card (eth0, for instance) type&lt;br /&gt;
&lt;br /&gt;
  # ethtool -k eth0&lt;br /&gt;
 &lt;br /&gt;
Make sure that tx/rx features are switched on.&lt;br /&gt;
&lt;br /&gt;
To see current offload settings for the venet0 device, type&lt;br /&gt;
&lt;br /&gt;
  # ethtool -k venet0&lt;br /&gt;
&lt;br /&gt;
To set offload settings on for the venet0 device, type&lt;br /&gt;
&lt;br /&gt;
  # ethtool -K venet0 tx on sg on&lt;br /&gt;
&lt;br /&gt;
Note, that 'tx on/off' enables/disables both tx and rx checksumming features for the all venet devices for all containers and HN.&lt;br /&gt;
&lt;br /&gt;
The same applies to the veth device except that 'tx on/off' enables/disables tx and rx checksumming features for only given virtual ethernet device in HN and corresponding container.&lt;br /&gt;
&lt;br /&gt;
=== Shell scripts performance improvement ===&lt;br /&gt;
&lt;br /&gt;
Please note, that on container creation the default &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt; value will be the same as in the HW node. So you can tune it in node (see [[#Shell scripts performance improvement]] above), or set it in container the same way.&lt;br /&gt;
&lt;br /&gt;
The second important thing is the locale cache. On &amp;lt;code&amp;gt;rpm&amp;lt;/code&amp;gt; based distributions, usually it is created by the &amp;lt;code&amp;gt;glibc-common-XXX.rpm&amp;lt;/code&amp;gt; post install script and it can be up to 50 MBytes on some distributions. So on some container templates it can be missed to save disk space. But you can always create it inside container later by the following command (you must be the root user):  &lt;br /&gt;
&lt;br /&gt;
 # build-locale-archive&lt;br /&gt;
&lt;br /&gt;
And again, in some cases shell (bash) startup time can be reduced up to ~&amp;lt;font color=red&amp;gt;15%&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Traffic_accounting_through_proc&amp;diff=7034</id>
		<title>Traffic accounting through proc</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Traffic_accounting_through_proc&amp;diff=7034"/>
		<updated>2009-02-03T23:34:19Z</updated>

		<summary type="html">&lt;p&gt;Curx: update to use the cron system of openvz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traffic Accounting through /proc/net/dev&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Traffic accounting in OpenVZ can be done through data collection against&lt;br /&gt;
&amp;lt;code&amp;gt;/proc/net/dev&amp;lt;/code&amp;gt; in the individual containers on a [[HN]].&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* OpenVZ&lt;br /&gt;
* RRDTool&lt;br /&gt;
* GNU AWK&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
First create a directory to store your RRD files:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /var/lib/rrd/&lt;br /&gt;
&lt;br /&gt;
Then install this script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Script Name:  vz_direct_traffic_log&lt;br /&gt;
# Author:       &amp;quot;Brian Harrington, Alticon Inc&amp;quot; &amp;lt;bharrington@alticon.net&amp;gt;&lt;br /&gt;
# Website:      htty://www.alticon.net&lt;br /&gt;
&lt;br /&gt;
# Time to do the data collection.&lt;br /&gt;
for veid in `/usr/sbin/vzlist -o veid -H | sed 's/ //g'`; do&lt;br /&gt;
&lt;br /&gt;
               RRDFILE=&amp;quot;/var/lib/rrd/$veid.rrd&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
               if ! test -e $RRDFILE; then&lt;br /&gt;
                       echo $RRDFILE does not exist, creating.&lt;br /&gt;
                       # Place your preferred RRD Creation command here&lt;br /&gt;
               fi&lt;br /&gt;
 &lt;br /&gt;
               # Parse out the inbound/outbound traffic and assign them to the corresponding variables&lt;br /&gt;
               eval `/usr/sbin/vzctl exec $veid &amp;quot;grep venet0 /proc/net/dev&amp;quot;  |  \&lt;br /&gt;
                       awk -F: '{print $2}' | awk '{printf&amp;quot;CTIN=%-15d\nCTOUT=%-15d\n&amp;quot;, $1, $9}'`&lt;br /&gt;
 &lt;br /&gt;
               # Send the data to the corresponding RRD time with (N)now as the update time&lt;br /&gt;
               /usr/bin/rrdtool update $RRDFILE N:$CTIN:$CTOUT&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Add this to cron to run every 5 minutes:&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;*/5 * * * * root /path/to/script/vz_direct_traffic_log &amp;quot; &amp;gt;&amp;gt; \&lt;br /&gt;
   /etc/crontab &amp;amp;&amp;amp; /etc/init.d/crontab restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Better use the cron system of OpenVZ&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;*/5 * * * * root /path/to/script/vz_direct_traffic_log &amp;quot; &amp;gt;&amp;gt; \&lt;br /&gt;
   /etc/vz/cron/vz-traffic.sh &amp;amp;&amp;amp; /etc/init.d/vz update-cron&lt;br /&gt;
&lt;br /&gt;
To check the output of this later run:&lt;br /&gt;
&lt;br /&gt;
 # rrdtool fetch /var/lib/rrd/&amp;lt;veid&amp;gt;.rrd AVERAGE -s -3600&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
* [[Monitoring bandwidth of containers]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Monitoring]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Traffic_accounting_through_proc&amp;diff=7033</id>
		<title>Traffic accounting through proc</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Traffic_accounting_through_proc&amp;diff=7033"/>
		<updated>2009-02-03T23:27:52Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traffic Accounting through /proc/net/dev&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Traffic accounting in OpenVZ can be done through data collection against&lt;br /&gt;
&amp;lt;code&amp;gt;/proc/net/dev&amp;lt;/code&amp;gt; in the individual containers on a [[HN]].&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* OpenVZ&lt;br /&gt;
* RRDTool&lt;br /&gt;
* GNU AWK&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
First create a directory to store your RRD files:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /var/lib/rrd/&lt;br /&gt;
&lt;br /&gt;
Then install this script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Script Name:  vz_direct_traffic_log&lt;br /&gt;
# Author:       &amp;quot;Brian Harrington, Alticon Inc&amp;quot; &amp;lt;bharrington@alticon.net&amp;gt;&lt;br /&gt;
# Website:      htty://www.alticon.net&lt;br /&gt;
&lt;br /&gt;
# Time to do the data collection.&lt;br /&gt;
for veid in `/usr/sbin/vzlist -o veid -H | sed 's/ //g'`; do&lt;br /&gt;
&lt;br /&gt;
               RRDFILE=&amp;quot;/var/lib/rrd/$veid.rrd&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
               if ! test -e $RRDFILE; then&lt;br /&gt;
                       echo $RRDFILE does not exist, creating.&lt;br /&gt;
                       # Place your preferred RRD Creation command here&lt;br /&gt;
               fi&lt;br /&gt;
 &lt;br /&gt;
               # Parse out the inbound/outbound traffic and assign them to the corresponding variables&lt;br /&gt;
               eval `/usr/sbin/vzctl exec $veid &amp;quot;grep venet0 /proc/net/dev&amp;quot;  |  \&lt;br /&gt;
                       awk -F: '{print $2}' | awk '{printf&amp;quot;CTIN=%-15d\nCTOUT=%-15d\n&amp;quot;, $1, $9}'`&lt;br /&gt;
 &lt;br /&gt;
               # Send the data to the corresponding RRD time with (N)now as the update time&lt;br /&gt;
               /usr/bin/rrdtool update $RRDFILE N:$CTIN:$CTOUT&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Add this to cron to run every 5 minutes:&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;*/5 * * * * root /path/to/script/vz_direct_traffic_log &amp;quot; &amp;gt;&amp;gt; \&lt;br /&gt;
   /etc/crontab &amp;amp;&amp;amp; /etc/init.d/crontab restart&lt;br /&gt;
&lt;br /&gt;
To check the output of this later run:&lt;br /&gt;
&lt;br /&gt;
 # rrdtool fetch /var/lib/rrd/&amp;lt;veid&amp;gt;.rrd AVERAGE -s -3600&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
* [[Monitoring bandwidth of containers]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Monitoring]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Monitoring_bandwidth_of_containers&amp;diff=6840</id>
		<title>Monitoring bandwidth of containers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Monitoring_bandwidth_of_containers&amp;diff=6840"/>
		<updated>2008-12-31T01:09:11Z</updated>

		<summary type="html">&lt;p&gt;Curx: Monitoring bandwith of containers moved to Monitoring bandwidth of containers: typo in Title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Monitoring bandwith of containers}}&lt;br /&gt;
&lt;br /&gt;
Use the /proc/dev/net inside a container, dump stats into a round robin database (rrd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Bandwidth collection script for OpenVZ by Eric 'phpfreak' Rosebrock&lt;br /&gt;
# http://www.serverpowered.com / http://www.thewebfreaks.com&lt;br /&gt;
# Please read: http://www.serverpowered.com/openvz-bandwidth-accounting.php&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# No warranties on this script, use it at your own risk!&lt;br /&gt;
#&lt;br /&gt;
# Special thanks to Rick Blundell for helping me to get this thing going.&lt;br /&gt;
#&lt;br /&gt;
# Discussions: http://forum.openvz.org/index.php?t=tree&amp;amp;goto=1350&lt;br /&gt;
&lt;br /&gt;
# BWVE is the bandwidth storage VE. This would have been created by the&lt;br /&gt;
# tutorial you followed as listed above.&lt;br /&gt;
&lt;br /&gt;
BWVE=1002&lt;br /&gt;
&lt;br /&gt;
# BWDIR is the directory inside the bandwdith VE where the .rrd files&lt;br /&gt;
# will be stored.&lt;br /&gt;
&lt;br /&gt;
BWDIR=var/rrd/vz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# You should not need to edit anything below this line.&lt;br /&gt;
&lt;br /&gt;
# Get the date from the first of this month to create new rrd files&lt;br /&gt;
TDATE=`date +%Y-%m-01`;&lt;br /&gt;
ETIME=`date +%s -d $TDATE`&lt;br /&gt;
&lt;br /&gt;
# Define the full path to the bandwidth VE directory and the storage dir.&lt;br /&gt;
CBWDIR=/vz/private/$BWVE/$BWDIR&lt;br /&gt;
&lt;br /&gt;
# Test and make sure that directory is there, if not create it.&lt;br /&gt;
if ! test -d $CBWDIR; then&lt;br /&gt;
        echo $CBWDIR does not exist, creating it.&lt;br /&gt;
        mkdir $CBWDIR&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Get a list of all of the VE's created on the system, not just the running ones.&lt;br /&gt;
&lt;br /&gt;
for i in `ls $CBWDIR`; do&lt;br /&gt;
        VES=`echo $i | cut -f2 -d- | cut -f1 -d.`;&lt;br /&gt;
&lt;br /&gt;
        # if the VE was there before, an .rrd file will exist. Now if the VE is gone,&lt;br /&gt;
        # Delete the .rrd file because its obviously not needed anymore.&lt;br /&gt;
&lt;br /&gt;
        if ! test -d /vz/private/$VES; then&lt;br /&gt;
                echo $i will be deleted&lt;br /&gt;
                rm -rf $CBWDIR/vps-$VES.rrd&lt;br /&gt;
        fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# Time to do the data collection.&lt;br /&gt;
for i in `/usr/sbin/vzlist -Ho veid`; do&lt;br /&gt;
&lt;br /&gt;
                RRDFILE=$CBWDIR/vps-$i.rrd&lt;br /&gt;
&lt;br /&gt;
                if ! test -e $RRDFILE; then&lt;br /&gt;
                        echo $RRDFILE does not exist, creating.&lt;br /&gt;
                        /usr/bin/rrdtool create $RRDFILE -s 300 \&lt;br /&gt;
                                DS:ds0:DERIVE:600:0:1125000000 \&lt;br /&gt;
                                DS:ds1:DERIVE:600:0:1125000000 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:1:600 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:6:700 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:24:775 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:288:797 \&lt;br /&gt;
                                RRA:MAX:0.5:1:600 \&lt;br /&gt;
                                RRA:MAX:0.5:6:700 \&lt;br /&gt;
                                RRA:MAX:0.5:24:775 \&lt;br /&gt;
                                RRA:MAX:0.5:288:797 \&lt;br /&gt;
                                RRA:MIN:0.5:1:600 \&lt;br /&gt;
                                RRA:MIN:0.5:6:700 \&lt;br /&gt;
                                RRA:MIN:0.5:24:775 \&lt;br /&gt;
                                RRA:MIN:0.5:288:797&lt;br /&gt;
                fi&lt;br /&gt;
&lt;br /&gt;
                X=`/usr/sbin/vzctl exec $i &amp;quot;grep venet0 /proc/net/dev&amp;quot;`&lt;br /&gt;
                eval `echo $X | cut -f2 -d: | awk '{printf&amp;quot;IN=%-11d\nOUT=%-11d\n&amp;quot;, $1, $9}'`&lt;br /&gt;
&lt;br /&gt;
                for g in IN OUT;do&lt;br /&gt;
                        if [ -z ${!g} ]; then&lt;br /&gt;
                                echo foo&lt;br /&gt;
                                eval $g=0&lt;br /&gt;
                        fi&lt;br /&gt;
                done&lt;br /&gt;
                /usr/bin/rrdtool update $RRDFILE N:$IN:$OUT&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Monitoring]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Monitoring_bandwith_of_containers&amp;diff=6841</id>
		<title>Monitoring bandwith of containers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Monitoring_bandwith_of_containers&amp;diff=6841"/>
		<updated>2008-12-31T01:09:11Z</updated>

		<summary type="html">&lt;p&gt;Curx: Monitoring bandwith of containers moved to Monitoring bandwidth of containers: typo in Title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Monitoring bandwidth of containers]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Monitoring_bandwidth_of_containers&amp;diff=6839</id>
		<title>Monitoring bandwidth of containers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Monitoring_bandwidth_of_containers&amp;diff=6839"/>
		<updated>2008-12-31T01:05:02Z</updated>

		<summary type="html">&lt;p&gt;Curx: add script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Monitoring bandwith of containers}}&lt;br /&gt;
&lt;br /&gt;
Use the /proc/dev/net inside a container, dump stats into a round robin database (rrd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Bandwidth collection script for OpenVZ by Eric 'phpfreak' Rosebrock&lt;br /&gt;
# http://www.serverpowered.com / http://www.thewebfreaks.com&lt;br /&gt;
# Please read: http://www.serverpowered.com/openvz-bandwidth-accounting.php&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# No warranties on this script, use it at your own risk!&lt;br /&gt;
#&lt;br /&gt;
# Special thanks to Rick Blundell for helping me to get this thing going.&lt;br /&gt;
#&lt;br /&gt;
# Discussions: http://forum.openvz.org/index.php?t=tree&amp;amp;goto=1350&lt;br /&gt;
&lt;br /&gt;
# BWVE is the bandwidth storage VE. This would have been created by the&lt;br /&gt;
# tutorial you followed as listed above.&lt;br /&gt;
&lt;br /&gt;
BWVE=1002&lt;br /&gt;
&lt;br /&gt;
# BWDIR is the directory inside the bandwdith VE where the .rrd files&lt;br /&gt;
# will be stored.&lt;br /&gt;
&lt;br /&gt;
BWDIR=var/rrd/vz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# You should not need to edit anything below this line.&lt;br /&gt;
&lt;br /&gt;
# Get the date from the first of this month to create new rrd files&lt;br /&gt;
TDATE=`date +%Y-%m-01`;&lt;br /&gt;
ETIME=`date +%s -d $TDATE`&lt;br /&gt;
&lt;br /&gt;
# Define the full path to the bandwidth VE directory and the storage dir.&lt;br /&gt;
CBWDIR=/vz/private/$BWVE/$BWDIR&lt;br /&gt;
&lt;br /&gt;
# Test and make sure that directory is there, if not create it.&lt;br /&gt;
if ! test -d $CBWDIR; then&lt;br /&gt;
        echo $CBWDIR does not exist, creating it.&lt;br /&gt;
        mkdir $CBWDIR&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Get a list of all of the VE's created on the system, not just the running ones.&lt;br /&gt;
&lt;br /&gt;
for i in `ls $CBWDIR`; do&lt;br /&gt;
        VES=`echo $i | cut -f2 -d- | cut -f1 -d.`;&lt;br /&gt;
&lt;br /&gt;
        # if the VE was there before, an .rrd file will exist. Now if the VE is gone,&lt;br /&gt;
        # Delete the .rrd file because its obviously not needed anymore.&lt;br /&gt;
&lt;br /&gt;
        if ! test -d /vz/private/$VES; then&lt;br /&gt;
                echo $i will be deleted&lt;br /&gt;
                rm -rf $CBWDIR/vps-$VES.rrd&lt;br /&gt;
        fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# Time to do the data collection.&lt;br /&gt;
for i in `/usr/sbin/vzlist -Ho veid`; do&lt;br /&gt;
&lt;br /&gt;
                RRDFILE=$CBWDIR/vps-$i.rrd&lt;br /&gt;
&lt;br /&gt;
                if ! test -e $RRDFILE; then&lt;br /&gt;
                        echo $RRDFILE does not exist, creating.&lt;br /&gt;
                        /usr/bin/rrdtool create $RRDFILE -s 300 \&lt;br /&gt;
                                DS:ds0:DERIVE:600:0:1125000000 \&lt;br /&gt;
                                DS:ds1:DERIVE:600:0:1125000000 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:1:600 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:6:700 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:24:775 \&lt;br /&gt;
                                RRA:AVERAGE:0.5:288:797 \&lt;br /&gt;
                                RRA:MAX:0.5:1:600 \&lt;br /&gt;
                                RRA:MAX:0.5:6:700 \&lt;br /&gt;
                                RRA:MAX:0.5:24:775 \&lt;br /&gt;
                                RRA:MAX:0.5:288:797 \&lt;br /&gt;
                                RRA:MIN:0.5:1:600 \&lt;br /&gt;
                                RRA:MIN:0.5:6:700 \&lt;br /&gt;
                                RRA:MIN:0.5:24:775 \&lt;br /&gt;
                                RRA:MIN:0.5:288:797&lt;br /&gt;
                fi&lt;br /&gt;
&lt;br /&gt;
                X=`/usr/sbin/vzctl exec $i &amp;quot;grep venet0 /proc/net/dev&amp;quot;`&lt;br /&gt;
                eval `echo $X | cut -f2 -d: | awk '{printf&amp;quot;IN=%-11d\nOUT=%-11d\n&amp;quot;, $1, $9}'`&lt;br /&gt;
&lt;br /&gt;
                for g in IN OUT;do&lt;br /&gt;
                        if [ -z ${!g} ]; then&lt;br /&gt;
                                echo foo&lt;br /&gt;
                                eval $g=0&lt;br /&gt;
                        fi&lt;br /&gt;
                done&lt;br /&gt;
                /usr/bin/rrdtool update $RRDFILE N:$IN:$OUT&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Monitoring]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Debian_versions&amp;diff=6440</id>
		<title>Debian versions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Debian_versions&amp;diff=6440"/>
		<updated>2008-09-15T05:29:19Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Debian people refer to versions of Debian distribution in a few ways: by nicknames, by numberic versions, and by statuses. The following table summarizes the relations between those referrals.&lt;br /&gt;
&lt;br /&gt;
Note that ''status'' is changing over time, e.g. &amp;quot;Lenny&amp;quot; will become stable (and get a number) some time in future.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Name || Version || Status&lt;br /&gt;
|-&lt;br /&gt;
| Sid || n/a || unstable&lt;br /&gt;
|-&lt;br /&gt;
| Lenny || 5.0 || testing&lt;br /&gt;
|-&lt;br /&gt;
| Etch || 4.0 || stable&lt;br /&gt;
|-&lt;br /&gt;
| Sarge || 3.1 || old stable&lt;br /&gt;
|-&lt;br /&gt;
| Woody || 3.0 || n/a&lt;br /&gt;
|-&lt;br /&gt;
| Potato || 2.2 || n/a&lt;br /&gt;
|-&lt;br /&gt;
| Slink || 2.1 || n/a&lt;br /&gt;
|-&lt;br /&gt;
| Hamm || 2.0 || n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* http://www.debian.org/releases/&lt;br /&gt;
&lt;br /&gt;
[[Category: Debian]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Hardy_TODO&amp;diff=5951</id>
		<title>Ubuntu Hardy TODO</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Hardy_TODO&amp;diff=5951"/>
		<updated>2008-05-26T04:26:45Z</updated>

		<summary type="html">&lt;p&gt;Curx: remove precreated ubuntu templates from forzza.systs.org/ostemplates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is to track the status of OpenVZ integration into Ubuntu 8.04 «Hardy Heron».&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
&lt;br /&gt;
2.6.24 kernel is ready for initial inclusion to Hardy. Below are some resources.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Hardy kernel git:&lt;br /&gt;
* http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=summary&lt;br /&gt;
* [http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=blob;f=debian/binary-custom.d/README How to add new kernel flavour]&lt;br /&gt;
&lt;br /&gt;
OpenVZ 2.6.24 kernel git (switch to '''2.6.24-openvz''' branch):&lt;br /&gt;
* http://git.openvz.org/?p=linux-2.6.24-openvz;a=summary&lt;br /&gt;
* http://git.openvz.org/?p=linux-2.6.24-openvz;a=shortlog;h=2.6.24-openvz&lt;br /&gt;
&lt;br /&gt;
'''Status''': adobriyan@ is working on porting our patch set to hardy kernel.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
==== Done ====&lt;br /&gt;
* Already updated to 3.0.22, see&lt;br /&gt;
** https://bugs.launchpad.net/ubuntu/+source/vzctl/+bug/183774&lt;br /&gt;
** http://packages.ubuntu.com/vzctl&lt;br /&gt;
&lt;br /&gt;
==== TODO ====&lt;br /&gt;
&lt;br /&gt;
* Need to fix requirements: vzctl now suggests on linux-patch-openvz, instead it should require linux-image-openvz&lt;br /&gt;
* It probably makes sense to automate changing sysctl options on vzctl package installation (like vzctl from debian.systs.org does).&lt;br /&gt;
&lt;br /&gt;
=== vzquota ===&lt;br /&gt;
&lt;br /&gt;
==== DONE ====&lt;br /&gt;
&lt;br /&gt;
* Updated to 3.0.11, see http://packages.ubuntu.com/vzquota&lt;br /&gt;
&lt;br /&gt;
==== TODO ====&lt;br /&gt;
&lt;br /&gt;
* As with vzctl, need to get rid of 'Suggects: kernel-patch-openvz' and require kernel-image-openvz instead.&lt;br /&gt;
&lt;br /&gt;
=== vzpkg ===&lt;br /&gt;
&lt;br /&gt;
Don't have plans to ship vzpkg in Ubuntu&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* Ubuntu-specific documentation on wiki.openvz.org (see [[:Category:Ubuntu]])&lt;br /&gt;
* OpenVZ landing page for ubuntu.com&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
The following templates are currently available (check http://openvz.org/download/template/cache/ for full list):&lt;br /&gt;
* Ubuntu 7.10 for x86 and x86_64.&lt;br /&gt;
&lt;br /&gt;
We need to create somewhat minimal Hardy template and [probably?] pack it into a package.&lt;br /&gt;
&lt;br /&gt;
As Ubuntu comes with debootstrap, making Ubuntu templates is pretty easy. See [[Ubuntu Gutsy template creation]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Ubuntu]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=5912</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=5912"/>
		<updated>2008-05-19T20:39:34Z</updated>

		<summary type="html">&lt;p&gt;Curx: gitty repository removed, lenny added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and container templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container private&lt;br /&gt;
directories (by default &amp;lt;code&amp;gt;/var/lib/vz/private/&amp;lt;CTID&amp;gt;&amp;lt;/code&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind that per-container quota in this context includes not only pure per-container quota but also usual Linux disk quota used in container, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for containers because the root user of container will be able to overcome the 5% disk space barrier in some situations. If the HN root partition is completely filled, it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems so use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org:&lt;br /&gt;
&lt;br /&gt;
; by Ola Lundqvist &amp;lt;opal@debian.org&amp;gt;&lt;br /&gt;
: (OpenVZ kernels only)&lt;br /&gt;
: apt-uri http://download.openvz.org/debian&lt;br /&gt;
&lt;br /&gt;
; by Thorsten Schifferdecker &amp;lt;tsd@debian.systs.org&amp;gt;&lt;br /&gt;
: apt-uri http://download.openvz.org/debian-systs&lt;br /&gt;
: (Mirror of OpenVZ Repository from http://debian.systs.org/)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository at http://download.openvz.org/debian-systs, the actually OpenVZ Tools for Debian are exist only in unstable, see http://packages.debian.org/vzctl}}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on Ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is even an '''lenny''' repository with kernel 2.6.24. '''Use it at your own risk!'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs lenny openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ kernel (the Debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from http://download.openvz.org'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian kernel config and OpenVZ Settings'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically, or execute update-grub; lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
: A utility to control OpenVZ containers (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
: A utility to manage quotas for containers. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # [sudo] sysctl -p&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward&lt;br /&gt;
compatibility to OpenVZ as installed in other distributions&lt;br /&gt;
(Debian vz root directory is /var/lib/vz to be FHS-compliant.}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
=== OS templates ===&lt;br /&gt;
&lt;br /&gt;
To install a container, you need OS template(s).&lt;br /&gt;
&lt;br /&gt;
Precreated templates can be found [http://download.openvz.org/contrib/template/precreated/ here].&lt;br /&gt;
&lt;br /&gt;
You can create your own templates, see &lt;br /&gt;
[[Debian template creation]], [[Ubuntu Gutsy template creation] and [[Category:Templates]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
== Additional User Tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
&lt;br /&gt;
; [[vzdump]]&lt;br /&gt;
:    A utility to backup and restore container. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a minimal OS template&lt;br /&gt;
to create a first container and do some&lt;br /&gt;
[[basic operations in OpenVZ environment]]. Read the [[download:doc/OpenVZ-Users-Guide.pdf]], browse this wiki.&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Debian]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Hardy_TODO&amp;diff=4191</id>
		<title>Ubuntu Hardy TODO</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Hardy_TODO&amp;diff=4191"/>
		<updated>2008-03-01T08:53:13Z</updated>

		<summary type="html">&lt;p&gt;Curx: add url for precreated os templates of ubunutu hardy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is to track the status of OpenVZ integration into Ubuntu 8.04 «Hardy Heron».&lt;br /&gt;
&lt;br /&gt;
== Kernel ==&lt;br /&gt;
&lt;br /&gt;
2.6.24 kernel is ready for initial inclusion to Hardy. Below are some resources.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Hardy kernel git:&lt;br /&gt;
* http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=summary&lt;br /&gt;
* [http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=blob;f=debian/binary-custom.d/README How to add new kernel flavour]&lt;br /&gt;
&lt;br /&gt;
OpenVZ 2.6.24 kernel git (switch to '''2.6.24-openvz''' branch):&lt;br /&gt;
* http://git.openvz.org/?p=linux-2.6.24-openvz;a=summary&lt;br /&gt;
* http://git.openvz.org/?p=linux-2.6.24-openvz;a=shortlog;h=2.6.24-openvz&lt;br /&gt;
&lt;br /&gt;
'''Status''': adobriyan@ is working on porting our patch set to hardy kernel.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
==== Done ====&lt;br /&gt;
* Already updated to 3.0.22, see&lt;br /&gt;
** https://bugs.launchpad.net/ubuntu/+source/vzctl/+bug/183774&lt;br /&gt;
** http://packages.ubuntu.com/vzctl&lt;br /&gt;
&lt;br /&gt;
==== TODO ====&lt;br /&gt;
&lt;br /&gt;
* Need to fix requirements: vzctl now suggests on linux-patch-openvz, instead it should require linux-image-openvz&lt;br /&gt;
* It probably makes sense to automate changing sysctl options on vzctl package installation (like vzctl from debian.systs.org does).&lt;br /&gt;
&lt;br /&gt;
=== vzquota ===&lt;br /&gt;
&lt;br /&gt;
==== DONE ====&lt;br /&gt;
&lt;br /&gt;
* Updated to 3.0.11, see http://packages.ubuntu.com/vzquota&lt;br /&gt;
&lt;br /&gt;
==== TODO ====&lt;br /&gt;
&lt;br /&gt;
* As with vzctl, need to get rid of 'Suggects: kernel-patch-openvz' and require kernel-image-openvz instead.&lt;br /&gt;
&lt;br /&gt;
=== vzpkg ===&lt;br /&gt;
&lt;br /&gt;
Don't have plans to ship vzpkg in Ubuntu&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* Ubuntu-specific documentation on wiki.openvz.org (see [[:Category:Ubuntu]])&lt;br /&gt;
* OpenVZ landing page for ubuntu.com&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
The following templates are currently available (check http://openvz.org/download/template/cache/ for full list):&lt;br /&gt;
* Ubuntu 7.10 for x86 and x86_64.&lt;br /&gt;
&lt;br /&gt;
We need to create somewhat minimal Hardy template and [probably?] pack it into a package.&lt;br /&gt;
&lt;br /&gt;
* Ubuntu 8.0.4 precreted templates http://forzza.systs.org/ostemplates/&lt;br /&gt;
&lt;br /&gt;
As Ubuntu comes with debootstrap, making Ubuntu templates is pretty easy. See [[Ubuntu Gutsy template creation]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Ubuntu]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3893</id>
		<title>User:Curx</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3893"/>
		<updated>2008-01-05T12:58:20Z</updated>

		<summary type="html">&lt;p&gt;Curx: copytoinstalldeb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;curx&amp;quot; aka Thorsten Schifferdecker&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3892</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3892"/>
		<updated>2008-01-05T12:57:17Z</updated>

		<summary type="html">&lt;p&gt;Curx: typo removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and VE templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] Stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for VEs private directories (by default /var/lib/vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-VE quota in this context includes not only pure per-VE quota, but also usual Linux disk quota used in VE, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for VEs, because the root user of VE will be able to overcome 5% disk space barrier in some situations. This way HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-VE disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-VE disk quota.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org  :&lt;br /&gt;
&lt;br /&gt;
 Ola Lundqvist &amp;lt;opal@debian.org&amp;gt; &amp;quot;OpenVZ Kernels only&amp;quot; --&amp;gt; apt-uri [http://download.openvz.org/debian http://download.openvz.org/debian] &lt;br /&gt;
&lt;br /&gt;
 Thorsten Schifferdecker &amp;lt;tsd@debian.systs.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian-systs http://download.openvz.org/debian-systs] (Mirror of OpenVZ Repository from http://debian.systs.org)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository at http://download.openvz.org/debian-systs, the actually OpenVZ Tools for Debian are exist only in unstable see http://packages.debian.org/vzctl  }}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# [sudo] echo &amp;quot;deb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-key add dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ Kernel (the debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from http://download.openvz.org'''&lt;br /&gt;
! kernel !! Description !! Hardware !! Debian Architektur&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian kernel config and OpenVZ Settings'''&lt;br /&gt;
! kernel !! Description !! Hardware !! Debian Architektur&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically, or execute update-grub; lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VE OS Templates ===&lt;br /&gt;
&lt;br /&gt;
To install a VE, you need VE OS Template(s), precreated can be found [http://download.openvz.org/contrib/template/precreated/ here] or create it : [http://wiki.openvz.org/Debian_template_creation Debian] , [http://wiki.openvz.org/Ubuntu_Gutsy_template_creation ubuntu] and all infos about [http://wiki.openvz.org/Category:Templates Templates]&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additial user tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
:&lt;br /&gt;
; [http://wiki.openvz.org/Backup_of_a_running_VE_with_vzdump vzdump]&lt;br /&gt;
:    A utility to backup and restore VE. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a Minimal VE OS Template create a first VE and &lt;br /&gt;
do some [[Basic operations in OpenVZ environment]] and read the [[download:doc/OpenVZ-Users-Guide.pdf|doc/OpenVZ-Users-Guide.pdf]] and browse this wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3890</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3890"/>
		<updated>2008-01-05T12:47:00Z</updated>

		<summary type="html">&lt;p&gt;Curx: update to actually state&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and VE templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] Stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for VEs private directories (by default /var/lib/vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-VE quota in this context includes not only pure per-VE quota, but also usual Linux disk quota used in VE, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for VEs, because the root user of VE will be able to overcome 5% disk space barrier in some situations. This way HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-VE disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-VE disk quota.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org  :&lt;br /&gt;
&lt;br /&gt;
 Ola Lundqvist &amp;lt;opal@debian.org&amp;gt; &amp;quot;OpenVZ Kernels only&amp;quot; --&amp;gt; apt-uri [http://download.openvz.org/debian http://download.openvz.org/debian] &lt;br /&gt;
&lt;br /&gt;
 Thorsten Schiffedecker &amp;lt;tsd@debian.systs.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian-systs http://download.openvz.org/debian-systs] (Mirror of OpenVZ Repository from http://debian.systs.org)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository at http://download.openvz.org/debian-systs, the actually OpenVZ Tools for Debian are exist only in unstable see http://packages.debian.org/vzctl  }}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# [sudo] echo &amp;quot;deb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-key add dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ Kernel (the debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from openvz.org'''&lt;br /&gt;
! kernel !! Description !! Hardware !! Debian Architektur&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian Kernel Config and OpenVZ Settings'''&lt;br /&gt;
! kernel !! Description !! Hardware !! Debian Architektur&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VE OS Templates ===&lt;br /&gt;
&lt;br /&gt;
To install a VE, you need VE OS Template(s), precreated can be found [http://download.openvz.org/contrib/template/precreated/ here] or create it : [http://wiki.openvz.org/Debian_template_creation Debian] , [http://wiki.openvz.org/Ubuntu_Gutsy_template_creation ubuntu] and all infos about [http://wiki.openvz.org/Category:Templates Templates]&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additial user tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
:&lt;br /&gt;
; [http://wiki.openvz.org/Backup_of_a_running_VE_with_vzdump vzdump]&lt;br /&gt;
:    A utility to backup and restore VE. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a Minimal VE OS Template create a first VE and &lt;br /&gt;
do some [[Basic operations in OpenVZ environment]] and read the [[download:doc/OpenVZ-Users-Guide.pdf|doc/OpenVZ-Users-Guide.pdf]] and browse this wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Download/live_CD&amp;diff=3859</id>
		<title>Download/live CD</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Download/live_CD&amp;diff=3859"/>
		<updated>2008-01-02T19:13:35Z</updated>

		<summary type="html">&lt;p&gt;Curx: fix links to livecd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you can find OpenVZ Live CD images. Live CD is a great way to test drive the OpenVZ technology without a need to actually install it on your machine.&lt;br /&gt;
&lt;br /&gt;
We offer two live CDs at the moment. The first one is based on Knoppix 5.1.1 and the second one is based on Centos 4.4. &lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
The precreated ISO images are available directly from [http://download.openvz.org/livecd/ download.openvz.org/livecd/] or any of the [[download mirrors]].&lt;br /&gt;
&lt;br /&gt;
=== CentOS ===&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=CentOS-4.4-OpenVZ-i386-LiveCD.iso|size=684 MB}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=CentOS-4.4-OpenVZ-i386-LiveCD.iso.md5|size=68 B}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=CentOS-4.4-OpenVZ-i386-LiveCD.iso.asc|size=}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
=== Knoppix ===&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=KNOPPIX_V5.1.1-OPENVZ-CD-2007-01-04-EN.iso|size=683 MB}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=KNOPPIX_V5.1.1-OPENVZ-CD-2007-01-04-EN.iso.md5|size=77 B}}&lt;br /&gt;
{{DownloadTableRow|path=livecd|file=KNOPPIX_V5.1.1-OPENVZ-CD-2007-01-04-EN.iso.asc|size=189 B}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
Note that .md5 and .asc files does not need to be copied to the CD-R; they are here to check the authenticity of the iso file. [[Package_signatures#Checking_files|This page]] has some info on this topic.&lt;br /&gt;
&lt;br /&gt;
== Burning ==&lt;br /&gt;
&lt;br /&gt;
After downloading the image, you have to burn it to the actual media, i.e. a CD-R or CD-RW disk. The process depends on the actual OS and CD burning software that you have, and the exact details are out of scope of this article.&lt;br /&gt;
&lt;br /&gt;
If you don't know how to burn the ISO image to CD-R, try [http://www.knoppix.net/wiki/Downloading_FAQ#Q:_I_have_downloaded_the_ISO_file._How_do_I_burn_the_ISO.3F_How_is_the_ISO_supposed_to_be_burned.3F this document].&lt;br /&gt;
&lt;br /&gt;
== Booting ==&lt;br /&gt;
Just insert the fresh CD into your CD-ROM and reboot. In some cases you have to modify your BIOS settings in order to enable booting from a CD.&lt;br /&gt;
If you use CentOS-based CD you'll be able to choose the kernel to boot: &amp;lt;tt&amp;gt;ovz9rh&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ovz18&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ovz18rh&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ovz20&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt; (original CentOS kernel).&lt;br /&gt;
&lt;br /&gt;
== Using ==&lt;br /&gt;
Upon the successful boot, a browser window with some helful hints will appear to help you start using OpenVZ. The latest version of that document is also available on this wiki: [[Getting started with OpenVZ live CD]].&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
Since this is a live CD, everything is created in RAM, i.e. is not persistent. If you will create a number of VEs, they will not be available after the reboot.&lt;br /&gt;
&lt;br /&gt;
A number of [[VE]]s that you can create using this live CD greatly depends on the amount of RAM your machine has, since the system uses RAM instead of a hard disk. On a 1 gigabyte RAM machine you can create about 5 VEs. To work around this, you have to have a disk partition mounted to &amp;lt;tt&amp;gt;/vz/private/&amp;lt;/tt&amp;gt;  for CentOS-based CD and to &amp;lt;tt&amp;gt;/var/lib/vz/private&amp;lt;/tt&amp;gt; for KNOPPIX-based CD.&lt;br /&gt;
&lt;br /&gt;
OpenVZ disk quota does not work on LiveCD at the moment due to {{Bug|558}}, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; in [[VE]] shows ludicrous values if quota is on.&lt;br /&gt;
Because of it on CentOS 4.4 LiveCD disk quota is switched off by default.&lt;br /&gt;
&lt;br /&gt;
Checkpointing (and consequently live migration) doesn't work on KNOPPIX LiveCD at the moment due to {{Bug|606}}.&lt;br /&gt;
You can work around it by mounting some filesystem (&amp;lt;tt&amp;gt;ext2&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ext3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt;) to &amp;lt;tt&amp;gt;/var/lib/vz/private&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
On CentOS-based LiveCD &amp;lt;tt&amp;gt;tmpfs&amp;lt;/tt&amp;gt; is mounted on this directory automatically during the booting.&lt;br /&gt;
&lt;br /&gt;
== CD contents ==&lt;br /&gt;
&lt;br /&gt;
=== CentOS CD contents ===&lt;br /&gt;
This CD is based on CentOS 4.4 Live CD and contains the following OpenVZ packages:&lt;br /&gt;
* '''kernels''':&lt;br /&gt;
** original CentOS 4.4 kernel without virtualization (2.6.9-42.livecd.c4)&lt;br /&gt;
** 2.6.9-023stab044.4&lt;br /&gt;
** 2.6.18-028stab035&lt;br /&gt;
** 2.6.18-028stab035-rhel5&lt;br /&gt;
** 2.6.20-ovz007.1&lt;br /&gt;
* '''tools''':&lt;br /&gt;
** vzctl 3.0.18&lt;br /&gt;
** vzquota 3.0.9&lt;br /&gt;
* '''template tools''':&lt;br /&gt;
** vzyum-2.4.0-11&lt;br /&gt;
** vzrpm44-4.4.1-22.5&lt;br /&gt;
** vzrpm43-4.3.3-7&lt;br /&gt;
** vzpkg-2.7.0-18&lt;br /&gt;
* '''template metadatas''':&lt;br /&gt;
** vztmpl-centos-4-2.0-2&lt;br /&gt;
** vztmpl-fedora-core-3-2.0-2&lt;br /&gt;
** vztmpl-fedora-core-4-2.0-2&lt;br /&gt;
** vztmpl-fedora-core-5-2.0-2&lt;br /&gt;
* '''precreated templates''':&lt;br /&gt;
** centos-4-i386-minimal&lt;br /&gt;
** fedora-core-5-i386-minimal&lt;br /&gt;
** debian-3.1-i386-minimal&lt;br /&gt;
&lt;br /&gt;
The number of original CentOS packages were removed (&amp;lt;tt&amp;gt;openoffice&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gimp&amp;lt;/tt&amp;gt;, etc.) in order&lt;br /&gt;
to free disk space for OpenVZ packages and templates.&lt;br /&gt;
&lt;br /&gt;
=== Knoppix CD contents ===&lt;br /&gt;
This CD contains the following OpenVZ packages:&lt;br /&gt;
* kernel 2.6.18-028stab027&lt;br /&gt;
* vzctl 3.0.16&lt;br /&gt;
* vzquota 3.0.9&lt;br /&gt;
plus the number of precreated templates:&lt;br /&gt;
* Debian 3.1 minimal&lt;br /&gt;
* CentOS 4 minimal&lt;br /&gt;
* Fedora Core 5 minimal&lt;br /&gt;
&lt;br /&gt;
It also contains all the software from the original Knoppix 5.1.1 CD, excluding:&lt;br /&gt;
* OpenOffice&lt;br /&gt;
* GIMP&lt;br /&gt;
* Frozen Bubble&lt;br /&gt;
The above packages were taken out to make some room for OpenVZ packages.&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* 7 May 2007, initial version based on Knoppix 5.1.1&lt;br /&gt;
* 5 July 2007, version based on Centos 4.4&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://knoppix.com/ knoppix.com], the home of Knoppix distribution&lt;br /&gt;
* [http://centos.org/ centos.org], the home of CentOS distribution&lt;br /&gt;
&lt;br /&gt;
[[Category: Download]]&lt;br /&gt;
[[Category: Live CD]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3792</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3792"/>
		<updated>2007-12-22T10:11:26Z</updated>

		<summary type="html">&lt;p&gt;Curx: add note removing module-init-tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problem I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
{{Note|On removing the deb-package &amp;quot;module-init-tools&amp;quot;, a fake-modprobe is needed for IPv6 adresses, see below!}}&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;fake-modprobe&amp;quot; needed for IPv6 adresses ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# ln -s /bin/true /sbin/modprobe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;On setup IPv6, the command &amp;quot;modprobe -Q IPv6&amp;quot; is called, which fails without the &amp;quot;fake-modprobe&amp;quot;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3791</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3791"/>
		<updated>2007-12-22T10:10:17Z</updated>

		<summary type="html">&lt;p&gt;Curx: add note removing module-init-tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problem I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|on removing the imodule-init-tools, a fake-modprobe is needed for IPv6 adresses}}&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;fake-modprobe&amp;quot; needed for IPv6 adresses ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# ln -s /bin/true /sbin/modprobe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;On setup IPv6, the command &amp;quot;modprobe -Q IPv6&amp;quot; is called, which fails without the &amp;quot;fake-modprobe&amp;quot;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3790</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3790"/>
		<updated>2007-12-22T10:05:47Z</updated>

		<summary type="html">&lt;p&gt;Curx: typo removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problem I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;fake-modprobe&amp;quot; needed for IPv6 adresses ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# ln -s /bin/true /sbin/modprobe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;On setup IPv6, the command &amp;quot;modprobe -Q IPv6&amp;quot; is called, which fails without the &amp;quot;fake-modprobe&amp;quot;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3789</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3789"/>
		<updated>2007-12-22T10:04:46Z</updated>

		<summary type="html">&lt;p&gt;Curx: add fake-modprobe, needed for IPv6 adresses in VE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problem I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;fake-modprobe&amp;quot; needed for IPv6 a====&lt;br /&gt;
&lt;br /&gt;
 [VE]# ln -s /bin/true /sbin/modprobe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;On setup IPv6, the command &amp;quot;modprobe -Q IPv6&amp;quot; is called, which fails without the &amp;quot;fake-modprobe&amp;quot;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Package_managers&amp;diff=3769</id>
		<title>Package managers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Package_managers&amp;diff=3769"/>
		<updated>2007-12-16T15:08:08Z</updated>

		<summary type="html">&lt;p&gt;Curx: add : see changelog in Deb packages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With OpenVZ, you can run many different Linux distributions on a single box. One particular thing in which distributions differ is package management. This article summarizes how to perform various common package management tasks on a different distributions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | Action&lt;br /&gt;
! RPM&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;RHEL, Fedora, CentOS, Mandrake, SUSE, ...&amp;lt;/small&amp;gt;&lt;br /&gt;
! DEB&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;Debian, Ubuntu&amp;lt;/small&amp;gt;&lt;br /&gt;
! Ebuild&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;Gentoo, Sabayon&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Basic queries'''&lt;br /&gt;
|-&lt;br /&gt;
! List of all installed packages&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qa&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -l&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery list&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! List of installing packages matching ''substr''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qa ''\*substr\*''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -l ''\*substr\*''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery list ''substr''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Basic information about an installed ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qi ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -p ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! List of files in a given ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -ql ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -L ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery files ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Advanced queries'''&lt;br /&gt;
|-&lt;br /&gt;
! Which package a ''file'' belongs to?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qf ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -S ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery belongs ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Check the hash (i.e. MD5 etc.) sums of an installed package&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -V ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;debsums -ca ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery check ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Show pre/post install/uninstall scripts from a ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --scripts ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;less /var/lib/dpkg/info/''package''.{pre,post,config}*&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Show change log for a ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --changelog ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;zcat /usr/share/doc/package/changelog.Debian.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Local package installation/upgrade/removal'''&lt;br /&gt;
|-&lt;br /&gt;
! Install a package from local ''package_file''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -ihv ''package_file*.rpm''&amp;lt;br/&amp;gt;yum localinstall ''package_file*.rpm''&amp;lt;ref name=&amp;quot;localinstall&amp;quot;&amp;gt;In case there are unsatisfied dependencies for ''package_file'', yum will try to get and install it from known repositores.&amp;lt;/ref&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -i ''package_file*.deb'' &amp;lt;ref name=&amp;quot;apt&amp;quot;&amp;gt;Usually it is not necessary to download packages manually and install them. Use apt-cache search ''name'' to search for package in configured repositories and apt-get install ''package'' to install package and all it's dependencies&amp;lt;/ref&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Upgrade a package from local ''package_file''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -Uhv ''package_file*.rpm''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -i ''package_file*.deb'' &amp;lt;ref name=&amp;quot;apt&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Remove an installed ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -e ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -r ''package''&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dpkg -P ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;emerge --unmerge ''package''&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;emerge --prune ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Package installation from repositories'''&lt;br /&gt;
|-&lt;br /&gt;
! Install a ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;yum install ''package''&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;urpmi ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;apt-get install ''package''&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;aptitude install ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;emerge -av ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Only download a ''package'' from repository, do not install&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;apt-get install --download-only --reinstall ''package''&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;dpkgdir&amp;quot;&amp;gt;Package will reside in /var/cache/apt/archives.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;emerge -avf ''package''&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;distfiles&amp;quot;&amp;gt;Package sources will reside in /usr/portage/distfiles.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Get information about package interdependencies'''&lt;br /&gt;
|-&lt;br /&gt;
! What a given ''package'' provides?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --provides ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg-query -W -f='${Provides}\n' ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! What a given ''package'' requires?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --requires ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg-query -W -f='${Depends}\n' ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Which installed package(s) provide a given ''dependency''&amp;lt;ref name=&amp;quot;dep&amp;quot;&amp;gt;In rpm world, a ''dependency'' can be a package name, a file, or a special atom like &amp;lt;code&amp;gt;perl(IO::Zlib)&amp;lt;/code&amp;gt; for a perl module. In deb world, this can be either real or virtual package name.&amp;lt;/ref&amp;gt;?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --whatprovides ''dependency''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Which installed package(s) require a given ''dependency''&amp;lt;ref name=&amp;quot;dep&amp;quot;/&amp;gt;?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --whatrequires ''dependency''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Working with package files'''&lt;br /&gt;
|-&lt;br /&gt;
! Unpack a package ''file'' to local directory&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm2cpio ''file.rpm'' | cpio -id&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -x ''file.deb'' .&amp;lt;/code&amp;gt;&lt;br /&gt;
|| N/A&lt;br /&gt;
|-&lt;br /&gt;
! Check package file integrity (checksums, signatures...)&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -K ''file.rpm''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| -???-&lt;br /&gt;
|| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]&lt;br /&gt;
[[Category: Debian]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
[[Category: Gentoo]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3768</id>
		<title>User:Curx</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3768"/>
		<updated>2007-12-16T14:55:51Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;curx&amp;quot; aka Thorsten Schifferdecker&lt;br /&gt;
&lt;br /&gt;
--//--&lt;br /&gt;
&lt;br /&gt;
OpenVZ consists of a kernel, user-level tools, and VE templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] and related Distribution like [http://www.ubuntu.com/ Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for VEs private directories (by default /var/lib/vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-VE quota in this context includes not only pure per-VE quota, but also usual Linux disk quota used in VE, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for VEs, because the root user of VE will be able to overcome 5% disk space barrier in some situations. This way HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-VE disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-VE disk quota.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org  :&lt;br /&gt;
&lt;br /&gt;
 Ola Lundqvist &amp;lt;opal@debian.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian http://download.openvz.org/debian]&lt;br /&gt;
&lt;br /&gt;
 Thorsten Schiffedecker &amp;lt;tsd@debian.systs.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian-systs http://download.openvz.org/debian-systs] (Mirror of OpenVZ Repository from http://debian.systs.org)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository http://download.openvz.org/debian-systs}}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# [sudo] echo &amp;quot;deb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-key add dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[kernel build debian]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what “flavor” of the kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;flavour&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VE OS Templates ===&lt;br /&gt;
&lt;br /&gt;
To install a VE, you need VE OS Template(s), precreated can be found [http://download.openvz.org/contrib/template/precreated/ here] or create it : [http://wiki.openvz.org/Debian_template_creation Debian] , [http://wiki.openvz.org/Ubuntu_Gutsy_template_creation ubuntu] and all about [http://wiki.openvz.org/Category:Templates Templates]&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Debian Packages of a precreate Debian 4.0 can be fetch from Repository at http://download.openvz.org/debian-systs }}&lt;br /&gt;
  &lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additial user tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
; [http://wiki.openvz.org/Backup_of_a_running_VE_with_vzdump vzdump]&lt;br /&gt;
:    A utility to backup and restore VE. &lt;br /&gt;
&lt;br /&gt;
{{Note|Debian Packages can be fetch from Repository at http://download.openvz.org/debian-systs }}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3767</id>
		<title>User:Curx</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Curx&amp;diff=3767"/>
		<updated>2007-12-16T14:54:40Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;curx&amp;quot; aka Thorsten Schifferdecker&lt;br /&gt;
&lt;br /&gt;
--//--&lt;br /&gt;
&lt;br /&gt;
OpenVZ consists of a kernel, user-level tools, and VE templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] and related Distribution like [http://www.ubuntu.com/ Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for VEs private directories (by default /var/lib/vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-VE quota in this context includes not only pure per-VE quota, but also usual Linux disk quota used in VE, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for VEs, because the root user of VE will be able to overcome 5% disk space barrier in some situations. This way HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-VE disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-VE disk quota.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org  :&lt;br /&gt;
&lt;br /&gt;
 Ola Lundqvist &amp;lt;opal@debian.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian http://download.openvz.org/debian]&lt;br /&gt;
&lt;br /&gt;
 Thorsten Schiffedecker &amp;lt;tsd@debian.systs.org&amp;gt; --&amp;gt; apt-uri [http://download.openvz.org/debian-systs http://download.openvz.org/debian-systs] (Mirror of OpenVZ Repository from http://debian.systs.org)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository http://download.openvz.org/debian-systs}}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# [sudo] echo &amp;quot;deb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-key add dso_archiv_signing_key.asc&lt;br /&gt;
# [sudo] apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[kernel build debian]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what “flavor” of the kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;flavour&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VE OS Templates ===&lt;br /&gt;
&lt;br /&gt;
To install a VE, you need VE OS Template(s), precreated can be found at [http://download.openvz.org/contrib/template/precreated/ here] or create it : [http://wiki.openvz.org/Debian_template_creation Debian] , [http://wiki.openvz.org/Ubuntu_Gutsy_template_creation ubuntu] and all about [http://wiki.openvz.org/Category:Templates Templates]&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Debian Packages of a precreate Debian 4.0 can be fetch from Repository at http://download.openvz.org/debian-systs }}&lt;br /&gt;
  &lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additial user tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
; [http://wiki.openvz.org/Backup_of_a_running_VE_with_vzdump vzdump]&lt;br /&gt;
:    A utility to backup and restore VE. &lt;br /&gt;
&lt;br /&gt;
{{Note|Debian Packages can be fetch from Repository at http://download.openvz.org/debian-systs }}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3600</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3600"/>
		<updated>2007-11-14T21:15:34Z</updated>

		<summary type="html">&lt;p&gt;Curx: update dso kernel packages to 048.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some tasks are even completed during the install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/debian sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are using GRUB, maybe you need to update the /boot/grub/menu.lst file&lt;br /&gt;
(can be configured at /etc/kernel-img.conf):&lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Sarge OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VEs with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository. The packages are 'vzctl' and 'vzquota'.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
A Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
List downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose a linux image (version 028stab048.1) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
==== Installing sources ====&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
==== Unpacking ====&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Kernel config ====&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
 # cp /boot/config-2.6.18-5-686 .config&lt;br /&gt;
&lt;br /&gt;
'''Or''' get a 2.6.18 kernel configuration from  http://download.openvz.org/kernel/branches/2.6.18/current/configs/ (depending on your architecture; the below example is for i686):&lt;br /&gt;
 # wget http://download.openvz.org/kernel/branches/2.6.18/current/configs/kernel-2.6.18-i686.config.ovz -O .config&lt;br /&gt;
&lt;br /&gt;
==== Patching and configuring ====&lt;br /&gt;
&lt;br /&gt;
Now you can apply the openvz kernel patch and modify your kernel-config:&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&lt;br /&gt;
You need the following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [M] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [M] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
be built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)}}&lt;br /&gt;
&lt;br /&gt;
See also : &amp;quot;make-kpkg --targets&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Compiling ====&lt;br /&gt;
&lt;br /&gt;
Compile your kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 or all above with one step &lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&lt;br /&gt;
==== Installing ====&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&lt;br /&gt;
{{Note|update-initramfs is done, when make-kpkg is use with --initrd option}}&lt;br /&gt;
&lt;br /&gt;
{{Note|update-grub can be configured by /etc/kernel-img.conf}}&lt;br /&gt;
&lt;br /&gt;
==== Bootloader ====&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (if not done before)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
{{Note|since the Debian Etch release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub}}&lt;br /&gt;
&lt;br /&gt;
== Install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for managing OpenVZ Virtual Environments (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Package_managers&amp;diff=3599</id>
		<title>Package managers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Package_managers&amp;diff=3599"/>
		<updated>2007-11-14T21:08:09Z</updated>

		<summary type="html">&lt;p&gt;Curx: add debian cmds for dependence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With OpenVZ, you can run many different Linux distributions on a single box. One particular thing in which distributions differ is package management. This article summarizes how to perform various common package management tasks on a different distributions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | Action&lt;br /&gt;
! RPM&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;RHEL, Fedora, CentOS, Mandrake, ...&amp;lt;/small&amp;gt;&lt;br /&gt;
! DEB&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;Debian, Ubuntu&amp;lt;/small&amp;gt;&lt;br /&gt;
! Ebuild&amp;lt;br/&amp;gt;&amp;lt;small&amp;gt;Gentoo, Sabayon&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Basic queries'''&lt;br /&gt;
|-&lt;br /&gt;
! List of all installed packages&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qa&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -l&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery list&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! List of installing packages matching ''substr''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qa ''\*substr\*''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -l ''\*substr\*''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery list ''substr''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Basic information about an installed ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qi ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -p ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! List of files in a given ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -ql ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -L ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery files ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Which package a ''file'' belongs to?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -qf ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -S ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;equery belongs ''file''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Local package installation/upgrade/removal'''&lt;br /&gt;
|-&lt;br /&gt;
! Install a package from local ''package_file''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -ihv ''package_file*.rpm''&amp;lt;br/&amp;gt;yum localinstall ''package_file*.rpm''&amp;lt;ref name=&amp;quot;localinstall&amp;quot;&amp;gt;In case there are unsatisfied dependencies for ''package_file'', yum will try to get and install it from known repositores.&amp;lt;/ref&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -i ''package_file*.deb'' &amp;lt;ref name=&amp;quot;apt&amp;quot;&amp;gt;Usually it is not necessary to download packages manually and install them. Use apt-cache search ''name'' to search for package in configured repositories and apt-get install ''package'' to install package and all it's dependencies&amp;lt;/ref&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Upgrade a package from local ''package_file''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -Uhv ''package_file*.rpm''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -i ''package_file*.deb'' &amp;lt;ref name=&amp;quot;apt&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Remove an installed ''package''&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -e ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg -r ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;emerge --unmerge ''package''&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;emerge --prune ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | '''Get information about package interdependencies'''&lt;br /&gt;
|-&lt;br /&gt;
! What a given ''package'' provides?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --provides ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg-query -W -f='${Provides}\n' ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! What a given ''package'' requires?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --provides ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;dpkg-query -W -f='${Depends}\n' ''package''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! What package(s) provide a given ''dependency''&amp;lt;ref name=&amp;quot;dep&amp;quot;&amp;gt;In rpm world, a ''dependency'' can be a package name, a file, or a special atom like &amp;lt;code&amp;gt;perl(IO::Zlib)&amp;lt;/code&amp;gt; for a perl module. In deb world, this can be either real or virtual package name.&amp;lt;/ref&amp;gt;?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --whatprovides ''dependency''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! What package(s) require a given ''dependency''&amp;lt;ref name=&amp;quot;dep&amp;quot;/&amp;gt;?&lt;br /&gt;
|| &amp;lt;code&amp;gt;rpm -q --whatrequires ''dependency''&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|| &amp;lt;code&amp;gt;-???-&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3598</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3598"/>
		<updated>2007-11-14T20:49:28Z</updated>

		<summary type="html">&lt;p&gt;Curx: upgrade to an easier install process with chroot&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create some directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 # debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, than you can skip the arch option, but if you need to build a VZ OS Template with another ARCH arch can be:&lt;br /&gt;
&lt;br /&gt;
Substitute your architecture instead of ''ARCH'':&lt;br /&gt;
&lt;br /&gt;
 AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
 ia64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
 i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== chrooting ===&lt;br /&gt;
&lt;br /&gt;
Without createing a running VE for building a VE OS Template it's another way : chroot&lt;br /&gt;
&lt;br /&gt;
 [VE0]# cd gutsy-chroot; chroot ./&lt;br /&gt;
&lt;br /&gt;
 [VE]# mount -t proc none /proc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Remove unneeded packages ===&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
=== Disable getty ===&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have.&lt;br /&gt;
&lt;br /&gt;
There are two ways to disable it:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
===  Set sane permissions for /root directory ===&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
=== Disable root login ===&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
=== Get new security updates ===&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install some more packages ===&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
=== Fix SSH host keys ===&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ===&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
=== Get rid of tmpfs mounts ===&lt;br /&gt;
&lt;br /&gt;
 [VE]# sed -ie '/tmpfs/d' /etc/init.d/mountkernfs.sh&lt;br /&gt;
&lt;br /&gt;
=== Disable some services ===&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
=== Clean packages ===&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
Set propper hostname and file /etc/hosts&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Maybe clean up logfile, root history etc.&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# umount /proc&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Build precreated VZ OS Template ==&lt;br /&gt;
 &lt;br /&gt;
 [VE0]# tar -xzf /var/lib/vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz ./&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update a VE OS Template ==&lt;br /&gt;
 &lt;br /&gt;
 Chroot to your debstrapped system&lt;br /&gt;
 [VE0]# cd &amp;lt;dir&amp;gt;; chroot ./&lt;br /&gt;
&lt;br /&gt;
 Update and Install updates&lt;br /&gt;
 [VE] # apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
 Cleanup&lt;br /&gt;
 [VE] # apt-get clean&lt;br /&gt;
&lt;br /&gt;
 Clean unused log files, .bash_history etc.&lt;br /&gt;
 [VE] # exit&lt;br /&gt;
 &lt;br /&gt;
 Build your updated VE OS Template&lt;br /&gt;
 [VE0]# tar -xzf /var/lib/vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz ./&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3597</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3597"/>
		<updated>2007-11-14T19:53:28Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Clean packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create some directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 # debootstrap --arch ''ARCH'' gutsy gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Substitute your architecture instead of ''ARCH''. For example, for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt; or for ia64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;. For i386 you do not have to give this option.&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by debootstrap, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /vz/private/777&lt;br /&gt;
 # mv gutsy-chroot/ /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;tt&amp;gt;OSTEMPLATE&amp;lt;/tt&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have.&lt;br /&gt;
&lt;br /&gt;
There are two ways to disable it:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
==== Get rid of tmpfs mounts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# sed -ie '/tmpfs/d' /etc/init.d/mountkernfs.sh&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set propper hostname and file /etc/hosts&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Maybe clean up logfile, root history etc.&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;To be continued&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3596</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3596"/>
		<updated>2007-11-14T19:52:54Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Clean packages */ add hostname settings and resolv.conf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create some directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 # debootstrap --arch ''ARCH'' gutsy gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Substitute your architecture instead of ''ARCH''. For example, for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt; or for ia64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;. For i386 you do not have to give this option.&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by debootstrap, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /vz/private/777&lt;br /&gt;
 # mv gutsy-chroot/ /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;tt&amp;gt;OSTEMPLATE&amp;lt;/tt&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have.&lt;br /&gt;
&lt;br /&gt;
There are two ways to disable it:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
==== Get rid of tmpfs mounts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# sed -ie '/tmpfs/d' /etc/init.d/mountkernfs.sh&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
Set propper hostname and file /etc/hosts&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Maybe clean up logfile, root history etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;To be continued&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3595</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3595"/>
		<updated>2007-11-14T19:48:48Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Remove unneeded packages */ add ntpdate for purging&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create some directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 # debootstrap --arch ''ARCH'' gutsy gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Substitute your architecture instead of ''ARCH''. For example, for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt; or for ia64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;. For i386 you do not have to give this option.&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by debootstrap, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /vz/private/777&lt;br /&gt;
 # mv gutsy-chroot/ /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;tt&amp;gt;OSTEMPLATE&amp;lt;/tt&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have.&lt;br /&gt;
&lt;br /&gt;
There are two ways to disable it:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
==== Get rid of tmpfs mounts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# sed -ie '/tmpfs/d' /etc/init.d/mountkernfs.sh&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;To be continued&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3468</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3468"/>
		<updated>2007-09-27T17:52:59Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some tasks are even completed during the install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/debian sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are using GRUB, maybe you need to update the /boot/grub/menu.lst file&lt;br /&gt;
(can be configured at /etc/kernel-img.conf):&lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Sarge OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VEs with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository. The packages are 'vzctl' and 'vzquota'.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
A Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
List downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose a linux image (version 028stab039.1) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-5-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply the openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need the following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [M] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
be built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
See also : &amp;quot;make-kpkg --targets&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
== Install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for managing OpenVZ Virtual Environments (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Monitoring_openvz_resources_using_nagios_and_snmp&amp;diff=3467</id>
		<title>Talk:Monitoring openvz resources using nagios and snmp</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Monitoring_openvz_resources_using_nagios_and_snmp&amp;diff=3467"/>
		<updated>2007-09-27T17:51:25Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Very cool, thanks for the nagios plugin!&lt;br /&gt;
&lt;br /&gt;
-mike&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is there a nagios script to do the same monitoring without snmp? Seems like an unnecessary additional service to me.&lt;br /&gt;
&lt;br /&gt;
-- &lt;br /&gt;
degradas&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the relevant snmp entries, and use the script with nagios-nrpe or with the nagios ssh plugin ...&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
Thorsten &amp;quot;curx&amp;quot; Schifferdecker&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Monitoring_openvz_resources_using_nagios_and_snmp&amp;diff=3466</id>
		<title>Talk:Monitoring openvz resources using nagios and snmp</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Monitoring_openvz_resources_using_nagios_and_snmp&amp;diff=3466"/>
		<updated>2007-09-27T17:50:58Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Very cool, thanks for the nagios plugin!&lt;br /&gt;
&lt;br /&gt;
-mike&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is there a nagios script to do the same monitoring without snmp? Seems like an unnecessary additional service to me.&lt;br /&gt;
&lt;br /&gt;
-- &lt;br /&gt;
degradas&lt;br /&gt;
&lt;br /&gt;
Remove the relevant snmp entries, and use the script with nagios-nrpe or with the nagios ssh plugin ...&lt;br /&gt;
--&lt;br /&gt;
Thorsten &amp;quot;curx&amp;quot; Schifferdecker&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3192</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3192"/>
		<updated>2007-06-14T13:35:30Z</updated>

		<summary type="html">&lt;p&gt;Curx: update version dso linux-image to 028stab035.1 and remove double entry about self compiling a kernel (debian way)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some tasks are even completed during the install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
a Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
list downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab035.1) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-4-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [M] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3152</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3152"/>
		<updated>2007-05-31T14:20:44Z</updated>

		<summary type="html">&lt;p&gt;Curx: update dso kernel images to 028stab033.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
a Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
list downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== using the OpenVZ kernel-patch from Debian ===&lt;br /&gt;
&lt;br /&gt;
install the kernel-patch, kernel-source and the vz-tools:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install linux-source kernel-patch-openvz vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
unpack the kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the config of you &amp;quot;normal&amp;quot; kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
 # cp /boot/config&lt;br /&gt;
 # cp /boot/config-2.6.18-4-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
build the kernel packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version -1-openvz --added_patches=openvz --revision=1 buildpackage --initrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install the packages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i *.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can reboot into the new kernel, ejoy.&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab033.1):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [M] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=3147</id>
		<title>Talk:Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=3147"/>
		<updated>2007-05-30T01:35:34Z</updated>

		<summary type="html">&lt;p&gt;Curx: network/interface settings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;info about needed modules in kernel-config&lt;br /&gt;
&lt;br /&gt;
info about &amp;quot;Yet Another mkInitRD&amp;quot; yaid tools creating initrd-files&lt;br /&gt;
&lt;br /&gt;
== ip_forward setup ==&lt;br /&gt;
&lt;br /&gt;
 If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
 Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network option.&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
: /etc/network/options is deprecated. ip_forward may be enabled in /etc/sysctl.conf by adding the line &amp;quot;net.ipv4.ip_forward=1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Debian Etch has been released ==&lt;br /&gt;
&lt;br /&gt;
Sarge is no longer stable and has been replaced by Etch.  This document needs to be updated for Etch&lt;br /&gt;
&lt;br /&gt;
* References to Sarge need to be updated to use Etch instead.&lt;br /&gt;
* Lenny is the new Debian testing.  If you wish to continue to have a testing section listed, update it for Lenny.  Otherwise remove the testing section.&lt;br /&gt;
* Use the official Debian mirrors to get the OpenVZ packages.&lt;br /&gt;
&lt;br /&gt;
--[[User:Dusty|Dusty]] 19:26, 9 April 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Interface settings still give me an error. ==&lt;br /&gt;
&lt;br /&gt;
I did an update on:&lt;br /&gt;
&lt;br /&gt;
 [...]&lt;br /&gt;
 # device: %DEV%&lt;br /&gt;
 iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
 &lt;br /&gt;
        '''up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100'''&lt;br /&gt;
        '''pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0'''&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
since the debian docs (/usr/share/doc/vzctl/README.Debian) told me this were the right values, but now I get on starting/stopping a VE:&lt;br /&gt;
 vps-net_del WARNING: Function proxy_arp for eth0 is set to 0. Enable with 'sysctl -w net.ipv4.conf.eth0.proxy_arp=1'. See /usr/share/doc/vzctl/README.Debian.&lt;br /&gt;
&lt;br /&gt;
The previous settings (see history) also gave me errors:&lt;br /&gt;
 [...]&lt;br /&gt;
 # device: %DEV%&lt;br /&gt;
 iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
 &lt;br /&gt;
        '''up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0'''&lt;br /&gt;
        '''pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1'''&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Anybody got a clue what the right values are?&lt;br /&gt;
&lt;br /&gt;
--[[User:Vipz|Vipz]] 16:27, 29 May 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See http://wiki.openvz.org/w/index.php?title=Installation_on_Debian&amp;amp;oldid=2629, forum entry http://forum.openvz.org/index.php?t=msg&amp;amp;goto=10089 and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=387762&lt;br /&gt;
&lt;br /&gt;
@vips: btw why have you change the settings to the buggy version of /usr/share/doc/vzctl/README.debian ?&lt;br /&gt;
&lt;br /&gt;
So try a up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1, not 100!&lt;br /&gt;
&lt;br /&gt;
--[[User:Curx|Curx]] 21:35, 29 May 2007 (EDT)&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3088</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3088"/>
		<updated>2007-05-10T05:48:05Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* precompiled kernel images at debian.systs.org */ update 028stab031.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
a Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
list downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab031.1):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3087</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3087"/>
		<updated>2007-05-10T05:31:27Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* precompiled kernel images at download.openvz.org */ a debian repro is online, add info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
a Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
list downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab023.1):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3064</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3064"/>
		<updated>2007-05-04T15:12:13Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* precompiled kernel images at debian.systs.org (dso) */ update, debian 4.0 is stable, 3.1 moved to dso-archive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab023.1):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2949</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2949"/>
		<updated>2007-04-03T21:08:13Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* precompiled kernel images at debian.systs.org */ add info for apt-key&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (Stable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18&lt;br /&gt;
 ovzkernel-2.6.18-enterprise&lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Testing) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch (a.k.a. &amp;quot;testing&amp;quot;) repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image (version 028stab023.1):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== modify needed settings ==&lt;br /&gt;
&lt;br /&gt;
a Debian Way: &lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding. Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2948</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2948"/>
		<updated>2007-04-03T18:59:57Z</updated>

		<summary type="html">&lt;p&gt;Curx: add info for etch dso kernel images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (Stable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18&lt;br /&gt;
 ovzkernel-2.6.18-enterprise&lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update your &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Testing) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch (a.k.a. &amp;quot;testing&amp;quot;) repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
linux-image: OpenVZ version: 028stab023.1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== modify needed settings ==&lt;br /&gt;
&lt;br /&gt;
a Debian Way: &lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding. Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Backup_of_a_running_container_with_vzdump&amp;diff=2870</id>
		<title>Backup of a running container with vzdump</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Backup_of_a_running_container_with_vzdump&amp;diff=2870"/>
		<updated>2007-03-24T12:30:05Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Download */ correct rpm and deb downloads&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Vzdump =&lt;br /&gt;
Vzdump is an utility to make consistent snapshots of running OpenVZ VEs. It basically creates a tar archive of the VE private area, which also includes the VE configuration files.&lt;br /&gt;
&lt;br /&gt;
There are several ways to provide consistency:&lt;br /&gt;
&lt;br /&gt;
- Stop the VE during backup (very long downtime)&lt;br /&gt;
&lt;br /&gt;
- Use rsync and suspend/resume (minimal downtime)&lt;br /&gt;
&lt;br /&gt;
- Use LVM2 (no downtime)&lt;br /&gt;
&lt;br /&gt;
Vzdump stores the backup on the disk in a single file. This file should go to a tape backup for archiving.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download vzdump rpm or deb packages from http://download.openvz.org/contrib/utils/vzdump/&lt;br /&gt;
&lt;br /&gt;
For rpm based systems:&lt;br /&gt;
&amp;lt;pre&amp;gt;wget http://download.openvz.org/contrib/utils/vzdump/vzdump-0.3-1.noarch.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Debian based systems:&lt;br /&gt;
&amp;lt;pre&amp;gt;wget http://download.openvz.org/contrib/utils/vzdump/vzdump_0.3-1_all.deb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
For rpm based systems:&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -i vzdump-0.3-1.noarch.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Debian based systems:&lt;br /&gt;
&amp;lt;pre&amp;gt;dpkg -i vzdump_0.3-1_all.deb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump OPTIONS [--all â &amp;lt;VEID&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
       --compress              compress dump file (gzip)&lt;br /&gt;
&lt;br /&gt;
       --dumpdir DIR           store resulting files in DIR&lt;br /&gt;
&lt;br /&gt;
       --xdelta                create a differential backup using xdelta&lt;br /&gt;
&lt;br /&gt;
       --mailto EMAIL          send notification mail to EMAIL&lt;br /&gt;
&lt;br /&gt;
       --stop                  stop/start VPS if running&lt;br /&gt;
&lt;br /&gt;
       --suspend               suspend/resume VPS when running&lt;br /&gt;
&lt;br /&gt;
       --snapshot              use LVM snapshot when running&lt;br /&gt;
&lt;br /&gt;
       --restore FILENAME      restore FILENAME&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
== Backup == &lt;br /&gt;
&lt;br /&gt;
Simply dump VE 777 - no snapshot, just archive the VE private area and configuration files to the default dump directory (usually /vz/dump/).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump 777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use rsync and suspend/resume to create a snapshot (minimal downtime).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump --suspend 777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup all VEs and send notification mails to root.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump --suspend --all --mailto root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use LVM2 to create snapshots (no downtime).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump --dumpdir /space/backup --snapshot 777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Restore == &lt;br /&gt;
&lt;br /&gt;
Restore above backup to VE 600&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzdump --restore /space/backup/vzdump-777.tar 600&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Archlinux_Template_creation&amp;diff=2847</id>
		<title>Archlinux Template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Archlinux_Template_creation&amp;diff=2847"/>
		<updated>2007-03-14T18:26:54Z</updated>

		<summary type="html">&lt;p&gt;Curx: inital release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Instructions manually create a minimal Archlinux (0.8) &amp;quot;Voodoo&amp;quot; OS Template.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
I used a modified archbootstrap script which can be found at http://forzza.systs.org/openvz-misc/&lt;br /&gt;
&lt;br /&gt;
Edit settings of script &amp;quot;archbootstrap&amp;quot; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=&amp;quot;i686&amp;quot;&lt;br /&gt;
IGNORE=&amp;quot;rp-pppoe ppp wireless_tools xfsdump xfsprogs reiserfsprogs lshwd usbutils pciutils pcmciautils module-init-tools mdadm mkinitcpio libusb jfsutils lvm2 lilo cryptsetup device-mapper dhcpcd hwdetect dmapi gen-init-cpio grub&amp;quot;&lt;br /&gt;
&lt;br /&gt;
umark PACMAN_OPTS (remove '#')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|I suggest to place the build for OpenVZ templates to /vz/template/, schema: /vz/template/$DIST/$VERSION/$ARCH/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Built this OS-Template with:&lt;br /&gt;
&lt;br /&gt;
VE0_dist        Debian&lt;br /&gt;
VE0_ARCH	i386&lt;br /&gt;
&lt;br /&gt;
DIST		arch&lt;br /&gt;
VERSION		0.8&lt;br /&gt;
ARCH		depends on VE0 settings above&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bootstrapping Archlinux ==&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
VE0_# /usr/bin/archbootstrap /vz/template/$DIST/$VERSION/$ARCH/ [MIRROR]&lt;br /&gt;
&lt;br /&gt;
{{Note|Please use mirrors ! A full list of Archlinux mirrors : http://wiki.archlinux.org/index.php/Mirror}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enter the Build with chroot ==&lt;br /&gt;
&lt;br /&gt;
All the commands below are executed from the root shell. I this howto &amp;quot;chroot&amp;quot; is used to enter as NEWROOT, a BUILD-VE must not be created!&lt;br /&gt;
&lt;br /&gt;
VE0_# chroot /vz/template/$DIST/$VERSION/$ARCH/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== setting DNS server ===&lt;br /&gt;
&lt;br /&gt;
For the chroot BUILD we also need to specify a DNS for it:&lt;br /&gt;
&lt;br /&gt;
BUILD_# mv /etc/resolv.conf.pacorig /etc/resolv.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=== update and install packages ===&lt;br /&gt;
&lt;br /&gt;
Update (sync) pacman cache and update installed packages&lt;br /&gt;
&lt;br /&gt;
BUILD_# pacman -Syu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install openssh (client and server) , quota-tools and iproute&lt;br /&gt;
&lt;br /&gt;
BUILD_# pacman -S openssh quota-tools iproute&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== fix /etc/mtab ===&lt;br /&gt;
&lt;br /&gt;
Add symlink /proc/mount /etc/mtab&lt;br /&gt;
&lt;br /&gt;
BUILD_# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== fix /etc/inittab ===&lt;br /&gt;
&lt;br /&gt;
Remove getties from inittab&lt;br /&gt;
&lt;br /&gt;
BUILD_# sed -i -e '/getty/d' /etc/inittab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== create device nodes ===&lt;br /&gt;
&lt;br /&gt;
Create device nodes at /dev, like console, full, null, zero, urandom, ptmx and fifo of initctl&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 600 /dev/console c 5 1&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/tty c 5 0&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/full c 1 7&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 600 /dev/initctl p&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/null c 1 3&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/ptmx c 5 2 &lt;br /&gt;
&lt;br /&gt;
BUILD_# mkdir pts&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/random c 1 8&lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 444 /dev/urandom c 1 9 &lt;br /&gt;
&lt;br /&gt;
BUILD_# mknod -m 666 /dev/zero c 1 5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== sysinit script modification ===&lt;br /&gt;
&lt;br /&gt;
Remove deleting of /etc/mtab in /etc/rc.sysinit and add mounting of /dev/pts&lt;br /&gt;
&lt;br /&gt;
BUILD_# nano /etc/rc.sysinit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
/bin/rm -f /etc/mtab&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
#/bin/rm -f /etc/mtab&lt;br /&gt;
/bin/mount -t devpts none /dev/pts&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== modify the main configuration file ===&lt;br /&gt;
&lt;br /&gt;
BUILD_# nano /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # Localization&lt;br /&gt;
 LOCALE=&amp;quot;en_US.utf8&amp;quot;&lt;br /&gt;
 HARDWARECLOCK=&amp;quot;localtime&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # example : German KEYMAP and Timezone to Berlin&lt;br /&gt;
 TIMEZONE=&amp;quot;Europe/Berlin&amp;quot;&lt;br /&gt;
 KEYMAP=&amp;quot;de-latin1-nodeadkeys&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 CONSOLEFONT=&lt;br /&gt;
 CONSOLEMAP=&lt;br /&gt;
 USECOLOR=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # Network settings&lt;br /&gt;
 HOSTNAME=&amp;quot;localhost&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # DAEMONS&lt;br /&gt;
 # Add openssh to DAEMONS, start at bootup ; ssh-keys are build on first VE start !!!&lt;br /&gt;
 DAEMONS=(syslog-ng network netfs crond ssh)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== enable ssh connections ===&lt;br /&gt;
&lt;br /&gt;
{{Note|All connection are disabled to VE, see /etc/hosts.deny, only affected server built-in with libwrap}}&lt;br /&gt;
&lt;br /&gt;
Allow ssh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BUILD_# echo &amp;quot;ssh: ALL : ALLOW&amp;quot; &amp;gt;&amp;gt; /etc/hosts.allow}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== lock (disable) the root account ===&lt;br /&gt;
&lt;br /&gt;
BUILD_# passwd -l root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== exit the chroot to VE0 ===&lt;br /&gt;
&lt;br /&gt;
BUILD_# exit &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== build a exclude list ==&lt;br /&gt;
&lt;br /&gt;
Shrink the OS-Template, so not all files needed in a VE - OS - TEMPLATE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove unused pacman backup files &lt;br /&gt;
&lt;br /&gt;
VE0_# find ./ -name '*.pacorig' &amp;gt; ../exclude.list-$ARCH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/resolv.conf is added by vzctl:&lt;br /&gt;
&lt;br /&gt;
VE0_# echo &amp;quot;etc/resolv.conf&amp;quot; &amp;gt;&amp;gt; ../exclude.list-$ARCH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dont add downloaded pkg to ostemplate:&lt;br /&gt;
&lt;br /&gt;
VE0_# find ./var/cache/ -name '*.tar.gz' &amp;gt;&amp;gt; ../exclude.list-$ARCH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
we dont need no logs and historys&lt;br /&gt;
&lt;br /&gt;
VE0_# find ./var/cache/ -name '*.tar.gz' &amp;gt;&amp;gt; ../exlcude.list-$ARCH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VE0_# find ./root/.bash_history &amp;gt;&amp;gt; ../exclude.list-$ARCH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== create OS-Template ==&lt;br /&gt;
&lt;br /&gt;
VE0_# tar -X ../exclude.list-$ARCH -czf /vz/template/cache/arch-0.8-$ARCH-minimal.tar.gz ./&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== use the OS-Template ==&lt;br /&gt;
&lt;br /&gt;
VE0_# vzctl create &amp;lt;VEID&amp;gt; --ostemplate arch-0.8-$ARCH-minimal ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== update the OS-Template ==&lt;br /&gt;
&lt;br /&gt;
to update a template is really easy, enter the build with chroot, performing upgrade task&lt;br /&gt;
&lt;br /&gt;
VE0_# chroot /vz/template/$DIST/$VERSION/$ARCH/ 'pacman -Syu'&lt;br /&gt;
&lt;br /&gt;
Update the exclude list, and pack upgraded OS - Template&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Archlinux wiki http://wiki.archlinux.org/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Virtual_Ethernet_device&amp;diff=2815</id>
		<title>Virtual Ethernet device</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Virtual_Ethernet_device&amp;diff=2815"/>
		<updated>2007-03-06T09:45:11Z</updated>

		<summary type="html">&lt;p&gt;Curx: add infos of syntax change in 3.0.14&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Virtual ethernet device''' is an ethernet-like device which can be used inside a [[VE]]. Unlike&lt;br /&gt;
[[venet]] network device, veth device has a MAC address. Due to this, it can be used in configurations, when veth is bridged to ethX or other device and VE user fully sets up his networking himself, &lt;br /&gt;
including IPs, gateways etc.&lt;br /&gt;
&lt;br /&gt;
Virtual ethernet device consist of two ethernet devices - one in [[VE0]] and another one &lt;br /&gt;
in VE. These devices are connected to each other, so if a packet goes to one&lt;br /&gt;
device it will come out from the other device.&lt;br /&gt;
&lt;br /&gt;
== Virtual ethernet device usage ==&lt;br /&gt;
&lt;br /&gt;
=== Kernel module ===&lt;br /&gt;
First of all, make sure the &amp;lt;code&amp;gt;vzethdev&amp;lt;/code&amp;gt; module is loaded:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lsmod | grep vzeth&lt;br /&gt;
vzethdev                8224  0&lt;br /&gt;
vzmon                  35164  5 vzethdev,vznetdev,vzrst,vzcpt&lt;br /&gt;
vzdev                   3080  4 vzethdev,vznetdev,vzmon,vzdquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case it is not loaded, load it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe vzethdev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might want to add the module to &amp;lt;code&amp;gt;/etc/init.d/vz script&amp;lt;/code&amp;gt;, so it will be loaded during startup.&lt;br /&gt;
&lt;br /&gt;
{{Note|since vzctl version 3.0.11, vzethdev is loaded by /etc/init.d/vz}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Adding veth to a VE ===&lt;br /&gt;
&lt;br /&gt;
{{Note|Use random MAC addresses. Do not use MAC addresses of real eth devices, because this can lead to collisions and MAC addresses must be entered in XX:XX:XX:XX:XX:XX format.}}&lt;br /&gt;
&lt;br /&gt;
==== syntax vzctl version &amp;lt; 3.0.14 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set &amp;lt;VEID&amp;gt; --veth_add &amp;lt;dev_name&amp;gt;,&amp;lt;dev_addr&amp;gt;,&amp;lt;ve_dev_name&amp;gt;,&amp;lt;ve_dev_addr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &lt;br /&gt;
* &amp;lt;tt&amp;gt;dev_name&amp;lt;/tt&amp;gt; is the ethernet device name that you are creating on the [[VE0|host system]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;dev_addr&amp;lt;/tt&amp;gt; is its MAC address&lt;br /&gt;
* &amp;lt;tt&amp;gt;ve_dev_name&amp;lt;/tt&amp;gt; is the corresponding ethernet device name you are creating on the VE&lt;br /&gt;
* &amp;lt;tt&amp;gt;ve_dev_addr&amp;lt;/tt&amp;gt; is its MAC address&lt;br /&gt;
&lt;br /&gt;
{{Note| that this option is incremental, so devices are added to already existing ones.}}&lt;br /&gt;
&lt;br /&gt;
NB there are no spaces after the commas&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 101 --veth_add veth101.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After executing this command &amp;lt;tt&amp;gt;veth&amp;lt;/tt&amp;gt; device will be created for VE 101 and veth configuration will be saved to a VE configuration file.&lt;br /&gt;
Host-side ethernet device will have &amp;lt;tt&amp;gt;veth101.0&amp;lt;/tt&amp;gt; name and &amp;lt;tt&amp;gt;00:12:34:56:78:9A&amp;lt;/tt&amp;gt; MAC address.&lt;br /&gt;
VE-side ethernet device will have &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt; name and &amp;lt;tt&amp;gt;00:12:34:56:78:9B&amp;lt;/tt&amp;gt; MAC address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== syntax vzctl version &amp;gt;= 3.0.14 ====&lt;br /&gt;
&lt;br /&gt;
Read Update infos about [http://openvz.org/news/updates/vzctl-3.0.14-1 vzctl 3.0.14]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set &amp;lt;VEID&amp;gt; --netif_add &amp;lt;ifname&amp;gt;[,&amp;lt;mac&amp;gt;,&amp;lt;host_ifname&amp;gt;,&amp;lt;host_mac]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&lt;br /&gt;
* &amp;lt;tt&amp;gt;ifname&amp;lt;/tt&amp;gt; is the ethernet device name in the VE&lt;br /&gt;
* &amp;lt;tt&amp;gt;mac&amp;lt;/tt&amp;gt; is its MAC address in the VE&lt;br /&gt;
* &amp;lt;tt&amp;gt;host_ifname&amp;lt;/tt&amp;gt;  is the ethernet device name on the host ([[VE0]])&lt;br /&gt;
* &amp;lt;tt&amp;gt;host_mac&amp;lt;/tt&amp;gt; is its MAC address on the host ([[VE0]])&lt;br /&gt;
&lt;br /&gt;
{{Note|All parameters except ifname are optional and are automatically generated if not specified.}}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 101 --netif_add eth0,00:12:34:56:78:9A,veth101.0,00:12:34:56:78:9B --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Removing veth from a VE ===&lt;br /&gt;
&lt;br /&gt;
==== syntax vzctl version &amp;lt; 3.0.14 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set &amp;lt;VEID&amp;gt; --veth_del &amp;lt;dev_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here &amp;lt;tt&amp;gt;dev_name&amp;lt;/tt&amp;gt; is the ethernet device name in the [[VE0|host system]].&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 101 --veth_del veth101.0 --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After executing this command veth device with host-side ethernet name veth101.0 will be removed from VE 101 and veth configuration will be updated in VE config file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== syntax vzctl version &amp;gt;= 3.0.14 ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set &amp;lt;VEID&amp;gt; --netif_del &amp;lt;dev_name&amp;gt;|&amp;lt;all&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&lt;br /&gt;
* &amp;lt;tt&amp;gt;dev_name&amp;lt;/tt&amp;gt; is the ethernet device name in the [[VE]].&lt;br /&gt;
&lt;br /&gt;
{{Note|If you want to remove all ethernet devices in VE, use all.}}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 101 --netif_del eth0 --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common configurations with virtual ethernet devices ==&lt;br /&gt;
Module &amp;lt;tt&amp;gt;vzethdev&amp;lt;/tt&amp;gt; must be loaded to operate with veth devices.&lt;br /&gt;
&lt;br /&gt;
=== Simple configuration with virtual ethernet device ===&lt;br /&gt;
&lt;br /&gt;
==== Start a VE ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add veth device to VE ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl set 101 --veth_add veth101.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure devices in VE0 ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ifconfig veth101.0 0&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth101.0/forwarding&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth101.0/proxy_arp&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/forwarding&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/proxy_arp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure device in VE ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl enter 101&lt;br /&gt;
[ve-101]# /sbin/ifconfig eth0 0&lt;br /&gt;
[ve-101]# /sbin/ip addr add 192.168.0.101 dev eth0&lt;br /&gt;
[ve-101]# /sbin/ip route add default dev eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add route in [[VE0]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ip route add 192.168.0.101 dev veth101.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Virtual ethernet device with IPv6 ===&lt;br /&gt;
&lt;br /&gt;
==== Start [[VE]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add veth device to [[VE]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl set 101 --veth_add veth101.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure devices in [[VE0]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ifconfig veth101.0 0&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv6/conf/veth101.0/forwarding&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv6/conf/eth0/forwarding&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/forwarding&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure device in [[VE]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl enter 101&lt;br /&gt;
[ve-101]# /sbin/ifconfig eth0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Start router advertisement daemon (radvd) for IPv6 in VE0 ====&lt;br /&gt;
First you need to edit radvd configuration file. Here is a simple example of &amp;lt;tt&amp;gt;/etc/radv.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface veth101.0&lt;br /&gt;
{&lt;br /&gt;
        AdvSendAdvert on;&lt;br /&gt;
        MinRtrAdvInterval 3;&lt;br /&gt;
        MaxRtrAdvInterval 10;&lt;br /&gt;
        AdvHomeAgentFlag off;&lt;br /&gt;
&lt;br /&gt;
        prefix 3ffe:2400:0:0::/64&lt;br /&gt;
        {&lt;br /&gt;
                AdvOnLink on;&lt;br /&gt;
                AdvAutonomous on;&lt;br /&gt;
                AdvRouterAddr off;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
interface eth0&lt;br /&gt;
{&lt;br /&gt;
        AdvSendAdvert on;&lt;br /&gt;
        MinRtrAdvInterval 3;&lt;br /&gt;
        MaxRtrAdvInterval 10;&lt;br /&gt;
        AdvHomeAgentFlag off;&lt;br /&gt;
&lt;br /&gt;
        prefix 3ffe:0302:0011:0002::/64&lt;br /&gt;
        {&lt;br /&gt;
                AdvOnLink on;&lt;br /&gt;
                AdvAutonomous on;&lt;br /&gt;
                AdvRouterAddr off;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, start radvd:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# /etc/init.d/radvd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add IPv6 addresses to devices in [[VE0]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ip addr add dev veth101.0 3ffe:2400::212:34ff:fe56:789a/64&lt;br /&gt;
[host-node]# ip addr add dev eth0 3ffe:0302:0011:0002:211:22ff:fe33:4455/64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Virtual ethernet devices can be joined in one bridge ===&lt;br /&gt;
Perform steps 1 - 4 from Simple configuration chapter for several VEs and/or veth devices&lt;br /&gt;
&lt;br /&gt;
==== Create bridge device ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# brctl addbr vzbr0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add veth devices to bridge ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# brctl addif vzbr0 veth101.0&lt;br /&gt;
...&lt;br /&gt;
[host-node]# brctl addif vzbr0 veth101.n&lt;br /&gt;
[host-node]# brctl addif vzbr0 veth102.0&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
[host-node]# brctl addif vzbr0 vethXXX.N&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configure bridge device ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ifconfig vzbr0 0&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/vzbr0/forwarding&lt;br /&gt;
[host-node]# echo 1 &amp;gt; /proc/sys/net/ipv4/conf/vzbr0/proxy_arp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add routes in [[VE0]] ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# ip route add 192.168.101.1 dev vzbr0&lt;br /&gt;
...&lt;br /&gt;
[host-node]# ip route add 192.168.101.n dev vzbr0&lt;br /&gt;
[host-node]# ip route add 192.168.102.1 dev vzbr0&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
[host-node]# ip route add 192.168.XXX.N dev vzbr0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus you'll have more convinient configuration, i.e. all routes to VEs will be through this bridge and VEs can communicate with each other even without these routes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making a veth-device persistent ===&lt;br /&gt;
At the moment, it is not possible to have the commands needed for a persistent veth being made automatically be vzctl. A  bugreport ( http://bugzilla.openvz.org/show_bug.cgi?id=301 ) has already been made. Until then, here's a way to make the above steps persistent (for a debian based system in this example).&lt;br /&gt;
&lt;br /&gt;
==== Cleaning ${VEID}.conf ====&lt;br /&gt;
=====Option A)=====&lt;br /&gt;
Open up /etc/vz/conf/VEID.conf and comment out any IP_ADDRESS-entries to prevent a VENET-device from being created in the VE. Add or change the entry CONFIG_CUSTOMIZED=&amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Option B)=====&lt;br /&gt;
Follow Option A and add in addition a VETH_IP_ADDRESS=&amp;quot;&amp;lt;your VE IP&amp;gt;&amp;quot; entry to your /etc/vz/conf/VEID.conf including the IP Address you want to set.&lt;br /&gt;
&lt;br /&gt;
====Adding an external script to VE0 ====&lt;br /&gt;
Copy and paste the following code (either Option A or B) into /usr/sbin/vznetaddroute:&lt;br /&gt;
=====Option A)=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# This script adds the appropriate VE0-route for veth-enabled VEs.&lt;br /&gt;
# See http://wiki.openvz.org/Virtual_Ethernet_device for more information.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# check the VEID&lt;br /&gt;
if [ &amp;quot;${VEID}&amp;quot; == 101 ]; then&lt;br /&gt;
  echo &amp;quot;Adding interface veth101.0 and route 192.168.0.101 for VE101 to VE0&amp;quot;&lt;br /&gt;
  /sbin/ifconfig veth101.0 0&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth101.0/forwarding&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth101.0/proxy_arp&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/forwarding&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/proxy_arp&lt;br /&gt;
  /sbin/ip route add 192.168.0.101 dev veth101.0&lt;br /&gt;
elsif [ &amp;quot;${VEID}&amp;quot; == 102 ]; then&lt;br /&gt;
  echo &amp;quot;Adding interface veth102.0 and route 192.168.0.102 for VE101 to VE0&amp;quot;&lt;br /&gt;
  /sbin/ifconfig veth101.0 0&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth102.0/forwarding&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/veth102.0/proxy_arp&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/forwarding&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv4/conf/eth0/proxy_arp&lt;br /&gt;
  /sbin/ip route add 192.168.0.102 dev veth102.0&lt;br /&gt;
elsif [ &amp;quot;${VEID}&amp;quot; == YOUR_VE ]; then&lt;br /&gt;
  # same as above with the vethYOUR_VE.0 device and the appropriate ip&lt;br /&gt;
fi&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add one elsif-section for every veth-enabled VE you'd like to have automatically configured. Remember to run &amp;lt;pre&amp;gt;chmod +x /usr/sbin/vznetaddroute&amp;lt;/pre&amp;gt; to make the script executable.&lt;br /&gt;
=====Option B)=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
VZCONFDIR=/etc/vz&lt;br /&gt;
VZHOSTIF=$BASH_ARGV&lt;br /&gt;
&lt;br /&gt;
. $VZCONFDIR/conf/$VEID.conf&lt;br /&gt;
&lt;br /&gt;
if [ -n $VETH_IP_ADDRESS ]; then&lt;br /&gt;
        echo &amp;quot;Adding interface $VZHOSTIF and route $VETH_IP_ADDRESS for VE$VEID to VE0&amp;quot;&lt;br /&gt;
        /sbin/ifconfig $VZHOSTIF 0&lt;br /&gt;
        echo 1 &amp;gt; /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp&lt;br /&gt;
        echo 1 &amp;gt; /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding&lt;br /&gt;
        /sbin/ip route add $VETH_IP_ADDRESS dev $VZHOSTIF&lt;br /&gt;
else&lt;br /&gt;
        echo &amp;quot;found no VETH_IP_ADDRESS in  $VZCONFDIR/conf/$VEID.conf!&amp;quot;&lt;br /&gt;
        exit 1;&lt;br /&gt;
fi&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Remember to run &amp;lt;pre&amp;gt;chmod +x /usr/sbin/vznetaddroute&amp;lt;/pre&amp;gt; to make the script executable.&lt;br /&gt;
&lt;br /&gt;
in addition you need to edit your /etc/network/interfaces and add the sysctl statements for forwardings and proxy_arp like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto eth0&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 10.1.1.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 10.1.1.0&lt;br /&gt;
        broadcast 10.1.1.255&lt;br /&gt;
        gateway 10.215.1.254&lt;br /&gt;
        dns-nameservers 10.215.1.20&lt;br /&gt;
        dns-search prod.your.domain&lt;br /&gt;
        up sysctl -w net.ipv4.conf.eth0.proxy_arp=1&lt;br /&gt;
        up sysctl -w net.ipv4.conf.eth0.forwarding=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
afterwards execute both statements manualy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.eth0.proxy_arp=1&lt;br /&gt;
sysctl -w net.ipv4.conf.eth0.forwarding=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Make vzctl run the script====&lt;br /&gt;
&lt;br /&gt;
To make vzctl run the script, copy and paste the following line to /etc/vz/vznet.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
EXTERNAL_SCRIPT=&amp;quot;/usr/sbin/vznetaddroute&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script will now run every time a veth-enabled VE is started.&lt;br /&gt;
&lt;br /&gt;
==== Adding a script to VE ====&lt;br /&gt;
&lt;br /&gt;
Now we're done with VE0, we still need to add a route to the VE itself. So we start up the VE with &amp;lt;pre&amp;gt;vzctl start 101&amp;lt;/pre&amp;gt;, get into it with &amp;lt;pre&amp;gt;vzctl enter 101&amp;lt;/pre&amp;gt; and create a new file /etc/init.d/route-up in the VE with the following content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
/sbin/ip route add default dev eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the script executable with &amp;lt;pre&amp;gt;chmod +x /etc/init.d/route-up&amp;lt;/pre&amp;gt; and add it to the runlevels:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve101:/# update-rc.d route-up defaults&lt;br /&gt;
 Adding system startup for /etc/init.d/route-up ...&lt;br /&gt;
  /etc/rc0.d/K20route-up -&amp;gt; ../init.d/route-up&lt;br /&gt;
  [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Checking ====&lt;br /&gt;
Now to see if everything worked, leave the VE with &amp;lt;pre&amp;gt;exit&amp;lt;/pre&amp;gt;, stop the VE via &amp;lt;pre&amp;gt;vzctl stop 101&amp;lt;/pre&amp;gt; and restart it with &amp;lt;pre&amp;gt;vzctl start 101&amp;lt;/pre&amp;gt;. Still in VE0, check the route for the VE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve0:/# ip route ls&lt;br /&gt;
192.168.0.101 dev veth101.0  scope link&lt;br /&gt;
[...]&lt;br /&gt;
ve0:/# ping 192.168.0.101 -c 4 -q&lt;br /&gt;
[...]&lt;br /&gt;
--- 192.168.0.101 ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 recieved, 0% packet loss, time 0ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If somethings not working, check the contents of the files we just created or changed. Now get into the VE via &amp;lt;pre&amp;gt;vzctl enter 101&amp;lt;/pre&amp;gt; and check the routing there:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve101:/# ifconfig &lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 00:12:34:56:78:9B  &lt;br /&gt;
          inet addr:192.168.0.101  Bcast:0.0.0.0  Mask:255.255.255.255&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:92 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:6757 (6.5 KiB)  TX bytes:10396 (10.1 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
ve101:/# ip route ls&lt;br /&gt;
default dev eth0  scope link&lt;br /&gt;
ve101:/# ping 192.168.0.101 -c 4 -q&lt;br /&gt;
[...]&lt;br /&gt;
--- 192.168.0.101 ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 recieved, 0% packet loss, time 0ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have problems getting it persistent, please comment.&lt;br /&gt;
&lt;br /&gt;
=== Virtual ethernet devices + VLAN ===&lt;br /&gt;
This configuration can be done by adding vlan device to the previous configuration.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Virtual network device]]&lt;br /&gt;
* [[Differences between venet and veth]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/hints-daemons-radvd.html Linux IPv6 HOWTO, a chapter about radvd]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Networking]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2652</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2652"/>
		<updated>2007-01-18T07:31:24Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* precompiled kernel images at debian.systs.org (dso) */ removed 2.6.16&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge (Stable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ stable openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9      &lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18      &lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update you &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Etch (Testing) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch (a.k.a. &amp;quot;testing&amp;quot;) repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== use precomiled kernel images ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== modify needed settings ==&lt;br /&gt;
&lt;br /&gt;
a Debian Way: &lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding. Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart you Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2651</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2651"/>
		<updated>2007-01-18T07:29:41Z</updated>

		<summary type="html">&lt;p&gt;Curx: add kernel config option, minor changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge (Stable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ stable openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9      &lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.16      &lt;br /&gt;
 ovzkernel-2.6.16-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18      &lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update you &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Etch (Testing) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch (a.k.a. &amp;quot;testing&amp;quot;) repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== use precomiled kernel images ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test010-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from a OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [*] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [*] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
       built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)&lt;br /&gt;
       See also :&lt;br /&gt;
       # make-kpkg --targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 &lt;br /&gt;
   or all above with one step &lt;br /&gt;
&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== modify needed settings ==&lt;br /&gt;
&lt;br /&gt;
a Debian Way: &lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding. Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart you Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=2631</id>
		<title>Talk:Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=2631"/>
		<updated>2007-01-08T23:05:52Z</updated>

		<summary type="html">&lt;p&gt;Curx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;info about needed modules in kernel-config&lt;br /&gt;
&lt;br /&gt;
info about &amp;quot;Yet Another mkInitRD&amp;quot; yaid tools creating initrd-files&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=2630</id>
		<title>Talk:Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Installation_on_Debian/old&amp;diff=2630"/>
		<updated>2007-01-08T23:05:34Z</updated>

		<summary type="html">&lt;p&gt;Curx: todo, hints and suggestions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;todo:&lt;br /&gt;
&lt;br /&gt;
info about needed modules in kernel-config&lt;br /&gt;
info about &amp;quot;Yet Another mkInitRD&amp;quot; yaid tools creating initrd-files&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2629</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2629"/>
		<updated>2007-01-08T22:58:07Z</updated>

		<summary type="html">&lt;p&gt;Curx: add info's about precreated debian at download.openvz.org, add minor hints&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge (Stable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ stable openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9      &lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.16      &lt;br /&gt;
 ovzkernel-2.6.16-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18      &lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update you &amp;quot;linux-loader&amp;quot; (can be configured at /etc/kernel-img.conf)&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Etch (Testing) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch (a.k.a. &amp;quot;testing&amp;quot;) repository.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== use precomiled kernel images ===&lt;br /&gt;
Can be found at http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
List of precompiled kernel-images&lt;br /&gt;
&lt;br /&gt;
 linux-image-2.6.18-openvz-486_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-amd64_01_amd64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-ia64_01_ia64.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-k7_02_i386.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb&lt;br /&gt;
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== or build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel-source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cp /boot/config-2.6.18-3-686 .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/ &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test007-i686.config.ovz -O .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and modify your kernel-config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compile your Kernel (as user root, or you need the --fakerootcmd!)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 kernel_image --initrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: update-initramfs is done, when make-kpkg is use with --initrd option&lt;br /&gt;
&lt;br /&gt;
 INFO: update-grub can be configured by /etc/kernel-img.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (when not done above)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
 INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== modify needed settings ==&lt;br /&gt;
&lt;br /&gt;
Debian Way: &lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding. Set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
 [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-pre-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
&lt;br /&gt;
 INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plain OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # On Hardware Node we generally need&lt;br /&gt;
 # packet forwarding enabled and proxy arp disabled&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
 net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
 # we do not want all our interfaces to send redirects&lt;br /&gt;
 net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
 net.ipv4.conf.all.send_redirects = 0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart you Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Debian_template_creation&amp;diff=2628</id>
		<title>Talk:Debian template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Debian_template_creation&amp;diff=2628"/>
		<updated>2007-01-08T12:43:39Z</updated>

		<summary type="html">&lt;p&gt;Curx: Debian template creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi all, &lt;br /&gt;
This is my first trial with openVZ and a wiki. Please give me some hints, if anything is wrong. Don't hesitate to correct my poor english.&lt;br /&gt;
&lt;br /&gt;
I just installed openVZ on a rather old test box with Debian. Installation failed at first and I suppose there is a wrong path statement used for the debian packages.&lt;br /&gt;
&lt;br /&gt;
When I came to &lt;br /&gt;
&amp;lt;code&amp;gt;vzctl start 777&amp;lt;/code&amp;gt;&lt;br /&gt;
I received the message&lt;br /&gt;
&amp;lt;code&amp;gt;Starting VE ...&lt;br /&gt;
VE private area /var/lib/vz/private/777 does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moving the directory 777 from /vz/private to /var/lib/vz/private solves this problem. &lt;br /&gt;
&lt;br /&gt;
Now I could start and enter the new VE.&lt;br /&gt;
&lt;br /&gt;
== Debian template creation ==&lt;br /&gt;
&lt;br /&gt;
For backward compablity to main OpenVZ:&lt;br /&gt;
&lt;br /&gt;
Create a symlink from /var/lib/vz to /vz&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2569</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2569"/>
		<updated>2006-12-05T20:10:58Z</updated>

		<summary type="html">&lt;p&gt;Curx: add the test-18 to (dso-)repro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Stable =&lt;br /&gt;
&lt;br /&gt;
== Edit apt settings ==&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ stable openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages at debian.systs.org (dso) ==&lt;br /&gt;
&lt;br /&gt;
precreated OpenVZ Debian Packages:&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9      &lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.16      &lt;br /&gt;
 ovzkernel-2.6.16-smp&lt;br /&gt;
&lt;br /&gt;
 ovzkernel-2.6.18      &lt;br /&gt;
 ovzkernel-2.6.18-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18-enterprise    &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the kernels and OpenVZ toolset ==&lt;br /&gt;
&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update you &amp;quot;linux-loader&amp;quot; like lilo or grub:&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;:&lt;br /&gt;
 # /sbin/grub-update&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Unstable=&lt;br /&gt;
&lt;br /&gt;
OpenVZ is now a part of Debian Sid (a.k.a. &amp;quot;unstable&amp;quot;) repository. This article describes how to install OpenVZ on a Debian Sid system.&lt;br /&gt;
&lt;br /&gt;
== Installing the utilities and kernel patch ==&lt;br /&gt;
&lt;br /&gt;
To install the OpenVZ kernel patch and utilities, run the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install kernel-patch-openvz vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating the kernel package ==&lt;br /&gt;
&lt;br /&gt;
To create a kernel package, you need to download and unpack 2.6.16 “vanilla” kernel first:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/src/&lt;br /&gt;
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2&lt;br /&gt;
tar xjf linux-2.6.16.tar.bz2&lt;br /&gt;
cd linux-2.6.16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note that you do need a vanilla kernel for this, because the OpenVZ kernel patch doesn't apply cleanly to the Debian linux-source-2.6.16 package; see [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377707 Debian bug #377707].)&lt;br /&gt;
&lt;br /&gt;
Next, get the proper kernel config from [http://download.openvz.org/kernel/devel/026test015.1/configs/ download.openvz.org]. Below is the example of using smp config for i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://download.openvz.org/kernel/devel/026test015.1/configs/kernel-2.6.16-026test015-i686-smp.config.ovz&lt;br /&gt;
mv kernel-2.6.16-026test015-i686-smp.config.ovz .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|This example uses a config file for the 026test015 kernel patch. If the kernel-patch-openvz package you installed is a different version, download a config file that corresponds with your version}}&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and compile the kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make-kpkg --added_patches openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2436</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=2436"/>
		<updated>2006-10-27T13:27:22Z</updated>

		<summary type="html">&lt;p&gt;Curx: /* Installing the kernels and OpenVZ toolset */ kernel update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Stable =&lt;br /&gt;
&lt;br /&gt;
== Edit apt settings ==&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ stable openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packages at debian.systs.org (dso) ==&lt;br /&gt;
&lt;br /&gt;
precreated OpenVZ Debian Packages:&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64 - Version: 023stab032.1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9      &lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel(s) for i368 and amd64 - Version: 026test020.1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.16      &lt;br /&gt;
 ovzkernel-2.6.16-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the kernels and OpenVZ toolset ==&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
Maybe you need to update you &amp;quot;linux-loader&amp;quot; like lilo or grub:&lt;br /&gt;
&lt;br /&gt;
for the &amp;quot;GRUB&amp;quot;:&lt;br /&gt;
 # /sbin/grub-update&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Stable OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
=Unstable=&lt;br /&gt;
&lt;br /&gt;
OpenVZ is now a part of Debian Sid (a.k.a. &amp;quot;unstable&amp;quot;) repository. This article describes how to install OpenVZ on a Debian Sid system.&lt;br /&gt;
&lt;br /&gt;
== Installing the utilities and kernel patch ==&lt;br /&gt;
&lt;br /&gt;
To install the OpenVZ kernel patch and utilities, run the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install kernel-patch-openvz vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating the kernel package ==&lt;br /&gt;
&lt;br /&gt;
To create a kernel package, you need to download and unpack 2.6.16 “vanilla” kernel first:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/src/&lt;br /&gt;
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2&lt;br /&gt;
tar xjf linux-2.6.16.tar.bz2&lt;br /&gt;
cd linux-2.6.16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note that you do need a vanilla kernel for this, because the OpenVZ kernel patch doesn't apply cleanly to the Debian linux-source-2.6.16 package; see [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377707 Debian bug #377707].)&lt;br /&gt;
&lt;br /&gt;
Next, get the proper kernel config from [http://download.openvz.org/kernel/devel/026test015.1/configs/ download.openvz.org]. Below is the example of using smp config for i686:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://download.openvz.org/kernel/devel/026test015.1/configs/kernel-2.6.16-026test015-i686-smp.config.ovz&lt;br /&gt;
mv kernel-2.6.16-026test015-i686-smp.config.ovz .config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|This example uses a config file for the 026test015 kernel patch. If the kernel-patch-openvz package you installed is a different version, download a config file that corresponds with your version}}&lt;br /&gt;
&lt;br /&gt;
Now you can apply openvz kernel patch and compile the kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make-kpkg --added_patches openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Curx</name></author>
		
	</entry>
</feed>