<?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=Elronxenu</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=Elronxenu"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Elronxenu"/>
	<updated>2026-07-10T22:12:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=6792</id>
		<title>Debian template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=6792"/>
		<updated>2008-12-12T07:31:32Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Use http.us.debian.org consistently&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are rough instructions of how to manually create basic Debian Etch (4.0) template cache, which can be used to create OpenVZ [[VE]]s based on Debian Etch (4.0). (see also &amp;lt;tt&amp;gt;/usr/share/doc/vzctl/README.Debian&amp;lt;/tt&amp;gt; in the ''vzctl'' Debian package)&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
* You shouldn't be running as root, but as a user that is permitted to use sudo instead.  It's a dangerous idea, run as root at your peril.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;/vz&amp;lt;/tt&amp;gt;, you might really need to use &amp;lt;tt&amp;gt;/var/lib/vz&amp;lt;/tt&amp;gt; instead, especially on a Debian Etch host.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;http://http.us.debian.org/debian/&amp;lt;/tt&amp;gt;, you can substitute your favorite Debian mirror.  ([http://www.debian.org/mirror/list List of official Debian Mirrors])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
You need to have a working copy of &amp;lt;tt&amp;gt;debootstrap&amp;lt;/tt&amp;gt; running on your hardware node.&lt;br /&gt;
&lt;br /&gt;
For Debian:&lt;br /&gt;
 sudo apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
For Gentoo:&lt;br /&gt;
 sudo emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
For Fedora (at least Fedora 8 have it, not sure about earlier versions):&lt;br /&gt;
 sudo yum install debootstrap&lt;br /&gt;
&lt;br /&gt;
For other distros you might need to install it from sources, or search for an appropriate package for your distribution.  An RPM is available on the [http://forum.openvz.org/index.php?t=tree&amp;amp;th=142&amp;amp;mid=584 OpenVZ Forum].&lt;br /&gt;
&lt;br /&gt;
== Bootstrapping Debian ==&lt;br /&gt;
&lt;br /&gt;
You can install different releases of Debian into a VE's private directory using the debootstrap command.&lt;br /&gt;
&lt;br /&gt;
The command parameters are:&lt;br /&gt;
&lt;br /&gt;
  debootstrap --arch ARCH NAME DIRECTORY URL&lt;br /&gt;
&lt;br /&gt;
Specify your architecture instead of &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; if you're using something other than i386/x86.  For example, for AMD64/x86_64, use &amp;lt;tt&amp;gt;amd64&amp;lt;/tt&amp;gt; or for ia64, use &amp;lt;tt&amp;gt;ia64&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We use VE ID of 777 for this example; surely it can be any other unused ID.&lt;br /&gt;
&lt;br /&gt;
=== Etch (current Debian stable) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 etch /vz/private/777 http://http.us.debian.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Sarge (old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap sarge /vz/private/777 http://http.us.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
=== Woody (very old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap woody /vz/private/777 http://archive.debian.org/&lt;br /&gt;
&lt;br /&gt;
== Preparing and starting the VE ==&lt;br /&gt;
&lt;br /&gt;
=== Setting VE config ===&lt;br /&gt;
First, we need a config for the [[VE]]:&lt;br /&gt;
 sudo 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;
 sudo sh -c 'echo &amp;quot;OSTEMPLATE=debian-4.0&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;
 sudo 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;
 sudo vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== Starting VE ===&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 sudo vzctl start 777&lt;br /&gt;
&lt;br /&gt;
== Customizing the installation ==&lt;br /&gt;
A few things need to be done inside a newly created VE for it to become suitable for OpenVZ.  All those things are done inside the VE, so first command is:&lt;br /&gt;
 sudo vzctl enter 777&lt;br /&gt;
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin&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;
=== Set Debian repositories ===&lt;br /&gt;
 cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/apt/sources.list&lt;br /&gt;
 deb http://http.us.debian.org/debian etch main contrib&lt;br /&gt;
 deb http://security.debian.org etch/updates main contrib&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
=== Get new security updates ===&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install some more packages ===&lt;br /&gt;
Installing packages could be an interactive process so the system might ask some questions.  You can install more packages if you'd like.  For example:&lt;br /&gt;
 apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
=== Set sane permissions for &amp;lt;tt&amp;gt;/root&amp;lt;/tt&amp;gt; directory ===&lt;br /&gt;
 chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
=== Disable root login ===&lt;br /&gt;
This will disable root login by default.&lt;br /&gt;
 usermod -L root&lt;br /&gt;
&lt;br /&gt;
=== Disable getty ===&lt;br /&gt;
Disable running &amp;lt;tt&amp;gt;getty&amp;lt;/tt&amp;gt;s on terminals as a VE does not have any:&lt;br /&gt;
 sed -i -e '/getty/d' /etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== Disable &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; for syslog ===&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;tt&amp;gt;syslog&amp;lt;/tt&amp;gt;'s log files, to improve I/O performance:&lt;br /&gt;
 &amp;lt;pre&amp;gt;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;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
Link &amp;lt;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/proc/mounts&amp;lt;/tt&amp;gt;, so &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; and friends will work:&lt;br /&gt;
 rm -f /etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
=== Remove some unneeded packages ===&lt;br /&gt;
If you have any packages you'd like to remove, now's the time for it.  Here's an example:&lt;br /&gt;
 dpkg --purge modutils ppp pppoeconf pppoe pppconfig&lt;br /&gt;
&lt;br /&gt;
=== Disable services ===&lt;br /&gt;
Do not start some services, stick to bare minimum:&lt;br /&gt;
 update-rc.d -f klogd remove&lt;br /&gt;
 update-rc.d -f quotarpc remove&lt;br /&gt;
 update-rc.d -f exim4 remove&lt;br /&gt;
 update-rc.d -f inetd remove&lt;br /&gt;
&lt;br /&gt;
=== Fix SSH host keys ===&lt;br /&gt;
This is only useful if you installed SSH.  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;source&amp;gt;...&amp;lt;/source&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&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/bash&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;/source&amp;gt;&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;
 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;
 exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&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;
 sudo vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Also, remove DNS server and search domain information from ''/etc/resolv.conf'' file '''in VE''':&lt;br /&gt;
 sudo nano /vz/private/777/etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 sudo vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Go to the VE directory:&lt;br /&gt;
 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;tt&amp;gt;i386&amp;lt;/tt&amp;gt; with your architecture (i386, amd64, ia64, etc).&lt;br /&gt;
 sudo tar -zcf /vz/template/cache/debian-4.0-i386-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  51M Apr 10 03:16 debian-4.0-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Checking if template cache works ==&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;
 sudo vzctl create 123456 --ostemplate debian-4.0-i386-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that it works:&lt;br /&gt;
 sudo vzctl start 123456&lt;br /&gt;
 sudo vzctl exec 123456 ps ax&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 sudo vzctl stop 123456&lt;br /&gt;
 sudo vzctl destroy 123456&lt;br /&gt;
 sudo rm /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;
 sudo vzctl destroy 777&lt;br /&gt;
 sudo rm /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Debian]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=6791</id>
		<title>Debian template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=6791"/>
		<updated>2008-12-12T07:29:30Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Change to http.us.debian.org&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are rough instructions of how to manually create basic Debian Etch (4.0) template cache, which can be used to create OpenVZ [[VE]]s based on Debian Etch (4.0). (see also &amp;lt;tt&amp;gt;/usr/share/doc/vzctl/README.Debian&amp;lt;/tt&amp;gt; in the ''vzctl'' Debian package)&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
* You shouldn't be running as root, but as a user that is permitted to use sudo instead.  It's a dangerous idea, run as root at your peril.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;/vz&amp;lt;/tt&amp;gt;, you might really need to use &amp;lt;tt&amp;gt;/var/lib/vz&amp;lt;/tt&amp;gt; instead, especially on a Debian Etch host.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;http://debian.osuosl.org/debian/&amp;lt;/tt&amp;gt;, you can substitute your favorite Debian mirror.  ([http://www.debian.org/mirror/list List of official Debian Mirrors])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
You need to have a working copy of &amp;lt;tt&amp;gt;debootstrap&amp;lt;/tt&amp;gt; running on your hardware node.&lt;br /&gt;
&lt;br /&gt;
For Debian:&lt;br /&gt;
 sudo apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
For Gentoo:&lt;br /&gt;
 sudo emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
For Fedora (at least Fedora 8 have it, not sure about earlier versions):&lt;br /&gt;
 sudo yum install debootstrap&lt;br /&gt;
&lt;br /&gt;
For other distros you might need to install it from sources, or search for an appropriate package for your distribution.  An RPM is available on the [http://forum.openvz.org/index.php?t=tree&amp;amp;th=142&amp;amp;mid=584 OpenVZ Forum].&lt;br /&gt;
&lt;br /&gt;
== Bootstrapping Debian ==&lt;br /&gt;
&lt;br /&gt;
You can install different releases of Debian into a VE's private directory using the debootstrap command.&lt;br /&gt;
&lt;br /&gt;
The command parameters are:&lt;br /&gt;
&lt;br /&gt;
  debootstrap --arch ARCH NAME DIRECTORY URL&lt;br /&gt;
&lt;br /&gt;
Specify your architecture instead of &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; if you're using something other than i386/x86.  For example, for AMD64/x86_64, use &amp;lt;tt&amp;gt;amd64&amp;lt;/tt&amp;gt; or for ia64, use &amp;lt;tt&amp;gt;ia64&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We use VE ID of 777 for this example; surely it can be any other unused ID.&lt;br /&gt;
&lt;br /&gt;
=== Etch (current Debian stable) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 etch /vz/private/777 http://debian.osuosl.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Sarge (old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap sarge /vz/private/777 http://http.us.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
=== Woody (very old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap woody /vz/private/777 http://archive.debian.org/&lt;br /&gt;
&lt;br /&gt;
== Preparing and starting the VE ==&lt;br /&gt;
&lt;br /&gt;
=== Setting VE config ===&lt;br /&gt;
First, we need a config for the [[VE]]:&lt;br /&gt;
 sudo 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;
 sudo sh -c 'echo &amp;quot;OSTEMPLATE=debian-4.0&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;
 sudo 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;
 sudo vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== Starting VE ===&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 sudo vzctl start 777&lt;br /&gt;
&lt;br /&gt;
== Customizing the installation ==&lt;br /&gt;
A few things need to be done inside a newly created VE for it to become suitable for OpenVZ.  All those things are done inside the VE, so first command is:&lt;br /&gt;
 sudo vzctl enter 777&lt;br /&gt;
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin&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;
=== Set Debian repositories ===&lt;br /&gt;
 cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/apt/sources.list&lt;br /&gt;
 deb http://http.us.debian.org/debian etch main contrib&lt;br /&gt;
 deb http://security.debian.org etch/updates main contrib&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
=== Get new security updates ===&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install some more packages ===&lt;br /&gt;
Installing packages could be an interactive process so the system might ask some questions.  You can install more packages if you'd like.  For example:&lt;br /&gt;
 apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
=== Set sane permissions for &amp;lt;tt&amp;gt;/root&amp;lt;/tt&amp;gt; directory ===&lt;br /&gt;
 chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
=== Disable root login ===&lt;br /&gt;
This will disable root login by default.&lt;br /&gt;
 usermod -L root&lt;br /&gt;
&lt;br /&gt;
=== Disable getty ===&lt;br /&gt;
Disable running &amp;lt;tt&amp;gt;getty&amp;lt;/tt&amp;gt;s on terminals as a VE does not have any:&lt;br /&gt;
 sed -i -e '/getty/d' /etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== Disable &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; for syslog ===&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;tt&amp;gt;syslog&amp;lt;/tt&amp;gt;'s log files, to improve I/O performance:&lt;br /&gt;
 &amp;lt;pre&amp;gt;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;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
Link &amp;lt;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/proc/mounts&amp;lt;/tt&amp;gt;, so &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; and friends will work:&lt;br /&gt;
 rm -f /etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
=== Remove some unneeded packages ===&lt;br /&gt;
If you have any packages you'd like to remove, now's the time for it.  Here's an example:&lt;br /&gt;
 dpkg --purge modutils ppp pppoeconf pppoe pppconfig&lt;br /&gt;
&lt;br /&gt;
=== Disable services ===&lt;br /&gt;
Do not start some services, stick to bare minimum:&lt;br /&gt;
 update-rc.d -f klogd remove&lt;br /&gt;
 update-rc.d -f quotarpc remove&lt;br /&gt;
 update-rc.d -f exim4 remove&lt;br /&gt;
 update-rc.d -f inetd remove&lt;br /&gt;
&lt;br /&gt;
=== Fix SSH host keys ===&lt;br /&gt;
This is only useful if you installed SSH.  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;source&amp;gt;...&amp;lt;/source&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&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/bash&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;/source&amp;gt;&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;
 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;
 exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&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;
 sudo vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Also, remove DNS server and search domain information from ''/etc/resolv.conf'' file '''in VE''':&lt;br /&gt;
 sudo nano /vz/private/777/etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 sudo vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Go to the VE directory:&lt;br /&gt;
 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;tt&amp;gt;i386&amp;lt;/tt&amp;gt; with your architecture (i386, amd64, ia64, etc).&lt;br /&gt;
 sudo tar -zcf /vz/template/cache/debian-4.0-i386-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  51M Apr 10 03:16 debian-4.0-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Checking if template cache works ==&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;
 sudo vzctl create 123456 --ostemplate debian-4.0-i386-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that it works:&lt;br /&gt;
 sudo vzctl start 123456&lt;br /&gt;
 sudo vzctl exec 123456 ps ax&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 sudo vzctl stop 123456&lt;br /&gt;
 sudo vzctl destroy 123456&lt;br /&gt;
 sudo rm /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;
 sudo vzctl destroy 777&lt;br /&gt;
 sudo rm /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Debian]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=IPv6_Configuration&amp;diff=6790</id>
		<title>IPv6 Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=IPv6_Configuration&amp;diff=6790"/>
		<updated>2008-12-12T07:09:44Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: First cut at actual documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Configuring IPV6 in a VE =&lt;br /&gt;
&lt;br /&gt;
Assuming you want to add globally routable ipv6 addresses&lt;br /&gt;
to your VEs, follow these instructions.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
On the HN, first make sure /etc/vz/vz.conf has IPV6=&amp;quot;yes&amp;quot;&lt;br /&gt;
and your HN is working correctly for ipv6.&lt;br /&gt;
&lt;br /&gt;
On the HN, do:&lt;br /&gt;
&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/forwarding&lt;br /&gt;
  echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/proxy_ndp&lt;br /&gt;
&lt;br /&gt;
== Adding each VE ==&lt;br /&gt;
&lt;br /&gt;
On the HN, do:&lt;br /&gt;
&lt;br /&gt;
  vzctl set $VEID --ipadd 2001:xxxx:xxxx::xxxx --save&lt;br /&gt;
&lt;br /&gt;
To enable the HN to reply to Neighbor Solicitation requests, do:&lt;br /&gt;
&lt;br /&gt;
  ip -6 neigh add proxy 2001:xxxx:xxxx::xxxx dev eth0&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=VPN_using_IPsec&amp;diff=3636</id>
		<title>VPN using IPsec</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=VPN_using_IPsec&amp;diff=3636"/>
		<updated>2007-11-16T22:48:36Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Note that the 047 version is for kernel 2.6.18&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An OpenVZ VE can join an IPsec VPN - specifically the type provided by the Cisco VPN client and 'vpnc' package.&lt;br /&gt;
&lt;br /&gt;
== Using the Cisco VPN client ==&lt;br /&gt;
&lt;br /&gt;
The Cisco VPN client can be downloded from Cisco, if you have an account with them. It builds a kernel module.&lt;br /&gt;
&lt;br /&gt;
I have not tested this, so I don't have any instructions to set it up.&lt;br /&gt;
&lt;br /&gt;
[[User:Elronxenu|Elronxenu]] 19:46, 15 November 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
== Using the 'vpnc' package ==&lt;br /&gt;
&lt;br /&gt;
The vpnc package is part of Debian.&lt;br /&gt;
It runs entirely in userspace. There's a daemon which communicates with a remote VPN gateway and provides a local TUN device as a network interface for the VE to use.&lt;br /&gt;
Here are brief instructions to get it going:&lt;br /&gt;
&lt;br /&gt;
# When using kernel 2.6.18, use revision ovz028stab047 or later. Earlier revisions are unable to create a raw socket of the necessary protocol.&lt;br /&gt;
# Enable the TUN device within your VE. See [[VPN via the TUN/TAP device]].&lt;br /&gt;
# Firewall configuration: allow UDP port 500 in and out of your client. This is used for authentication setup.&lt;br /&gt;
# Firewall configuration: allow protocol 50 (0x32) in and out of your client. This is used for VPN data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Download/kernel/2.6.22/2.6.22-ovz005.1&amp;diff=3635</id>
		<title>Download/kernel/2.6.22/2.6.22-ovz005.1</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Download/kernel/2.6.22/2.6.22-ovz005.1&amp;diff=3635"/>
		<updated>2007-11-16T22:47:54Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Remove trailing cruft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- {{OldKernelWarning|2.6.22}} --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DevelKernel}}&lt;br /&gt;
{{KernelInstallInfo}}&lt;br /&gt;
{{KernelChangeLogInfo|2.6.22|ovz005}}&lt;br /&gt;
&lt;br /&gt;
== RPMS ==&lt;br /&gt;
{{KernelFlavorsInfo}}&lt;br /&gt;
&lt;br /&gt;
=== {{x86}} ===&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=i686|size=18 Mb}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=i686|size=18 Mb|flavor=-debug}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=i686|size=19 Mb|flavor=-PAE}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=i686|size=19 Mb|flavor=-PAE-debug}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
=== {{x86_64}} ===&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=x86_64|size=19 Mb}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=x86_64|size=19 Mb|flavor=-debug}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
=== {{IA64}} ===&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=ia64|size=30 Mb}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PPC64 ===&lt;br /&gt;
&lt;br /&gt;
* RPMS will be provided in future releases.&lt;br /&gt;
&lt;br /&gt;
=== SPARC ===&lt;br /&gt;
&lt;br /&gt;
* SPARC support for RPM-based distributions is available in source form only.&lt;br /&gt;
Please download the patch below and recompile the kernel. More info about&lt;br /&gt;
kernel recompiling is available at [[Kernel build#Rebuilding kernel from sources]].&lt;br /&gt;
&lt;br /&gt;
== Source RPM ==&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=src|size=44 Mb}}&lt;br /&gt;
{{KernelDownloadTableRow|ver=2.6.22|rel=ovz005.1|arch=nosrc|size=1.1 Mb}}&lt;br /&gt;
{{KernelDownloadTableRowFile|ver=2.6.22|rel=ovz005.1|file=kernel-ovz.spec|size=16 Kb}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
== Kernel patch ==&lt;br /&gt;
&lt;br /&gt;
This patch is applicable to vanilla Linux 2.6.22 kernel&lt;br /&gt;
(available from [http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2 kernel.org])&lt;br /&gt;
to form the OpenVZ kernel.&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRowPatch|ver=2.6.22|rel=ovz005.1|size=856 Kb}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;br /&gt;
&lt;br /&gt;
== Configs ==&lt;br /&gt;
&amp;lt;p&amp;gt;Official configs of this OpenVZ kernel &lt;br /&gt;
used to build binary RPMS.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{KernelDownloadTableHead}}&lt;br /&gt;
{{KernelDownloadTableRowConfig|ver=2.6.22|rel=ovz005.1|config=i686|size=67 Kb}}&lt;br /&gt;
{{KernelDownloadTableRowConfig|ver=2.6.22|rel=ovz005.1|config=i686-PAE|size=67 Kb}}&lt;br /&gt;
{{KernelDownloadTableRowConfig|ver=2.6.22|rel=ovz005.1|config=x86_64|size=63 Kb}}&lt;br /&gt;
{{KernelDownloadTableRowConfig|ver=2.6.22|rel=ovz005.1|config=ia64|size=58 Kb}}&lt;br /&gt;
{{KernelDownloadTableRowConfig|ver=2.6.22|rel=ovz005.1|config=ppc64|size=57 Kb}}&lt;br /&gt;
{{KernelDownloadTableTail}}&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Updating_Debian_template&amp;diff=3620</id>
		<title>Updating Debian template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Updating_Debian_template&amp;diff=3620"/>
		<updated>2007-11-16T00:51:47Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: I think the common abbreviation for Hardware Node is HN, not HW. Also why does it suddenly use VE0?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article describes how you can update an existing precreated Debian or Ubuntu template. The procedure is pretty easy.&lt;br /&gt;
&lt;br /&gt;
== Creating/configuring a temporary VE ==&lt;br /&gt;
&lt;br /&gt;
First, you need to create a VE based on the template you want to update. Here is an example:&lt;br /&gt;
&lt;br /&gt;
 [HN]# vzctl create 555 --ostemplate debian-4.0-i386-minimal&lt;br /&gt;
&lt;br /&gt;
Next, you want to specify an IP address and a nameserver:&lt;br /&gt;
 [HN]# vzctl set 555 --ipadd x.x.x.x --nameserver y.y.y.y --save&lt;br /&gt;
&lt;br /&gt;
You can get the value of nameserver from your /etc/resolv.conf. Your VE should have an Internet access, so you either supply a public IP, or see [[using NAT for VE with private IPs]] for information about how to use private IP and NAT.&lt;br /&gt;
&lt;br /&gt;
Finally, check that Internet is working from inside a VE:&lt;br /&gt;
 [HN]# vzctl exec 555 ping -n 3 www.ru&lt;br /&gt;
&lt;br /&gt;
== Update ==&lt;br /&gt;
 &lt;br /&gt;
Enter the VE:&lt;br /&gt;
 [HN]# vzctl enter 555&lt;br /&gt;
&lt;br /&gt;
Update metadata 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;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Clean unused log files, .bash_history etc, then exit from a VE:&lt;br /&gt;
 [VE] # exit&lt;br /&gt;
&lt;br /&gt;
Stop a VE, remove its IP:&lt;br /&gt;
 [VE0]# vzctl stop 555&lt;br /&gt;
 [VE0]# vzctl set 555 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
== Packing a new template cache ==&lt;br /&gt;
&lt;br /&gt;
Now, rename the existing template cache:&lt;br /&gt;
 [HN]# mv /vz/template/cache/debian-4.0-i386-minimal.tar.gz{,-old}&lt;br /&gt;
&lt;br /&gt;
Now create a new tarball:&lt;br /&gt;
 [HN]# cd /vz/private/555&lt;br /&gt;
 [HN]# tar czf /vz/template/cache/debian-4.0-i386-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Clean up:&lt;br /&gt;
 [HN]# vzctl destroy 555&lt;br /&gt;
 [HN]# rm -f /etc/vz/conf/555.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Test new template cache ==&lt;br /&gt;
&lt;br /&gt;
First, compare the sizes of the old and the new template caches:&lt;br /&gt;
 [HN]# ls -lh /vz/template/cache/debian-4.0-i386-minimal*&lt;br /&gt;
 -rw-r--r-- 1 root root  55M 2007-11-13 18:11 /vz/template/cache/debian-4.0-i386-minimal.tar.gz&lt;br /&gt;
 -rw-r--r-- 1 root root  53M 2007-08-31 02:46 /vz/template/cache/debian-4.0-i386-minimal.tar.gz-old&lt;br /&gt;
The sizes should not differ much.&lt;br /&gt;
&lt;br /&gt;
Try to create and start VE made from your new template:&lt;br /&gt;
 [HN]# vzctl create 222 --ostemplate debian-4.0-i386-minimal&lt;br /&gt;
 [HN]# vzctl set 222 --ipadd 10.0.0.222 --save&lt;br /&gt;
 [HN]# vzctl start 222&lt;br /&gt;
 [HN]# vzctl enter 222&lt;br /&gt;
&lt;br /&gt;
Now execute a few basic commands to check VE is fine. Examples are: &amp;lt;code&amp;gt;ps axf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpkg -l&amp;lt;/code&amp;gt;, etc.&lt;br /&gt;
&lt;br /&gt;
Finally, clean up the testing VE:&lt;br /&gt;
 [HN]# vzctl stop 222&lt;br /&gt;
 [HN]# vzctl destroy 222&lt;br /&gt;
 [HN]# rm -f /etc/vz/conf/222.conf.destroyed&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3619</id>
		<title>NFS server inside container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3619"/>
		<updated>2007-11-16T00:49:08Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: /* User-space NFS server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two ways to setup NFS server on common [[HN]]:&lt;br /&gt;
use a user-space NFS server daemon or use an in-kernel implementation&lt;br /&gt;
of NFS server. Some peculiarities appear if you intend to run NFS server&lt;br /&gt;
in [[VE]].&lt;br /&gt;
&lt;br /&gt;
{{Note|for information about NFS client inside VE, see [[NFS]].}}&lt;br /&gt;
&lt;br /&gt;
== Kernel NFS server ==&lt;br /&gt;
Binary RPMs that are provided by OpenVZ community contain kernels compiled&lt;br /&gt;
without NFS server support. Thus you have to&lt;br /&gt;
[[Kernel build|recompile the kernel]] with &amp;lt;code&amp;gt;CONFIG_NFSD=m&amp;lt;/code&amp;gt;. After booting in this kernel you'll be able&lt;br /&gt;
to use NFS server on [[HN]].&lt;br /&gt;
In-kernel NFS server runs kernel threads to service requests of clients.&lt;br /&gt;
But for security reasons kernel threads are prohibited in [[VE]]s! So you won't&lt;br /&gt;
be able to run NFS server inside [[VE]] without patching the kernel.&lt;br /&gt;
&lt;br /&gt;
== User-space NFS server ==&lt;br /&gt;
Advantage of user-space NFS server is that it does not require kernel support.&lt;br /&gt;
Also if it crashes — there is no crash of the system: just one process dies, not the kernel!&lt;br /&gt;
The disadvantage of user-space NFS server is its productivity: no one can be faster than in-kernel implementation.&lt;br /&gt;
&lt;br /&gt;
One well-known implementation of NFS server is &amp;quot;The LINUX User-Space NFS Server&amp;quot; by Olaf Kirch.&lt;br /&gt;
Some Linux distributions contain this package: Debian Sarge (&amp;lt;code&amp;gt;nfs-user-server&amp;lt;/code&amp;gt;), OpenSUSE 10.0 (&amp;lt;code&amp;gt;nfs-server&amp;lt;/code&amp;gt;).&lt;br /&gt;
For other distributions you can download sources (for example from Debian repository) and compile it.&lt;br /&gt;
There is a small trick you have to know about running &amp;lt;code&amp;gt;mountd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nfsd&amp;lt;/code&amp;gt; (these two daemons and &amp;lt;code&amp;gt;portmap&amp;lt;/code&amp;gt; constitute a user-space server).  You should run them with the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# portmap&lt;br /&gt;
# rpc.mountd -r&lt;br /&gt;
# rpc.nfsd -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The reason is that these daemons check the major number of the device where the directory to export resides.&lt;br /&gt;
If major equals 0 then daemons assume that it is NFS and don't want to re-export it. Symptoms are&lt;br /&gt;
that clients will always get a &amp;quot;permission denied&amp;quot; error. Simfs (the file system on which VE is located)&lt;br /&gt;
is associated with so called unnamed device, in which major equals 0. So, to prevent daemons from checking for&lt;br /&gt;
re-exporting — just use this &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
“The LINUX User-Space NFS Server” by Olaf Kirch implements NFSv2. It means that only files with sizes less&lt;br /&gt;
than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server&lt;br /&gt;
implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard.&lt;br /&gt;
&lt;br /&gt;
Please note that the user-space NFS server does not provide locking, or at least I couldn't get locking to work - [[User:Elronxenu|Elronxenu]] 19:49, 15 November 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://nfs.sourceforge.net/ Linux NFS Overview, FAQ and HOWTO Documents]&lt;br /&gt;
* [http://www.tldp.org/LDP/nag/nag.html The Network Administrators' Guide by Olaf Kirch]&lt;br /&gt;
* [http://unfs3.sourceforge.net/ unfs3 homepage]&lt;br /&gt;
* [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server  source package]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=VPN_using_IPsec&amp;diff=3618</id>
		<title>VPN using IPsec</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=VPN_using_IPsec&amp;diff=3618"/>
		<updated>2007-11-16T00:46:25Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: How to get vpnc working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An OpenVZ VE can join an IPsec VPN - specifically the type provided by the Cisco VPN client and 'vpnc' package.&lt;br /&gt;
&lt;br /&gt;
== Using the Cisco VPN client ==&lt;br /&gt;
&lt;br /&gt;
The Cisco VPN client can be downloded from Cisco, if you have an account with them. It builds a kernel module.&lt;br /&gt;
&lt;br /&gt;
I have not tested this, so I don't have any instructions to set it up.&lt;br /&gt;
&lt;br /&gt;
[[User:Elronxenu|Elronxenu]] 19:46, 15 November 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
== Using the 'vpnc' package ==&lt;br /&gt;
&lt;br /&gt;
The vpnc package is part of Debian.&lt;br /&gt;
It runs entirely in userspace. There's a daemon which communicates with a remote VPN gateway and provides a local TUN device as a network interface for the VE to use.&lt;br /&gt;
Here are brief instructions to get it going:&lt;br /&gt;
&lt;br /&gt;
# Use revision ovz028stab047 or later. Earlier revisions are unable to create a raw socket of the necessary protocol.&lt;br /&gt;
# Enable the TUN device within your VE. See [[VPN via the TUN/TAP device]].&lt;br /&gt;
# Firewall configuration: allow UDP port 500 in and out of your client. This is used for authentication setup.&lt;br /&gt;
# Firewall configuration: allow protocol 50 (0x32) in and out of your client. This is used for VPN data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Kernel_Build_Problems&amp;diff=3617</id>
		<title>Kernel Build Problems</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Kernel_Build_Problems&amp;diff=3617"/>
		<updated>2007-11-16T00:36:40Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add to Troubleshooting category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem: OpenVZ 2.6.18 + patch-ovz028stab047.1 fails to build ==&lt;br /&gt;
&lt;br /&gt;
Building a 2.6.18 kernel with patch-ovz028stab047.1 fails in Stage 2 with an error related to grsecurity.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Make the following 1-line patch to grsecurity/grsec_disabled.c, configure the kernel to disable grsecurity and build the kernel again.&lt;br /&gt;
&lt;br /&gt;
 --- ./grsecurity/grsec_disabled.c.ve9999        2007-10-29 20:51:17.000000000 +0300&lt;br /&gt;
 +++ ./grsecurity/grsec_disabled.c       2007-11-02 15:20:00.000000000 +0300&lt;br /&gt;
 @@ -1,5 +1,6 @@&lt;br /&gt;
  #include &amp;lt;linux/kernel.h&amp;gt;&lt;br /&gt;
  #include &amp;lt;linux/sched.h&amp;gt;&lt;br /&gt;
 +#include &amp;lt;linux/module.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  void&lt;br /&gt;
  gr_copy_label(struct task_struct *tsk)&lt;br /&gt;
&lt;br /&gt;
I believe this problem is solved in the 049 version of the patch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Kernel_Build_Problems&amp;diff=3616</id>
		<title>Kernel Build Problems</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Kernel_Build_Problems&amp;diff=3616"/>
		<updated>2007-11-16T00:29:38Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Solving kernel build problems&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem: OpenVZ 2.6.18 + patch-ovz028stab047.1 fails to build ==&lt;br /&gt;
&lt;br /&gt;
Building a 2.6.18 kernel with patch-ovz028stab047.1 fails in Stage 2 with an error related to grsecurity.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
Make the following 1-line patch to grsecurity/grsec_disabled.c, configure the kernel to disable grsecurity and build the kernel again.&lt;br /&gt;
&lt;br /&gt;
 --- ./grsecurity/grsec_disabled.c.ve9999        2007-10-29 20:51:17.000000000 +0300&lt;br /&gt;
 +++ ./grsecurity/grsec_disabled.c       2007-11-02 15:20:00.000000000 +0300&lt;br /&gt;
 @@ -1,5 +1,6 @@&lt;br /&gt;
  #include &amp;lt;linux/kernel.h&amp;gt;&lt;br /&gt;
  #include &amp;lt;linux/sched.h&amp;gt;&lt;br /&gt;
 +#include &amp;lt;linux/module.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  void&lt;br /&gt;
  gr_copy_label(struct task_struct *tsk)&lt;br /&gt;
&lt;br /&gt;
I believe this problem is solved in the 049 version of the patch.&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Testimonials&amp;diff=3602</id>
		<title>Testimonials</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Testimonials&amp;diff=3602"/>
		<updated>2007-11-15T02:36:26Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add my imprimatur to OpenVZ&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Following are some comments we've received from OpenVZ users.'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'm curious.  For the past few months, people@openvz.org have discovered&lt;br /&gt;
(and fixed) an ongoing stream of obscure but serious and quite&lt;br /&gt;
long-standing bugs.&lt;br /&gt;
&lt;br /&gt;
How are you discovering these bugs?&lt;br /&gt;
&lt;br /&gt;
''Andrew Morton, [http://openvz.org/pipermail/devel/2007-July/006281.html Devel mainling list]''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I just wanted to congratulate you and the rest of the OpenVZ team for your&lt;br /&gt;
excellent, excellent work. We are now have an OpenVZ subject in our 120&lt;br /&gt;
hours Total Linux course here at the Bluepoint Foundation, and our&lt;br /&gt;
students really appreciate the work you've done. I'm learning a lot from&lt;br /&gt;
lurking in the devel list too. Thanks again and keep 'em coming! :D&lt;br /&gt;
&lt;br /&gt;
''Engels Antonio, [http://bluepoint.com.ph/ Bluepoint Foundation]''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I would say, OpenVZ is '''United States of Linux''' because i can run all my lovely different type of GNU/Linux distributions(States) on '''one single machine''' with '''one kernel''' model. As stable as guaranteed for production server and handy for software development (well no more dual, tri, quad boot partition). After all, it is just a good quality software piece for Linux User. Again, welcome to '''United States of Linux''' world!!&lt;br /&gt;
&lt;br /&gt;
''Victor, System Admin, [http://www.kholix.com kholix.com]''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks for producing OpenVZ, we use it ourselves at PlanetMirror and&lt;br /&gt;
find that it's fantastic.&lt;br /&gt;
&lt;br /&gt;
''Robert McLeay, PlanetMirror.com stuff''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OpenVZ is about the greatest thing we've ever found, and we're SO glad for it.&lt;br /&gt;
&lt;br /&gt;
''Gregor Mosheh, HostGIS'' [https://openvz.org/pipermail/users/2007-August/001104.html]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OpenVZ has me seriously impressed, I was looking to try virtualisation technology and got OpenVZ up and running in only 3 trips to the coffee machine! ''-barf''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hello all, just downloaded and installed OpenVZ, and i must say its a big improvement over other VPS systems that i have tested IMHO.&lt;br /&gt;
[http://forum.openvz.org/index.php?t=tree&amp;amp;goto=646&amp;amp;#msg_646]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Virtuozzo and openvz are wonderful - I don't know why more people aren't&lt;br /&gt;
using them. I hear a lot of hype for xen and usermode but&lt;br /&gt;
virtuozzo/openvz is so great for many common needs.&lt;br /&gt;
[http://forum.openvz.org/index.php?t=rview&amp;amp;goto=650#msg_650]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For my needs, OpenVZ is better than Xen. The one-kernel approach conserves memory, leaving more for applications. And having all VPS in one disk partition saves disk space. A surprise bonus was the template cache management with yum. The ease of keeping templates updated and quickly installing new operating environments is yummy!&lt;br /&gt;
[http://forum.openvz.org/index.php?t=rview&amp;amp;goto=3119#msg_3119]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Last week when we were in limbo about what to do, it was decided to try out XEN Virtualization. From what is written in the press the Xen system has alot of promise, Features such as opensource with live migration and backups sounds great; but was far too complicated to get working in our configuration. OpenVZ was the only virtual server system that was simple to install and get working.&lt;br /&gt;
[http://forum.openvz.org/index.php?t=msg&amp;amp;goto=568#msg_568]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It still amazes me how well OpenVZ works.&lt;br /&gt;
[http://forum.openvz.org/index.php?t=msg&amp;amp;th=368&amp;amp;#msg_2086]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[03:30:15] &amp;lt;pookey&amp;gt; well, I've been using openvz for all of about an hour, and I'm pretty impressed so far :)&amp;lt;br/&amp;gt;&lt;br /&gt;
''from #openvz IRC channel''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I am playing around for years with all major virtualization environments like all VMware products, Microsoft and several xen based solutions. But OpenVZ is the overall winner. [http://blog.openvz.org/14313.html]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I messed around with VMWare and Xen. I found VMWare to be somewhat over kill and Xen was damned hard to get working. The user community on the Xen mailing list is rather hostile. It looked like A number of people hang out there for the sole purpose of flaming the clueless.&lt;br /&gt;
&lt;br /&gt;
I've found the OpenVZ folks to be very helpful and knowledgeable. OpenVZ is simple to install and get running. It pretty much satisfies my needs. [http://blog.openvz.org/14313.html?thread=17897#t17897]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'm a sysadm and have always used xen/qemu/virtualbox/vmware server for my VMs and my customer's ones. Yesterday I decided to give OpenVZ a try and... I'm amazed. It's fast, easy and reliable.Live migration works like a charm and the use of rsync assures low data transfers. Great. [http://forum.openvz.org/index.php?t=tree&amp;amp;goto=14724&amp;amp;#msg_14724]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OpenVZ is one of the few pieces of software that I truly love. It works wonderfully. It should become part of the mainline kernel. ''Nick Andrew [http://www.nick-andrew.net/]''&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Grsecurity&amp;diff=3572</id>
		<title>Grsecurity</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Grsecurity&amp;diff=3572"/>
		<updated>2007-11-07T22:35:00Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a huge demand from people for support of grsecurity on OpenVZ.&lt;br /&gt;
However, unfortunately, grsecurity patch doesn't work as is (nor even applies) with OpenVZ kernel.&lt;br /&gt;
There were some efforts of supporting grsec in [http://bugzilla.openvz.org/show_bug.cgi?id=601 bug #607], but&lt;br /&gt;
failed and the grsecurity patch was never stable with OpenVZ.&lt;br /&gt;
&lt;br /&gt;
So instead OpenVZ team selected another approach. We port the features of grsecurity most requested by users and add them, maintain,&lt;br /&gt;
document and support.&lt;br /&gt;
&lt;br /&gt;
== TPE (Trusted Path Execution) ==&lt;br /&gt;
&lt;br /&gt;
Starting from 2.6.18-028stab047.1 stable kernels OpenVZ kernels support TPE grsecurity feature out of the box.&lt;br /&gt;
Which means root user can configure TPE inside VE as usually accessing the following /proc files:&lt;br /&gt;
* /proc/sys/kernel/grsecurity/grsec_lock&lt;br /&gt;
* /proc/sys/kernel/grsecurity/tpe&lt;br /&gt;
* /proc/sys/kernel/grsecurity/tpe_gid&lt;br /&gt;
* /proc/sys/kernel/grsecurity/tpe_restrict_all&lt;br /&gt;
&lt;br /&gt;
To enable TPE feature standard way just type:&lt;br /&gt;
 # echo &amp;lt;GID&amp;gt; &amp;gt; /proc/sys/kernel/grsecurity/tpe_gid&lt;br /&gt;
 # echo 1 &amp;gt; /proc/sys/kernel/grsecurity/tpe&lt;br /&gt;
 ' lock grsecurity settings&lt;br /&gt;
 # echo 1 &amp;gt; /proc/sys/kernel/grsecurity/grsec_lock&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=3570</id>
		<title>Debian template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Debian_template_creation&amp;diff=3570"/>
		<updated>2007-11-07T14:51:52Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add note for woody and its location&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are rough instructions of how to manually create basic Debian Etch (4.0) template cache, which can be used to create OpenVZ [[VE]]s based on Debian Etch (4.0).&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
* You shouldn't be running as root, but as a user that is permitted to use sudo instead.  It's a dangerous idea, run as root at your peril.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;/vz&amp;lt;/tt&amp;gt;, you might really need to use &amp;lt;tt&amp;gt;/var/lib/vz&amp;lt;/tt&amp;gt; instead, especially on a Debian Etch host.&lt;br /&gt;
* Anywhere you see &amp;lt;tt&amp;gt;http://debian.osuosl.org/debian/&amp;lt;/tt&amp;gt;, you can substitute your favorite Debian mirror.  ([http://www.debian.org/mirror/list List of official Debian Mirrors])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
You need to have a working copy of &amp;lt;tt&amp;gt;debootstrap&amp;lt;/tt&amp;gt; running on your hardware node.&lt;br /&gt;
&lt;br /&gt;
For Debian:&lt;br /&gt;
 sudo apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
For Gentoo:&lt;br /&gt;
 sudo emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
For other distros you might need to install it from sources, or search for an appropriate package for your distribution.  An RPM is available on the [http://forum.openvz.org/index.php?t=tree&amp;amp;th=142&amp;amp;mid=584 OpenVZ Forum].&lt;br /&gt;
&lt;br /&gt;
== Bootstrapping Debian ==&lt;br /&gt;
&lt;br /&gt;
You can install different releases of Debian into a VE's private directory using the debootstrap command.&lt;br /&gt;
&lt;br /&gt;
The command parameters are:&lt;br /&gt;
&lt;br /&gt;
  debootstrap --arch ARCH NAME DIRECTORY URL&lt;br /&gt;
&lt;br /&gt;
Specify your architecture instead of &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; if you're using something other than i386/x86.  For example, for AMD64/x86_64, use &amp;lt;tt&amp;gt;amd64&amp;lt;/tt&amp;gt; or for ia64, use &amp;lt;tt&amp;gt;ia64&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We use VE ID of 777 for this example; surely it can be any other unused ID.&lt;br /&gt;
&lt;br /&gt;
=== Etch (current Debian stable) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap --arch i386 etch /vz/private/777 http://debian.osuosl.org/debian/&lt;br /&gt;
&lt;br /&gt;
=== Sarge (old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap sarge /vz/private/777 http://http.us.debian.org/debian&lt;br /&gt;
&lt;br /&gt;
=== Woody (very old release) ===&lt;br /&gt;
&lt;br /&gt;
 debootstrap woody /vz/private/777 http://archive.debian.org/&lt;br /&gt;
&lt;br /&gt;
== Preparing and starting the VE ==&lt;br /&gt;
&lt;br /&gt;
=== Setting VE config ===&lt;br /&gt;
First, we need a config for the [[VE]]:&lt;br /&gt;
 sudo 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;
 sudo sh -c 'echo &amp;quot;OSTEMPLATE=debian-4.0&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;
 sudo 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;
 sudo vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== Starting VE ===&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 sudo vzctl start 777&lt;br /&gt;
&lt;br /&gt;
== Customizing the installation ==&lt;br /&gt;
A few things need to be done inside a newly created VE for it to become suitable for OpenVZ.  All those things are done inside the VE, so first command is:&lt;br /&gt;
 sudo vzctl enter 777&lt;br /&gt;
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin&lt;br /&gt;
&lt;br /&gt;
{{Note|'''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;
=== Set Debian repositories ===&lt;br /&gt;
 cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/apt/sources.list&lt;br /&gt;
 deb http://debian.osuosl.org/debian/ etch main contrib&lt;br /&gt;
 deb http://security.debian.org etch/updates main contrib&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
=== Get new security updates ===&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install some more packages ===&lt;br /&gt;
Installing packages could be an interactive process so the system might ask some questions.  You can install more packages if you'd like.  For example:&lt;br /&gt;
 apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
=== Set sane permissions for &amp;lt;tt&amp;gt;/root&amp;lt;/tt&amp;gt; directory ===&lt;br /&gt;
 chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
=== Disable root login ===&lt;br /&gt;
This will disable root login by default.&lt;br /&gt;
 usermod -L root&lt;br /&gt;
&lt;br /&gt;
=== Disable getty ===&lt;br /&gt;
Disable running &amp;lt;tt&amp;gt;getty&amp;lt;/tt&amp;gt;s on terminals as a VE does not have any:&lt;br /&gt;
 sed -i -e '/getty/d' /etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== Disable &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; for syslog ===&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;tt&amp;gt;syslog&amp;lt;/tt&amp;gt;'s log files, to improve I/O performance:&lt;br /&gt;
 &amp;lt;pre&amp;gt;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;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
Link &amp;lt;tt&amp;gt;/etc/mtab&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/proc/mounts&amp;lt;/tt&amp;gt;, so &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; and friends will work:&lt;br /&gt;
 rm -f /etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
=== Remove some unneeded packages ===&lt;br /&gt;
If you have any packages you'd like to remove, now's the time for it.  Here's an example:&lt;br /&gt;
 dpkg --purge modutils ppp pppoeconf pppoe pppconfig&lt;br /&gt;
&lt;br /&gt;
=== Disable services ===&lt;br /&gt;
Do not start some services, stick to bare minimum:&lt;br /&gt;
 update-rc.d -f klogd remove&lt;br /&gt;
 update-rc.d -f quotarpc remove&lt;br /&gt;
 update-rc.d -f exim4 remove&lt;br /&gt;
 update-rc.d -f inetd remove&lt;br /&gt;
&lt;br /&gt;
=== Fix SSH host keys ===&lt;br /&gt;
This is only useful if you installed SSH.  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/bash&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;
=== 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;
 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;
 exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&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;
 sudo vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Also, remove DNS server and search domain information from ''/etc/resolv.conf'' file '''in VE''':&lt;br /&gt;
 sudo nano /vz/private/777/etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 sudo vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Go to the VE directory:&lt;br /&gt;
 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;tt&amp;gt;i386&amp;lt;/tt&amp;gt; with your architecture (i386, amd64, ia64, etc).&lt;br /&gt;
 sudo tar -zcf /vz/template/cache/debian-4.0-i386-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  51M Apr 10 03:16 debian-4.0-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Checking if template cache works ==&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;
 sudo vzctl create 123456 --ostemplate debian-4.0-i386-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that it works:&lt;br /&gt;
 sudo vzctl start 123456&lt;br /&gt;
 sudo vzctl exec 123456 ps ax&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 sudo vzctl stop 123456&lt;br /&gt;
 sudo vzctl destroy 123456&lt;br /&gt;
 sudo rm /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;
 sudo vzctl destroy 777&lt;br /&gt;
 sudo rm /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS&amp;diff=3547</id>
		<title>NFS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS&amp;diff=3547"/>
		<updated>2007-10-29T02:24:02Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add a note about debian&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to mount NFS partition inside VE.&lt;br /&gt;
&lt;br /&gt;
== NFS server ==&lt;br /&gt;
Currently OpenVZ kernel doesn't include kernel NFS server support. However you are still able to use user space [[NFS server inside VE]].&lt;br /&gt;
&lt;br /&gt;
== NFS client ==&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
You will need the following software:&lt;br /&gt;
&lt;br /&gt;
# [http://openvz.org/download/utils#vzctl vzctl] version 3.0.13 or higher (do &amp;lt;code&amp;gt;vzctl --version&amp;lt;/code&amp;gt;)&lt;br /&gt;
# [http://openvz.org/download/kernel/ kernel] version 2.6.18-028test006 or higher (2.6.18-028stab* will do), or any recent RHEL5-based or 2.6.20-based kernel.&lt;br /&gt;
&lt;br /&gt;
Note: In all the kernels earlier than 028stab038, kernel NFS support can be given to a VE by setting:&lt;br /&gt;
&lt;br /&gt;
      sunrpc.ve_allow_rpc = 1&lt;br /&gt;
      fs.nfs.ve_allow_nfs = 1&lt;br /&gt;
      kernel.ve_allow_kthreads = 1&lt;br /&gt;
&lt;br /&gt;
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running &amp;lt;code&amp;gt;sysctl -p&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Debian Notes =====&lt;br /&gt;
&lt;br /&gt;
Debian Etch still uses vzctl version 3.0.11 and so NFS client support is not yet available. Lenny presently has version 3.0.18.&lt;br /&gt;
&lt;br /&gt;
==== Prepare the HN ====&lt;br /&gt;
&lt;br /&gt;
For NFS mounts to work in the VEs with the RHEL5-based kernels you must enable kernel threads in the VE by setting &amp;quot;kernel.ve_allow_kthreads=1&amp;quot; in /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe nfs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Prepare the VE ====&lt;br /&gt;
To allow a VE use NFS filesystem, you will need to start it with &amp;quot;nfs&amp;quot; feature enabled. If the VE is running while you set the --features &amp;quot;nfs:on&amp;quot;, you will need to reboot it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl set 101 --features &amp;quot;nfs:on&amp;quot; --save&lt;br /&gt;
# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this you may see nfs in &amp;lt;code&amp;gt;/proc/filesystems&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl exec 101 cat /proc/filesystems&lt;br /&gt;
        ext3&lt;br /&gt;
        ext2&lt;br /&gt;
nodev   rpc_pipefs&lt;br /&gt;
nodev   proc&lt;br /&gt;
nodev   nfs&lt;br /&gt;
nodev   sysfs&lt;br /&gt;
nodev   tmpfs&lt;br /&gt;
nodev   devpts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mounting NFS ===&lt;br /&gt;
Assuming that you already have NFS server set up at &amp;lt;code&amp;gt;192.168.0.1:/nfs_pub&amp;lt;/code&amp;gt; mounting will be simple&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl enter 100&lt;br /&gt;
# mkdir /nfs&lt;br /&gt;
# mount -t nfs 192.168.0.1:/nfs_pub /nfs&lt;br /&gt;
# cat /proc/mounts &lt;br /&gt;
simfs / simfs rw 0 0&lt;br /&gt;
proc /proc proc rw 0 0&lt;br /&gt;
sysfs /sys sysfs rw 0 0&lt;br /&gt;
devpts /dev/pts devpts rw 0 0&lt;br /&gt;
nfs /nfs nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.0.1 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details on how to setup NFS mount see [http://nfs.sourceforge.net/nfs-howto/ar01s04.htm NFS-client HOWTO]&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
There are quite a few parameters in NFS, so sometimes it doesn't work due to misconfiguration. We created a separate&lt;br /&gt;
page for discribing such situation: [[ NFS doesn't work ]]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS&amp;diff=3546</id>
		<title>NFS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS&amp;diff=3546"/>
		<updated>2007-10-29T02:15:17Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: note vzctl version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to mount NFS partition inside VE.&lt;br /&gt;
&lt;br /&gt;
== NFS server ==&lt;br /&gt;
Currently OpenVZ kernel doesn't include kernel NFS server support. However you are still able to use user space [[NFS server inside VE]].&lt;br /&gt;
&lt;br /&gt;
== NFS client ==&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
You will need the following software:&lt;br /&gt;
&lt;br /&gt;
# [http://openvz.org/download/utils#vzctl vzctl] version 3.0.13 or higher (do &amp;lt;code&amp;gt;vzctl --version&amp;lt;/code&amp;gt;)&lt;br /&gt;
# [http://openvz.org/download/kernel/ kernel] version 2.6.18-028test006 or higher (2.6.18-028stab* will do), or any recent RHEL5-based or 2.6.20-based kernel.&lt;br /&gt;
&lt;br /&gt;
Note: In all the kernels earlier than 028stab038, kernel NFS support can be given to a VE by setting:&lt;br /&gt;
&lt;br /&gt;
      sunrpc.ve_allow_rpc = 1&lt;br /&gt;
      fs.nfs.ve_allow_nfs = 1&lt;br /&gt;
      kernel.ve_allow_kthreads = 1&lt;br /&gt;
&lt;br /&gt;
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running &amp;lt;code&amp;gt;sysctl -p&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Prepare the HN ====&lt;br /&gt;
&lt;br /&gt;
For NFS mounts to work in the VEs with the RHEL5-based kernels you must enable kernel threads in the VE by setting &amp;quot;kernel.ve_allow_kthreads=1&amp;quot; in /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe nfs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Prepare the VE ====&lt;br /&gt;
To allow a VE use NFS filesystem, you will need to start it with &amp;quot;nfs&amp;quot; feature enabled. If the VE is running while you set the --features &amp;quot;nfs:on&amp;quot;, you will need to reboot it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl set 101 --features &amp;quot;nfs:on&amp;quot; --save&lt;br /&gt;
# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this you may see nfs in &amp;lt;code&amp;gt;/proc/filesystems&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl exec 101 cat /proc/filesystems&lt;br /&gt;
        ext3&lt;br /&gt;
        ext2&lt;br /&gt;
nodev   rpc_pipefs&lt;br /&gt;
nodev   proc&lt;br /&gt;
nodev   nfs&lt;br /&gt;
nodev   sysfs&lt;br /&gt;
nodev   tmpfs&lt;br /&gt;
nodev   devpts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mounting NFS ===&lt;br /&gt;
Assuming that you already have NFS server set up at &amp;lt;code&amp;gt;192.168.0.1:/nfs_pub&amp;lt;/code&amp;gt; mounting will be simple&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl enter 100&lt;br /&gt;
# mkdir /nfs&lt;br /&gt;
# mount -t nfs 192.168.0.1:/nfs_pub /nfs&lt;br /&gt;
# cat /proc/mounts &lt;br /&gt;
simfs / simfs rw 0 0&lt;br /&gt;
proc /proc proc rw 0 0&lt;br /&gt;
sysfs /sys sysfs rw 0 0&lt;br /&gt;
devpts /dev/pts devpts rw 0 0&lt;br /&gt;
nfs /nfs nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.0.1 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details on how to setup NFS mount see [http://nfs.sourceforge.net/nfs-howto/ar01s04.htm NFS-client HOWTO]&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
There are quite a few parameters in NFS, so sometimes it doesn't work due to misconfiguration. We created a separate&lt;br /&gt;
page for discribing such situation: [[ NFS doesn't work ]]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=X_inside_VE&amp;diff=3542</id>
		<title>X inside VE</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=X_inside_VE&amp;diff=3542"/>
		<updated>2007-10-27T12:40:11Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several ways to run X applications inside your [[VE]].&lt;br /&gt;
&lt;br /&gt;
== X forwarding ==&lt;br /&gt;
&lt;br /&gt;
To run an X application inside a [[VE]], one need simply to connect to a VE with '''ssh -X''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host# ssh -2 -c blowfish -X user@address&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After login to VE check that &amp;lt;code&amp;gt;$DISPLAY&amp;lt;/code&amp;gt; variable is set and X11 forwarding is enabled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# echo $DISPLAY&lt;br /&gt;
localhost:10.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case &amp;lt;code&amp;gt;$DISPLAY&amp;lt;/code&amp;gt; is not set, make sure that X forwarding is enabled in &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; config inside VE. In most Linux distros sshd configuration is stored in &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;. You should set parameter &amp;lt;code&amp;gt;X11Forwarding&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;yes&amp;lt;/code&amp;gt;. Also VE should contain &amp;lt;code&amp;gt;xauth&amp;lt;/code&amp;gt; package, thus install &amp;lt;code&amp;gt;xauth&amp;lt;/code&amp;gt; if it is missing (in Debian this is part of the xbase-clients package). After that, restart your sshd daemon:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# /etc/init.d/sshd restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Don't forget to reconnect after this}}&lt;br /&gt;
&lt;br /&gt;
Now you can run X applications from your VE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# firefox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that if you want to run complete X window environment (including window manager), you should kill local window manager and run only pure X server. Secondly you shoud use  '''-Y''' option when invoking ssh. And if you want to run gnome/kde/..., don't forget to increase [[UBC]] limits, 'cause default values are certainly too small for these monsters. ;)&lt;br /&gt;
&lt;br /&gt;
== VNC for X desktop ==&lt;br /&gt;
First, one need to run '''Xvnc''' server inside VE. The easiest way for this is to run&lt;br /&gt;
'''vncserver''' script. This scripts starts all the required services&lt;br /&gt;
and small http daemon which provides graphical web access to your desktop (via Java applet).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# vncserver -name mydesktop&lt;br /&gt;
New 'mydekstop' desktop is ve:1&lt;br /&gt;
&lt;br /&gt;
Starting applications specified in ~/.vnc/xstartup&lt;br /&gt;
Log file is ~/.vnc/ve:1.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when your desktop is up and running you can connect to it&lt;br /&gt;
using '''vncviewer''' command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host# vncviewer &amp;lt;VE_IP&amp;gt;:1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the VNC desktop is the same size or larger than your X desktop, you will see scroll bars on the bottom and the side.  This is often inconvenient. You may reduce your VNC desktop to a more reasonable size like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver -geometry 1000x650&amp;lt;/pre&amp;gt;&lt;br /&gt;
This setting works quite well for a 1024 by 768 X desktop setting.&lt;br /&gt;
&lt;br /&gt;
=== Starting KDE desktop with VNC ===&lt;br /&gt;
To start KDE desktop instead of default twm one replace &amp;lt;code&amp;gt;twm &amp;amp;&amp;lt;/code&amp;gt; line with &amp;lt;code&amp;gt;startkde &amp;amp;&amp;lt;/code&amp;gt; in user's&lt;br /&gt;
&amp;lt;code&amp;gt;~/.vnc/xstartup&amp;lt;/code&amp;gt; file on the VE.&lt;br /&gt;
&lt;br /&gt;
=== Connecting with VNC from firewalled network ===&lt;br /&gt;
VNC uses 590x TCP ports for its connections. These ports can be firewalled in&lt;br /&gt;
many networks so in order to be able to connect to remote side one need to tunnel VNC connections somehow.&lt;br /&gt;
A usual '''ssh''' can be used for tunneling VNC connections as described below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
localhost# ssh -L 5900:localhost:5900 &amp;lt;remote host&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;remote host&amp;gt; is the name of the system you want to connect to. When you are asked for a username and password enter your normal username and password. Then start the VNC session to localhost, i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
localhost# vncviewer localhost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using xdm ==&lt;br /&gt;
It should be also possible to do remote X by running '''xdm''' inside VE and&lt;br /&gt;
X -query &amp;lt;remote IP&amp;gt; :1&lt;br /&gt;
&lt;br /&gt;
However VNC approach is much easier.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* http://forum.openvz.org/index.php?t=tree&amp;amp;th=235&amp;amp;mid=1115&amp;amp;&amp;amp;rev=&amp;amp;reveal=&lt;br /&gt;
* http://ait.web.psi.ch/services/linux/kde-desktop-sharing.htm&lt;br /&gt;
* http://ait.web.psi.ch/services/ssh/vnc-ssh.html&lt;br /&gt;
* http://www.vnc.com/pipermail/vnc-list/2002-July/031831.html&lt;br /&gt;
* http://www.linuxjournal.com/article/5499&lt;br /&gt;
* http://www.realvnc.com/pipermail/vnc-list/2002-March/029502.html&lt;br /&gt;
* http://www.redhat.com/archives/rhl-list/2003-December/msg01859.html&lt;br /&gt;
* http://faq.gotomyvnc.com/fom-serve/cache/56.html&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=X_inside_VE&amp;diff=3541</id>
		<title>X inside VE</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=X_inside_VE&amp;diff=3541"/>
		<updated>2007-10-27T12:39:27Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add note about Debian&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several ways to run X applications inside your [[VE]].&lt;br /&gt;
&lt;br /&gt;
== X forwarding ==&lt;br /&gt;
&lt;br /&gt;
To run an X application inside a [[VE]], one need simply to connect to a VE with '''ssh -X''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host# ssh -2 -c blowfish -X user@address&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After login to VE check that &amp;lt;code&amp;gt;$DISPLAY&amp;lt;/code&amp;gt; variable is set and X11 forwarding is enabled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# echo $DISPLAY&lt;br /&gt;
localhost:10.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case &amp;lt;code&amp;gt;$DISPLAY&amp;lt;/code&amp;gt; is not set, make sure that X forwarding is enabled in &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; config inside VE. In most Linux distros sshd configuration is stored in &amp;lt;code&amp;gt;/etc/ssh/sshd_config&amp;lt;/code&amp;gt;. You should set parameter &amp;lt;code&amp;gt;X11Forwarding&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;yes&amp;lt;/code&amp;gt;. Also VE should contain &amp;lt;code&amp;gt;xauth&amp;lt;/code&amp;gt; package, thus install &amp;lt;code&amp;gt;xauth&amp;lt;/code&amp;gt; if it is missing (in Debian this is part of the xbase-clients package). After that, restart your sshd daemon:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# /etc/init.d/sshd restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Don't forget to reconnect after this}}&lt;br /&gt;
&lt;br /&gt;
Now you can run X applications from your VE:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# firefox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that if you want to run complete X window environment (including window manager), you should kill local window manager and run only pure X server. Secondly you shoud use  '''-Y''' option when invoking ssh. And if you want to run gnome/kde/..., don't forget to increase [[UBC]] limits, 'cause default values are certainly too small for these monsters. ;)&lt;br /&gt;
&lt;br /&gt;
== VNC for X desktop ==&lt;br /&gt;
First, one need to run '''Xvnc''' server inside VE. The easiest way for this is to run&lt;br /&gt;
'''vncserver''' script. This scripts starts all the required services&lt;br /&gt;
and small http daemon which provides graphical web access to your desktop (via Java applet).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ve# vncserver -name mydesktop&lt;br /&gt;
New 'mydekstop' desktop is ve:1&lt;br /&gt;
&lt;br /&gt;
Starting applications specified in ~/.vnc/xstartup&lt;br /&gt;
Log file is ~/.vnc/ve:1.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when your desktop is up and running you can connect to it&lt;br /&gt;
using '''vncviewer''' command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
host# vncviewer &amp;lt;VE_IP&amp;gt;:1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the VNC desktop is the same size or larger than your X desktop, you will see scroll bars on the bottom and the side.  This is often inconvenient. You may reduce your VNC desktop to a more reasonable size like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;vncserver -geometry 1000x650&amp;lt;/pre&amp;gt;&lt;br /&gt;
This setting works quite well for a 1024 by 768 X desktop setting.&lt;br /&gt;
&lt;br /&gt;
=== Starting KDE desktop with VNC ===&lt;br /&gt;
To start KDE desktop instead of default twm one replace &amp;lt;code&amp;gt;twm &amp;amp;&amp;lt;/code&amp;gt; line with &amp;lt;code&amp;gt;startkde &amp;amp;&amp;lt;/code&amp;gt; in user's&lt;br /&gt;
&amp;lt;code&amp;gt;~/.vnc/xstartup&amp;lt;/code&amp;gt; file on the VE.&lt;br /&gt;
&lt;br /&gt;
=== Connecting with VNC from firewalled network ===&lt;br /&gt;
VNC uses 590x TCP ports for its connections. These ports can be firewalled in&lt;br /&gt;
many networks so in order to be able to connect to remote side one need to tunnel VNC connections somehow.&lt;br /&gt;
A usuall '''ssh''' can be used for tunneling VNC connections as described below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
localhost# ssh -L 5900:localhost:5900 &amp;lt;remote host&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;remote host&amp;gt; is the name of the system you want to connect to. When you are asked for a username and password enter your normal username and password. Then start the VNC session to localhost, i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
localhost# vncviewer localhost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using xdm ==&lt;br /&gt;
It should be also possible to do remote X by running '''xdm''' inside VE and&lt;br /&gt;
X -query &amp;lt;remote IP&amp;gt; :1&lt;br /&gt;
&lt;br /&gt;
However VNC approach is much easier.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* http://forum.openvz.org/index.php?t=tree&amp;amp;th=235&amp;amp;mid=1115&amp;amp;&amp;amp;rev=&amp;amp;reveal=&lt;br /&gt;
* http://ait.web.psi.ch/services/linux/kde-desktop-sharing.htm&lt;br /&gt;
* http://ait.web.psi.ch/services/ssh/vnc-ssh.html&lt;br /&gt;
* http://www.vnc.com/pipermail/vnc-list/2002-July/031831.html&lt;br /&gt;
* http://www.linuxjournal.com/article/5499&lt;br /&gt;
* http://www.realvnc.com/pipermail/vnc-list/2002-March/029502.html&lt;br /&gt;
* http://www.redhat.com/archives/rhl-list/2003-December/msg01859.html&lt;br /&gt;
* http://faq.gotomyvnc.com/fom-serve/cache/56.html&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Mounting_filesystems&amp;diff=3540</id>
		<title>Mounting filesystems</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Mounting_filesystems&amp;diff=3540"/>
		<updated>2007-10-27T12:38:08Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Add it to the HOWTO list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Mounting filesystems within a VE ==&lt;br /&gt;
&lt;br /&gt;
To mount filesystems inside a VE, you have several choices:&lt;br /&gt;
&lt;br /&gt;
* NFS (the VE will be an NFS Client) - see [[NFS]]&lt;br /&gt;
* FUSE - see [[FUSE]]&lt;br /&gt;
* Bind mount from Hardware Node&lt;br /&gt;
&lt;br /&gt;
=== Bind mount from Hardware Node ===&lt;br /&gt;
&lt;br /&gt;
Recent Linux kernels support an operation called 'bind mounting' which makes part of a mounted filesystem visible at some other mount point. See 'man bind' for more information.&lt;br /&gt;
&lt;br /&gt;
Bind mounts can be used to make directories on the hardware node visible to the VE.&lt;br /&gt;
&lt;br /&gt;
OpenVZ uses two directories. Assuming our VE is numbered 777, these directories are:&lt;br /&gt;
&lt;br /&gt;
 /var/lib/vz/private/777&lt;br /&gt;
 /var/lib/vz/root/777&lt;br /&gt;
&lt;br /&gt;
The /var/lib/vz/private directory contains root directory contents. This directory or subdirectory is often symlinked onto a different filesystem, for example:&lt;br /&gt;
&lt;br /&gt;
  /var/lib/vz/private -&amp;gt; /mnt/openvz&lt;br /&gt;
&lt;br /&gt;
Putting VE root directories onto a separate filesystem (not the hardware node root filesystem) is good storage management practice. It protects the Hardware Node root filesystem from being filled up by a VE; this could cause problems on the Hardware Node.&lt;br /&gt;
&lt;br /&gt;
=== Requirement ===&lt;br /&gt;
&lt;br /&gt;
'''On the HN we have a directory '/home' which we wish to make available (shared) to all VEs.'''&lt;br /&gt;
&lt;br /&gt;
You would think that you could bind mount this directory, as in: 'mount --bind /home /var/lib/vz/private/777/home' but this does not work - the contents of /home cannot be seen within the VE.&lt;br /&gt;
&lt;br /&gt;
This is where the second directory listed above (/var/lib/vz/root/777) is used. If a VE is not started, this directory is empty. But after starting a VE, this directory contains what the VE sees as its mounted filesystems.&lt;br /&gt;
&lt;br /&gt;
The correct command to issue on the HN is:&lt;br /&gt;
&lt;br /&gt;
  mount --bind /home /var/lib/vz/root/777/home&lt;br /&gt;
&lt;br /&gt;
The VE must be started and the destination directory must exist. The VE will see this directory mounted like this:&lt;br /&gt;
&lt;br /&gt;
 # df&lt;br /&gt;
 Filesystem           1K-blocks      Used Available Use% Mounted on&lt;br /&gt;
 simfs                 10485760    298728  10187032   3% /&lt;br /&gt;
 tmpfs                   484712         0    484712   0% /lib/init/rw&lt;br /&gt;
 tmpfs                   484712         0    484712   0% /dev/shm&lt;br /&gt;
 ext3                 117662052 104510764   7174408  94% /home&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS&amp;diff=3539</id>
		<title>NFS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS&amp;diff=3539"/>
		<updated>2007-10-27T12:33:26Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: /* NFS server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to mount NFS partition inside VE.&lt;br /&gt;
&lt;br /&gt;
== NFS server ==&lt;br /&gt;
Currently OpenVZ kernel doesn't include kernel NFS server support. However you are still able to use user space [[NFS server inside VE]].&lt;br /&gt;
&lt;br /&gt;
== NFS client ==&lt;br /&gt;
=== Preparations ===&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
You will need the following software:&lt;br /&gt;
&lt;br /&gt;
# [http://openvz.org/download/utils#vzctl vzctl] version 3.0.13 or higher&lt;br /&gt;
# [http://openvz.org/download/kernel/ kernel] version 2.6.18-028test006 or higher (2.6.18-028stab* will do), or any recent RHEL5-based or 2.6.20-based kernel.&lt;br /&gt;
&lt;br /&gt;
Note: In all the kernels earlier than 028stab038, kernel NFS support can be given to a VE by setting:&lt;br /&gt;
&lt;br /&gt;
      sunrpc.ve_allow_rpc = 1&lt;br /&gt;
      fs.nfs.ve_allow_nfs = 1&lt;br /&gt;
      kernel.ve_allow_kthreads = 1&lt;br /&gt;
&lt;br /&gt;
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running &amp;lt;code&amp;gt;sysctl -p&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Prepare the HN ====&lt;br /&gt;
&lt;br /&gt;
For NFS mounts to work in the VEs with the RHEL5-based kernels you must enable kernel threads in the VE by setting &amp;quot;kernel.ve_allow_kthreads=1&amp;quot; in /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe nfs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Prepare the VE ====&lt;br /&gt;
To allow a VE use NFS filesystem, you will need to start it with &amp;quot;nfs&amp;quot; feature enabled. If the VE is running while you set the --features &amp;quot;nfs:on&amp;quot;, you will need to reboot it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl set 101 --features &amp;quot;nfs:on&amp;quot; --save&lt;br /&gt;
# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this you may see nfs in &amp;lt;code&amp;gt;/proc/filesystems&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl exec 101 cat /proc/filesystems&lt;br /&gt;
        ext3&lt;br /&gt;
        ext2&lt;br /&gt;
nodev   rpc_pipefs&lt;br /&gt;
nodev   proc&lt;br /&gt;
nodev   nfs&lt;br /&gt;
nodev   sysfs&lt;br /&gt;
nodev   tmpfs&lt;br /&gt;
nodev   devpts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mounting NFS ===&lt;br /&gt;
Assuming that you already have NFS server set up at &amp;lt;code&amp;gt;192.168.0.1:/nfs_pub&amp;lt;/code&amp;gt; mounting will be simple&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# vzctl enter 100&lt;br /&gt;
# mkdir /nfs&lt;br /&gt;
# mount -t nfs 192.168.0.1:/nfs_pub /nfs&lt;br /&gt;
# cat /proc/mounts &lt;br /&gt;
simfs / simfs rw 0 0&lt;br /&gt;
proc /proc proc rw 0 0&lt;br /&gt;
sysfs /sys sysfs rw 0 0&lt;br /&gt;
devpts /dev/pts devpts rw 0 0&lt;br /&gt;
nfs /nfs nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.0.1 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details on how to setup NFS mount see [http://nfs.sourceforge.net/nfs-howto/ar01s04.htm NFS-client HOWTO]&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
There are quite a few parameters in NFS, so sometimes it doesn't work due to misconfiguration. We created a separate&lt;br /&gt;
page for discribing such situation: [[ NFS doesn't work ]]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Mounting_filesystems&amp;diff=3538</id>
		<title>Mounting filesystems</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Mounting_filesystems&amp;diff=3538"/>
		<updated>2007-10-27T12:32:45Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Describe how to mount filesystems from the host into the VE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Mounting filesystems within a VE ==&lt;br /&gt;
&lt;br /&gt;
To mount filesystems inside a VE, you have several choices:&lt;br /&gt;
&lt;br /&gt;
* NFS (the VE will be an NFS Client) - see [[NFS]]&lt;br /&gt;
* FUSE - see [[FUSE]]&lt;br /&gt;
* Bind mount from Hardware Node&lt;br /&gt;
&lt;br /&gt;
=== Bind mount from Hardware Node ===&lt;br /&gt;
&lt;br /&gt;
Recent Linux kernels support an operation called 'bind mounting' which makes part of a mounted filesystem visible at some other mount point. See 'man bind' for more information.&lt;br /&gt;
&lt;br /&gt;
Bind mounts can be used to make directories on the hardware node visible to the VE.&lt;br /&gt;
&lt;br /&gt;
OpenVZ uses two directories. Assuming our VE is numbered 777, these directories are:&lt;br /&gt;
&lt;br /&gt;
 /var/lib/vz/private/777&lt;br /&gt;
 /var/lib/vz/root/777&lt;br /&gt;
&lt;br /&gt;
The /var/lib/vz/private directory contains root directory contents. This directory or subdirectory is often symlinked onto a different filesystem, for example:&lt;br /&gt;
&lt;br /&gt;
  /var/lib/vz/private -&amp;gt; /mnt/openvz&lt;br /&gt;
&lt;br /&gt;
Putting VE root directories onto a separate filesystem (not the hardware node root filesystem) is good storage management practice. It protects the Hardware Node root filesystem from being filled up by a VE; this could cause problems on the Hardware Node.&lt;br /&gt;
&lt;br /&gt;
=== Requirement ===&lt;br /&gt;
&lt;br /&gt;
'''On the HN we have a directory '/home' which we wish to make available (shared) to all VEs.'''&lt;br /&gt;
&lt;br /&gt;
You would think that you could bind mount this directory, as in: 'mount --bind /home /var/lib/vz/private/777/home' but this does not work - the contents of /home cannot be seen within the VE.&lt;br /&gt;
&lt;br /&gt;
This is where the second directory listed above (/var/lib/vz/root/777) is used. If a VE is not started, this directory is empty. But after starting a VE, this directory contains what the VE sees as its mounted filesystems.&lt;br /&gt;
&lt;br /&gt;
The correct command to issue on the HN is:&lt;br /&gt;
&lt;br /&gt;
  mount --bind /home /var/lib/vz/root/777/home&lt;br /&gt;
&lt;br /&gt;
The VE must be started and the destination directory must exist. The VE will see this directory mounted like this:&lt;br /&gt;
&lt;br /&gt;
 # df&lt;br /&gt;
 Filesystem           1K-blocks      Used Available Use% Mounted on&lt;br /&gt;
 simfs                 10485760    298728  10187032   3% /&lt;br /&gt;
 tmpfs                   484712         0    484712   0% /lib/init/rw&lt;br /&gt;
 tmpfs                   484712         0    484712   0% /dev/shm&lt;br /&gt;
 ext3                 117662052 104510764   7174408  94% /home&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=3537</id>
		<title>Physical to container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=3537"/>
		<updated>2007-10-27T12:01:32Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Various language and typo cleanups&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[VE]].&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” VE ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose VE ID of 123):&lt;br /&gt;
&lt;br /&gt;
 mkdir /vz/root/123 /vz/private/123&lt;br /&gt;
 cat /etc/vz/conf/ve-vps.basic.conf-sample &amp;gt; /etc/vz/conf/123.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preparing to migrate ==&lt;br /&gt;
&lt;br /&gt;
Stop most services on a machine to be migrated. “Most” means services such as web server, databases and the like — so you will not lose your data. Just leave the bare minimum (including ssh daemon).&lt;br /&gt;
&lt;br /&gt;
== Copying the data ==&lt;br /&gt;
&lt;br /&gt;
Copy all your data from the machine to an OpenVZ box. Say you'll be using VE with ID of 123, then all the data should be placed to &amp;lt;code&amp;gt;/vz/private/123/&amp;lt;/code&amp;gt; directory (so there will be directories such as &amp;lt;code&amp;gt;/vz/private/123/bin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;etc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; and so on). This could be done in several ways:&lt;br /&gt;
&lt;br /&gt;
=== rsync ===&lt;br /&gt;
rsync example (run from the new HN):&lt;br /&gt;
 rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp -e &amp;quot;ssh -l root@a.b.c.d&amp;quot; root@a.b.c.d:/ /vz/private/123/&lt;br /&gt;
&lt;br /&gt;
'''Advantage:''' Your system doesn't really go down.&lt;br /&gt;
&lt;br /&gt;
=== Live CD ===&lt;br /&gt;
Another way to do is using a live cd, booting up and use tar to dump the complete disk in a tar you save over the network or on a USB device.&lt;br /&gt;
&lt;br /&gt;
=== Tar ===&lt;br /&gt;
Another approach is using tar and excluding some dirs, you could do it like this:&lt;br /&gt;
&lt;br /&gt;
Create a file /tmp/excludes.excl with these contents:&lt;br /&gt;
 .bash_history&lt;br /&gt;
 /dev/*&lt;br /&gt;
 /mnt/*&lt;br /&gt;
 /tmp/*&lt;br /&gt;
 /proc/*&lt;br /&gt;
 /sys/*&lt;br /&gt;
 /usr/src/*&lt;br /&gt;
&lt;br /&gt;
Then create the tar. But remember, when the system is 'not' using udev, you have to look into /proc/ after creating your VE because some devices might not exist. (/dev/ptmx or others)&lt;br /&gt;
&lt;br /&gt;
 # tar cjpf /tmp/mysystem.tar.bz2 / -X /tmp/excludes.excl&lt;br /&gt;
&lt;br /&gt;
Naturally, you can only do this when the critical services (MySQL, apache, ..) are stopped and your /tmp filesystem is big enough to contain your tar.&lt;br /&gt;
&lt;br /&gt;
'''Advantage:''' You don't need to boot from a live cd, so your system doesn't really go down.&lt;br /&gt;
&lt;br /&gt;
== Setting VE parameters ==&lt;br /&gt;
&lt;br /&gt;
=== OSTEMPLATE ===&lt;br /&gt;
You have to add &amp;lt;code&amp;gt;OSTEMPLATE=xxx&amp;lt;/code&amp;gt; line to &amp;lt;code&amp;gt;/etc/vz/conf/123.conf&amp;lt;/code&amp;gt; file, where &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt; would be distribution name (like &amp;lt;code&amp;gt;debian-3.0&amp;lt;/code&amp;gt;) for vzctl to be able to make changes specific for this distribution.&lt;br /&gt;
&lt;br /&gt;
=== IP address(es) ===&lt;br /&gt;
Also, you have to supply an IP for a new VE:&lt;br /&gt;
 &lt;br /&gt;
 vzctl set 123 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== venet vs. veth ===&lt;br /&gt;
You may use veth interface instead of venet if you need just bring old server up for seamless migration of services.&lt;br /&gt;
It may be nessessary if server you are migrating is badly configured and it is hard to find all hard-coded net interfaces settings and so on.&lt;br /&gt;
&lt;br /&gt;
veth inteface may be included into bridge to allow seamless old installation access.&lt;br /&gt;
&lt;br /&gt;
== Making adjustments ==&lt;br /&gt;
Since VE is a bit different to a real physical server, you have to edit some files inside your new VE.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A VE does not have real ttys, so you have to disable getty in &amp;lt;code&amp;gt;/etc/inittab&amp;lt;/code&amp;gt; (i. e. &amp;lt;code&amp;gt;/vz/private/123/etc/inittab&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 sed -i -e '/getty/d' /vz/private/123/etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== /etc/mtab ===&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;, for &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; to work properly:&lt;br /&gt;
&lt;br /&gt;
 rm -f /vz/private/123/etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /vz/private/123/etc/mtab&lt;br /&gt;
&lt;br /&gt;
{{out|The problem here is VE's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the VE itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in VE without a record for &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; being mounted, thus df doesn't show it. By linking &amp;lt;code&amp;gt;/etc/mtab → /proc/mounts&amp;lt;/code&amp;gt; we make sure /etc/mtab shows what is really mounted in a VE.&lt;br /&gt;
&lt;br /&gt;
Sure this is not the only way to fix df; you can just manually add a line to &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; telling &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; is mounted, and make sure this line will be there after a reboot.}}&lt;br /&gt;
&lt;br /&gt;
=== /etc/fstab ===&lt;br /&gt;
Since you do not have any real disk partitions in a VE, /etc/fstab (or most part of it) is no longer needed. Empty it (excluding the line for /dev/pts):&lt;br /&gt;
&lt;br /&gt;
 cp /vz/private/123/etc/fstab /vz/private/123/etc/fstab.old&lt;br /&gt;
 grep devpts /vz/private/123/etc/fstab.old &amp;gt; /vz/private/123/etc/fstab&lt;br /&gt;
&lt;br /&gt;
You can also mount a devpts in a running (but not fully functional) VE:&lt;br /&gt;
 vzctl exec 123 mount -t devpts none /dev/pts&lt;br /&gt;
&lt;br /&gt;
=== /dev ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction: static /dev ====&lt;br /&gt;
In order for VE to work, some nodes should be present in VE's /dev. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a VE, so the best thing to do is to disable udev and create needed device nodes manually.&lt;br /&gt;
&lt;br /&gt;
Note that in some distributions &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is mounted on tmpfs — this will not work in case of static /dev. So what you need to do is find out where &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is being mounted on tmpfs and remove this. This is highly distribution-dependent; please add info for your distro here.&lt;br /&gt;
&lt;br /&gt;
After you made sure your /dev is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a VE needs to have some entries in /dev. This can either be /dev/ttyp* and /dev/ptyp*, or /dev/ptmx and mounted /dev/pts.&lt;br /&gt;
&lt;br /&gt;
===== /dev/ptmx =====&lt;br /&gt;
Check that /dev/ptmx exists. If it does not, create with:&lt;br /&gt;
 mknod /vz/private/123/dev/ptmx c 5 2&lt;br /&gt;
&lt;br /&gt;
===== /dev/pts/ =====&lt;br /&gt;
Check that /dev/pts exists. It's a directory, if it does not exist, create with:&lt;br /&gt;
 mkdir /vz/private/123/dev/pts&lt;br /&gt;
&lt;br /&gt;
===== /dev/ttyp* and /dev/ptyp* =====&lt;br /&gt;
Check that /dev/ttyp* and /dev/ptyp* files are there. If not, you have to create those, either by using /sbin/MAKEDEV, or by copying them from the host system.&lt;br /&gt;
&lt;br /&gt;
To copy:&lt;br /&gt;
 cp -a /dev/ttyp* /dev/ptyp* /vz/private/123/dev/&lt;br /&gt;
&lt;br /&gt;
To recreate with MAKEDEV, either&lt;br /&gt;
 /sbin/MAKEDEV -d /vz/private/123/dev ttyp ptyp&lt;br /&gt;
or&lt;br /&gt;
 cd /vz/private/123/dev &amp;amp;&amp;amp; /sbin/MAKEDEV ttyp&lt;br /&gt;
&lt;br /&gt;
====/dev/null====&lt;br /&gt;
Make sure sure /dev/null is not a file or directory; if unsure remove and recreate. If this is not correct sshd will not start correctly.&lt;br /&gt;
 rm -f /vz/private/123/dev/null&lt;br /&gt;
 mknod /vz/private/123/dev/null c 1 3&lt;br /&gt;
&lt;br /&gt;
==== /dev/urandom ====&lt;br /&gt;
Check that /dev/urandom exists. If it does not, create with:&lt;br /&gt;
 mknod /vz/private/123/dev/urandom c 1 9&lt;br /&gt;
&lt;br /&gt;
===/proc===&lt;br /&gt;
Make sure the /proc directory exists:&lt;br /&gt;
 ls -la /vz/private/123/ | grep proc&lt;br /&gt;
&lt;br /&gt;
If it doesn't, create it:&lt;br /&gt;
 mkdir /vz/private/123/proc&lt;br /&gt;
&lt;br /&gt;
=== /etc/init.d services ===&lt;br /&gt;
&lt;br /&gt;
Some system services can (or in some cases should) be disabled. A few good candidates are:&lt;br /&gt;
&lt;br /&gt;
* acpid, amd (not needed)&lt;br /&gt;
* checkfs, checkroot (no filesystem checking is required in VE)&lt;br /&gt;
* clock (no clock setting is required/allowed in VE)&lt;br /&gt;
* consolefont (VE does not have a console)&lt;br /&gt;
* hdparm (VE does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (VE does not have a real keyboard)&lt;br /&gt;
* kudzu (VE does not have real hardware)&lt;br /&gt;
* lm_sensors (VE does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (VE can not update CPU microcode)&lt;br /&gt;
* netplugd (VE does not have real Ethernet device) &lt;br /&gt;
&lt;br /&gt;
To see which services are enabled:&lt;br /&gt;
* RedHat/Fedora/SUSE: &amp;lt;code&amp;gt;/sbin/chkconfig --list&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian: Use '&amp;lt;code&amp;gt;rcconf&amp;lt;/code&amp;gt;' (ncurses) or &amp;lt;code&amp;gt;update-rc.d&amp;lt;/code&amp;gt;&lt;br /&gt;
( See: http://www.debianadmin.com/manage-linux-init-or-startup-scripts.html )&lt;br /&gt;
* Gentoo: &amp;lt;code&amp;gt;/sbin/rc-update show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To disable the service:&lt;br /&gt;
* RedHat/Fedora/SUSE: &amp;lt;code&amp;gt;/sbin/chkconfig --del SERVICENAME  &amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian: &amp;lt;code&amp;gt;' update-rc.d -f hdparm remove '&amp;lt;/code&amp;gt;&lt;br /&gt;
* Gentoo: &amp;lt;code&amp;gt;/sbin/rc-update del SERVICENAME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable old network interface ===&lt;br /&gt;
You should disable your old physical network interface from starting at boot time. This is distribution-dependant.&lt;br /&gt;
&lt;br /&gt;
==== Fedora/CentOS/Red Hat ====&lt;br /&gt;
Edit /vz/private/{VEID}/etc/sysconfig/network-scripts/ifcfg-eth''x''&lt;br /&gt;
&lt;br /&gt;
Make the following look like this:&lt;br /&gt;
 ONBOOT=no&lt;br /&gt;
&lt;br /&gt;
==== Debian/Ubuntu ====&lt;br /&gt;
Edit /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /etc/network/interfaces -- configuration file for ifup(8),  ifdown(8)&lt;br /&gt;
&lt;br /&gt;
# The loopback interface&lt;br /&gt;
# automatically added when upgrading&lt;br /&gt;
auto lo eth0&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
       address 10.0.0.4&lt;br /&gt;
       netmask 255.0.0.0&lt;br /&gt;
       network 10.0.0.0&lt;br /&gt;
       broadcast 10.0.0.255&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can either comment out the eth* interface stanza(s), or take it out of the &amp;quot;auto&amp;quot; line(s).&lt;br /&gt;
&lt;br /&gt;
==== openSUSE/SLES ====&lt;br /&gt;
&lt;br /&gt;
Use Yast.&lt;br /&gt;
&lt;br /&gt;
=== Other adjustments ===&lt;br /&gt;
There might be other adjustments needed. Please add those here (just above this section) if you have more info.&lt;br /&gt;
&lt;br /&gt;
== Starting a new VE ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new VE:&lt;br /&gt;
 &lt;br /&gt;
 vzctl start 123&lt;br /&gt;
&lt;br /&gt;
Now check that everything works fine. If not, see [[#Troubleshooting]] below.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Can't enter VE ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your VE (using &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt;), you should be able to at least execute commands in it.&lt;br /&gt;
&lt;br /&gt;
First, see the [[#tty device nodes]] section above.&lt;br /&gt;
&lt;br /&gt;
Next, check if devpts is mounted:&lt;br /&gt;
 vzctl exec 123 mount | grep pts&lt;br /&gt;
&lt;br /&gt;
If it is not mounted, mount it:&lt;br /&gt;
 vzctl exec 123 mount -t devpts none /dev/pts&lt;br /&gt;
&lt;br /&gt;
Then, add the appropriate mount command to VE's startup scripts. On some distros, you need to have the appropriate line in VE's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{VEID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{VEID}/etc/rc.sysinit&lt;br /&gt;
Locate the '''udev''' entry from within vim&lt;br /&gt;
 /udev&lt;br /&gt;
Then comment the line similar to this:&lt;br /&gt;
 #[ -x /sbin/start_udev ] &amp;amp;&amp;amp; /sbin/start_udev&lt;br /&gt;
&lt;br /&gt;
=== Other problems ===&lt;br /&gt;
If anything goes wrong, try to find out why and fix. If you have enough Linux experience, it can be handled. Also check out IRC and please report back on this page.&lt;br /&gt;
&lt;br /&gt;
== Success Stories ==&lt;br /&gt;
- Debian 3.1 Sarge with MySQL, apache2, PowerDNS&lt;br /&gt;
--[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- Red Hat 7.2 with MySQL 3.23, apache, Chilisoft --[[User:Stoffell|stoffell]] 13:26, 9 February 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- Gentoo with Courier, Postfix, MySQL, Apache2&lt;br /&gt;
--[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] &lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=3536</id>
		<title>Physical to container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=3536"/>
		<updated>2007-10-27T11:53:44Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[VE]].&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” VE ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose VE ID of 123):&lt;br /&gt;
&lt;br /&gt;
 mkdir /vz/root/123 /vz/private/123&lt;br /&gt;
 cat /etc/vz/conf/ve-vps.basic.conf-sample &amp;gt; /etc/vz/conf/123.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preparing to migrate ==&lt;br /&gt;
&lt;br /&gt;
Stop most services on a machine to be migrated. “Most” means services such as web server, databases and the like — so you will not lose your data. Just leave the bare minimum (including ssh daemon).&lt;br /&gt;
&lt;br /&gt;
== Copying the data ==&lt;br /&gt;
&lt;br /&gt;
Copy all your data from the machine to an OpenVZ box. Say you'll be using VE with ID of 123, then all the data should be placed to &amp;lt;code&amp;gt;/vz/private/123/&amp;lt;/code&amp;gt; directory (so there will be directories such as &amp;lt;code&amp;gt;/vz/private/123/bin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;etc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; and so on). This could be done in several ways:&lt;br /&gt;
&lt;br /&gt;
=== rsync ===&lt;br /&gt;
rsync example (run from the new HN):&lt;br /&gt;
 rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp -e &amp;quot;ssh -l root@a.b.c.d&amp;quot; root@a.b.c.d:/ /vz/private/123/&lt;br /&gt;
&lt;br /&gt;
'''Advantage:''' Your system doesn't really go down.&lt;br /&gt;
&lt;br /&gt;
=== Live CD ===&lt;br /&gt;
Another way to do is using a live cd, booting up and use tar to dump the complete disk in a tar you save over the network or on a USB device.&lt;br /&gt;
&lt;br /&gt;
=== Tar ===&lt;br /&gt;
Another approach is using tar and excluding some dirs, you could do it like this:&lt;br /&gt;
&lt;br /&gt;
Create a file /tmp/excludes.excl with these contents:&lt;br /&gt;
 .bash_history&lt;br /&gt;
 /dev/*&lt;br /&gt;
 /mnt/*&lt;br /&gt;
 /tmp/*&lt;br /&gt;
 /proc/*&lt;br /&gt;
 /sys/*&lt;br /&gt;
 /usr/src/*&lt;br /&gt;
&lt;br /&gt;
Then create the tar. But remember, when the system is 'not' using udev, you have to look into /proc/ after creating your VE because some devices might not exist. (/dev/ptmx or others)&lt;br /&gt;
&lt;br /&gt;
 # tar cjpf /tmp/mysystem.tar.bz2 / -X /tmp/excludes.excl&lt;br /&gt;
&lt;br /&gt;
Naturally, you can only do this when the critical services (MySQL, apache, ..) are stopped and your /tmp filesystem is big enough to contain your tar.&lt;br /&gt;
&lt;br /&gt;
'''Advantage:''' You don't need to boot from a livecd, so your system doesn't really go down.&lt;br /&gt;
&lt;br /&gt;
== Setting VE parameters ==&lt;br /&gt;
&lt;br /&gt;
=== OSTEMPLATE ===&lt;br /&gt;
You have to add &amp;lt;code&amp;gt;OSTEMPLATE=xxx&amp;lt;/code&amp;gt; line to &amp;lt;code&amp;gt;/etc/vz/conf/123.conf&amp;lt;/code&amp;gt; file, where &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt; would be distribution name (like &amp;lt;code&amp;gt;debian-3.0&amp;lt;/code&amp;gt;) for vzctl to be able to make changes specific for this distribution.&lt;br /&gt;
&lt;br /&gt;
=== IP address(es) ===&lt;br /&gt;
Also, you have to supply an IP for a new VE:&lt;br /&gt;
 &lt;br /&gt;
 vzctl set 123 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
=== venet vs. veth ===&lt;br /&gt;
You may use veth interface instead of venet if you need just bring old server up for seamless migration of services.&lt;br /&gt;
It may be nessessary if server you are migrating is badly configured and it is hard to find all hard-coded net interfaces settings and so on.&lt;br /&gt;
&lt;br /&gt;
veth inteface may me included into bridge to allow seamless old installation access.&lt;br /&gt;
&lt;br /&gt;
== Making adjustments ==&lt;br /&gt;
Since VE is a bit different than a real physical server, you have to edit some files inside your new VE.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A VE does not have real ttys, so you have to disable getty in &amp;lt;code&amp;gt;/etc/inittab&amp;lt;/code&amp;gt; (i. e. &amp;lt;code&amp;gt;/vz/private/123/etc/inittab&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 sed -i -e '/getty/d' /vz/private/123/etc/inittab&lt;br /&gt;
&lt;br /&gt;
=== /etc/mtab ===&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;, for &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; to work properly:&lt;br /&gt;
&lt;br /&gt;
 rm -f /vz/private/123/etc/mtab&lt;br /&gt;
 ln -s /proc/mounts /vz/private/123/etc/mtab&lt;br /&gt;
&lt;br /&gt;
{{out|The problem here is VE's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the VE itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in VE without a record for &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; being mounted, thus df doesn't show it. By linking &amp;lt;code&amp;gt;/etc/mtab → /proc/mounts&amp;lt;/code&amp;gt; we make sure /etc/mtab shows what is really mounted in a VE.&lt;br /&gt;
&lt;br /&gt;
Sure this is not the only way to fix df; you can just manually add a line to &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; telling &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; is mounted, and make sure this line will be there after a reboot.}}&lt;br /&gt;
&lt;br /&gt;
=== /etc/fstab ===&lt;br /&gt;
Since you do not have any real disk partitions in a VE, /etc/fstab (or most part of it) is no longer needed. Empty it (excluding the line for /dev/pts):&lt;br /&gt;
&lt;br /&gt;
 cp /vz/private/123/etc/fstab /vz/private/123/etc/fstab.old&lt;br /&gt;
 grep devpts /vz/private/123/etc/fstab.old &amp;gt; /vz/private/123/etc/fstab&lt;br /&gt;
&lt;br /&gt;
You can also mount a devpts in a running (but not fully functional) VE:&lt;br /&gt;
 vzctl exec 123 mount -t devpts none /dev/pts&lt;br /&gt;
&lt;br /&gt;
=== /dev ===&lt;br /&gt;
&lt;br /&gt;
==== Introduction: static /dev ====&lt;br /&gt;
In order for VE to work, some nodes should be present in VE's /dev. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a VE, so the best thing to do is to disable udev and create needed device nodes manually.&lt;br /&gt;
&lt;br /&gt;
Note that in some distrubutions &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is mounted on tmpfs — this will not work in case of static /dev. So what you need to do is find out where &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is being mounted on tmpfs and remove this. This is highly distribution-dependent; please add info for your distro here.&lt;br /&gt;
&lt;br /&gt;
After you made sure your /dev is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a VE need to have some entries in /dev. This can either be /dev/ttyp* and /dev/ptyp*, or /dev/ptmx and mounted /dev/pts.&lt;br /&gt;
&lt;br /&gt;
===== /dev/ptmx =====&lt;br /&gt;
Check that /dev/ptmx exists. If it does not, create with:&lt;br /&gt;
 mknod /vz/private/123/dev/ptmx c 5 2&lt;br /&gt;
&lt;br /&gt;
===== /dev/pts/ =====&lt;br /&gt;
Check that /dev/pts exists. It's a directory, if it does not exist, create with:&lt;br /&gt;
 mkdir /vz/private/123/dev/pts&lt;br /&gt;
&lt;br /&gt;
===== /dev/ttyp* and /dev/ptyp* =====&lt;br /&gt;
Check that /dev/ttyp* and /dev/ptyp* files are there. If not, you have to create those, either by using /sbin/MAKEDEV, or by copying them from the host system.&lt;br /&gt;
&lt;br /&gt;
To copy:&lt;br /&gt;
 cp -a /dev/ttyp* /dev/ptyp* /vz/private/123/dev/&lt;br /&gt;
&lt;br /&gt;
To recreate with MAKEDEV, either&lt;br /&gt;
 /sbin/MAKEDEV -d /vz/private/123/dev ttyp ptyp&lt;br /&gt;
or&lt;br /&gt;
 cd /vz/private/123/dev &amp;amp;&amp;amp; /sbin/MAKEDEV ttyp&lt;br /&gt;
&lt;br /&gt;
====/dev/null====&lt;br /&gt;
Make sure sure /dev/null is not a file or directory, if unsure remove and recreate, If this is not correct sshd will not start correctly&lt;br /&gt;
 rm -f /vz/private/123/dev/null&lt;br /&gt;
 mknod /vz/private/123/dev/null c 1 3&lt;br /&gt;
&lt;br /&gt;
==== /dev/urandom ====&lt;br /&gt;
Check that /dev/urandom exists. If it does not, create with:&lt;br /&gt;
 mknod /vz/private/123/dev/urandom c 1 9&lt;br /&gt;
&lt;br /&gt;
===/proc===&lt;br /&gt;
Make sure the /proc directory exists:&lt;br /&gt;
 ls -la /vz/private/123/ | grep proc&lt;br /&gt;
&lt;br /&gt;
If it doesn't, create it:&lt;br /&gt;
 mkdir /vz/private/123/proc&lt;br /&gt;
&lt;br /&gt;
=== /etc/init.d services ===&lt;br /&gt;
&lt;br /&gt;
Some system services can (or in some cases should) be disabled. A few good candidates are:&lt;br /&gt;
&lt;br /&gt;
* acpid, amd (not needed)&lt;br /&gt;
* checkfs, checkroot (no filesystem checking is required in VE)&lt;br /&gt;
* clock (no clock setting is required/allowed in VE)&lt;br /&gt;
* consolefont (VE does not have a console)&lt;br /&gt;
* hdparm (VE does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (VE does not have a real keyboard)&lt;br /&gt;
* kudzu (VE does not have real hardware)&lt;br /&gt;
* lm_sensors (VE does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (VE can not update CPU microcode)&lt;br /&gt;
* netplugd (VE does not have real Ethernet device) &lt;br /&gt;
&lt;br /&gt;
To see which services are enabled:&lt;br /&gt;
* RedHat/Fedora/SUSE: &amp;lt;code&amp;gt;/sbin/chkconfig --list&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian: &amp;lt;code&amp;gt;Use ' rcconf ' (ncurses) or update-rc.d&lt;br /&gt;
( See: http://www.debianadmin.com/manage-linux-init-or-startup-scripts.html )&amp;lt;/code&amp;gt;&lt;br /&gt;
* Gentoo: &amp;lt;code&amp;gt;/sbin/rc-update show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To disable the service:&lt;br /&gt;
* RedHat/Fedora/SUSE: &amp;lt;code&amp;gt;/sbin/chkconfig --del SERVICENAME  &amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian: &amp;lt;code&amp;gt;' update-rc.d -f hdparm remove '&amp;lt;/code&amp;gt;&lt;br /&gt;
* Gentoo: &amp;lt;code&amp;gt;/sbin/rc-update del SERVICENAME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable old network interface ===&lt;br /&gt;
You should disable your old physical network interface from starting at boot time. This is distribution-dependant.&lt;br /&gt;
&lt;br /&gt;
==== Fedora/CentOS/Red Hat ====&lt;br /&gt;
Edit /vz/private/{VEID}/etc/sysconfig/network-scripts/ifcfg-eth''x''&lt;br /&gt;
&lt;br /&gt;
Make the following look like this:&lt;br /&gt;
 ONBOOT=no&lt;br /&gt;
&lt;br /&gt;
==== Debian/Ubuntu ====&lt;br /&gt;
Edit /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /etc/network/interfaces -- configuration file for ifup(8),  ifdown(8)&lt;br /&gt;
&lt;br /&gt;
# The loopback interface&lt;br /&gt;
# automatically added when upgrading&lt;br /&gt;
auto lo eth0&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet dhcp&lt;br /&gt;
       address 10.0.0.4&lt;br /&gt;
       netmask 255.0.0.0&lt;br /&gt;
       network 10.0.0.0&lt;br /&gt;
       broadcast 10.0.0.255&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can either comment out the eth* interface stanza(s), or take it out of the &amp;quot;auto&amp;quot; line(s).&lt;br /&gt;
&lt;br /&gt;
==== openSUSE/SLES ====&lt;br /&gt;
&lt;br /&gt;
Use Yast.&lt;br /&gt;
&lt;br /&gt;
=== Other adjustments ===&lt;br /&gt;
There might be other adjustments needed. Please add those here (just above this section) if you have more info.&lt;br /&gt;
&lt;br /&gt;
== Starting a new VE ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new VE:&lt;br /&gt;
 &lt;br /&gt;
 vzctl start 123&lt;br /&gt;
&lt;br /&gt;
Now check that everything works fine. If not, see [[#Troubleshooting]] below.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Can't enter VE ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your VE (using &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt;), you should be able to at least execute commands in it.&lt;br /&gt;
&lt;br /&gt;
First, see the [[#tty device nodes]] section above.&lt;br /&gt;
&lt;br /&gt;
Next, check if devpts is mounted:&lt;br /&gt;
 vzctl exec 123 mount | grep pts&lt;br /&gt;
&lt;br /&gt;
If it is not mounted, mount it:&lt;br /&gt;
 vzctl exec 123 mount -t devpts none /dev/pts&lt;br /&gt;
&lt;br /&gt;
Then, add the appropriate mount command to VE's startup scripts. On some distros, you need to have the appropriate line in VE's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{VEID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{VEID}/etc/rc.sysinit&lt;br /&gt;
Locate the '''udev''' entry from within vim&lt;br /&gt;
 /udev&lt;br /&gt;
Then comment the line similar to this:&lt;br /&gt;
 #[ -x /sbin/start_udev ] &amp;amp;&amp;amp; /sbin/start_udev&lt;br /&gt;
&lt;br /&gt;
=== Other problems ===&lt;br /&gt;
If anything goes wrong, try to find out why and fix. If you have enough Linux experience, it can be handled. Also check out IRC and please report back on this page.&lt;br /&gt;
&lt;br /&gt;
== Success Stories ==&lt;br /&gt;
- Debian 3.1 Sarge with MySQL, apache2, PowerDNS&lt;br /&gt;
--[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- Red Hat 7.2 with MySQL 3.23, apache, Chilisoft --[[User:Stoffell|stoffell]] 13:26, 9 February 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- Gentoo with Courier, Postfix, MySQL, Apache2&lt;br /&gt;
--[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
- AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] &lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3534</id>
		<title>NFS server inside container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3534"/>
		<updated>2007-10-27T02:02:07Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: more grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two ways to setup NFS server on common [[HN]]:&lt;br /&gt;
use a user-space NFS server daemon or use an in-kernel implementation&lt;br /&gt;
of NFS server. Some peculiarities appear if you intend to run NFS server&lt;br /&gt;
in [[VE]].&lt;br /&gt;
&lt;br /&gt;
{{Note|for information about NFS client inside VE, see [[NFS]].}}&lt;br /&gt;
&lt;br /&gt;
== Kernel NFS server ==&lt;br /&gt;
Binary RPMs that are provided by OpenVZ community contain kernels compiled&lt;br /&gt;
without NFS server support. Thus you have to&lt;br /&gt;
[[Kernel build|recompile the kernel]] with &amp;lt;code&amp;gt;CONFIG_NFSD=m&amp;lt;/code&amp;gt;. After booting in this kernel you'll be able&lt;br /&gt;
to use NFS server on [[HN]].&lt;br /&gt;
In-kernel NFS server runs kernel threads to service requests of clients.&lt;br /&gt;
But for security reasons kernel threads are prohibited in [[VE]]s! So you won't&lt;br /&gt;
be able to run NFS server inside [[VE]] without patching the kernel.&lt;br /&gt;
&lt;br /&gt;
== User-space NFS server ==&lt;br /&gt;
Advantage of user-space NFS server is that it does not require kernel support.&lt;br /&gt;
Also if it crashes — there is no crash of the system: just one process dies, not the kernel!&lt;br /&gt;
The disadvantage of user-space NFS server is its productivity: no one can be faster than in-kernel implementation.&lt;br /&gt;
&lt;br /&gt;
One well-known implementation of NFS server is &amp;quot;The LINUX User-Space NFS Server&amp;quot; by Olaf Kirch.&lt;br /&gt;
Some Linux distributions contain this package: Debian Sarge (&amp;lt;code&amp;gt;nfs-user-server&amp;lt;/code&amp;gt;), OpenSUSE 10.0 (&amp;lt;code&amp;gt;nfs-server&amp;lt;/code&amp;gt;).&lt;br /&gt;
For other distributions you can download sources (for example from Debian repository) and compile it.&lt;br /&gt;
There is a small trick you have to know about running &amp;lt;code&amp;gt;mountd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nfsd&amp;lt;/code&amp;gt; (these two daemons and &amp;lt;code&amp;gt;portmap&amp;lt;/code&amp;gt; constitute a user-space server).  You should run them with the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# portmap&lt;br /&gt;
# rpc.mountd -r&lt;br /&gt;
# rpc.nfsd -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The reason is that these daemons check the major number of the device where the directory to export resides.&lt;br /&gt;
If major equals 0 then daemons assume that it is NFS and don't want to re-export it. Symptoms are&lt;br /&gt;
that clients will always get a &amp;quot;permission denied&amp;quot; error. Simfs (the file system on which VE is located)&lt;br /&gt;
is associated with so called unnamed device, in which major equals 0. So, to prevent daemons from checking for&lt;br /&gt;
re-exporting — just use this &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
“The LINUX User-Space NFS Server” by Olaf Kirch implements NFSv2. It means that only files with sizes less&lt;br /&gt;
than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server&lt;br /&gt;
implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://nfs.sourceforge.net/ Linux NFS Overview, FAQ and HOWTO Documents]&lt;br /&gt;
* [http://www.tldp.org/LDP/nag/nag.html The Network Administrators' Guide by Olaf Kirch]&lt;br /&gt;
* [http://unfs3.sourceforge.net/ unfs3 homepage]&lt;br /&gt;
* [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server  source package]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3533</id>
		<title>NFS server inside container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=3533"/>
		<updated>2007-10-27T02:00:59Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Improve the grammar a little&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two ways to setup NFS server on common [[HN]]:&lt;br /&gt;
use a user-space NFS server daemon or use an in-kernel implementation&lt;br /&gt;
of NFS server. Some peculiarities appear if you intend to run NFS server&lt;br /&gt;
in [[VE]].&lt;br /&gt;
&lt;br /&gt;
{{Note|for information about NFS client inside VE, see [[NFS]].}}&lt;br /&gt;
&lt;br /&gt;
== Kernel NFS server ==&lt;br /&gt;
Binary RPMs that are provided by OpenVZ community contain kernels compiled&lt;br /&gt;
without NFS server support. Thus you have to&lt;br /&gt;
[[Kernel build|recompile the kernel]] with &amp;lt;code&amp;gt;CONFIG_NFSD=m&amp;lt;/code&amp;gt;. After booting in this kernel you'll be able&lt;br /&gt;
to use NFS server on [[HN]].&lt;br /&gt;
In-kernel NFS server runs kernel threads to service requests of clients.&lt;br /&gt;
But for security reasons kernel threads are prohibited in [[VE]]s! So you won't&lt;br /&gt;
be able to run NFS server inside [[VE]] without patching the kernel.&lt;br /&gt;
&lt;br /&gt;
== User-space NFS server ==&lt;br /&gt;
Advantage of user-space NFS server is that it can be ran without any support in the kernel.&lt;br /&gt;
Also if it crashes — there is no crash of the system: just one process crashes, not the kernel!&lt;br /&gt;
The disadvantage of user-space NFS server is its productivity: no one can be faster than in-kernel implementation.&lt;br /&gt;
&lt;br /&gt;
One well-known implementation of NFS server is &amp;quot;The LINUX User-Space NFS Server&amp;quot; by Olaf Kirch.&lt;br /&gt;
Some Linux distributions contain this package: Debian Sarge (&amp;lt;code&amp;gt;nfs-user-server&amp;lt;/code&amp;gt;), OpenSUSE 10.0 (&amp;lt;code&amp;gt;nfs-server&amp;lt;/code&amp;gt;).&lt;br /&gt;
For other distributions you can download sources (for example from Debian repository) and compile it.&lt;br /&gt;
There is a small trick you have to know about running &amp;lt;code&amp;gt;mountd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nfsd&amp;lt;/code&amp;gt; (these two daemons and &amp;lt;code&amp;gt;portmap&amp;lt;/code&amp;gt; constitute a user-space server).  You should run them with the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# portmap&lt;br /&gt;
# rpc.mountd -r&lt;br /&gt;
# rpc.nfsd -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The reason is that these daemons check the major number of the device where the directory to export resides.&lt;br /&gt;
If major equals 0 then daemons assume that it is NFS and don't want to re-export it. Symptoms are&lt;br /&gt;
that clients will always get a &amp;quot;permission denied&amp;quot; error. Simfs (the file system on which VE is located)&lt;br /&gt;
is associated with so called unnamed device, in which major equals 0. So, to prevent daemons from checking for&lt;br /&gt;
re-exporting — just use this &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
“The LINUX User-Space NFS Server” by Olaf Kirch implements NFSv2. It means that only files with sizes less&lt;br /&gt;
than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server&lt;br /&gt;
implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://nfs.sourceforge.net/ Linux NFS Overview, FAQ and HOWTO Documents]&lt;br /&gt;
* [http://www.tldp.org/LDP/nag/nag.html The Network Administrators' Guide by Olaf Kirch]&lt;br /&gt;
* [http://unfs3.sourceforge.net/ unfs3 homepage]&lt;br /&gt;
* [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server  source package]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3441</id>
		<title>DB2 installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3441"/>
		<updated>2007-09-06T14:47:22Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Call it a VE consistently&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DB2 has been certified by IBM for use inside Virtuozzo. It works in OpenVZ too!&lt;br /&gt;
&lt;br /&gt;
IBM provides a free download of DB2 Express-C which is what I&lt;br /&gt;
installed.&lt;br /&gt;
&lt;br /&gt;
Here is a rough guide to installing DB2 into a freshly-created VE.&lt;br /&gt;
&lt;br /&gt;
== Create a new VE ==&lt;br /&gt;
&lt;br /&gt;
I created a new VE for the Debian distribution using debootstrap.&lt;br /&gt;
&lt;br /&gt;
== Set VE resource limits appropriately ==&lt;br /&gt;
&lt;br /&gt;
DB2 installation can fail and it will not be possible to operate the database if your resource limits are too low. I used these limits for a small database:&lt;br /&gt;
&lt;br /&gt;
* kmemsize to 10,000,000&lt;br /&gt;
* privvmpages to 300,000&lt;br /&gt;
* shmpages to 80,000&lt;br /&gt;
* numproc to 150&lt;br /&gt;
* tcpsndbuf to 700,000&lt;br /&gt;
* tcprcvbuf to 700,000&lt;br /&gt;
* diskspace to 6,000,000&lt;br /&gt;
&lt;br /&gt;
== Install additional packages ==&lt;br /&gt;
&lt;br /&gt;
* libstdc++5 (required for installation)&lt;br /&gt;
* pdksh (required for operation?)&lt;br /&gt;
* ssh   (may be required for operation)&lt;br /&gt;
* xbase-clients (for xauth)&lt;br /&gt;
* firefox (for post-installation)&lt;br /&gt;
* strace and telnet (for debugging)&lt;br /&gt;
* libdbi-perl gcc libc6-dev make (for building CPAN DBD::DB2 package)&lt;br /&gt;
&lt;br /&gt;
== Download the DB2 Express-C package ==&lt;br /&gt;
&lt;br /&gt;
DB2 Express-C version 9 is available from this page:&lt;br /&gt;
[[http://www-306.ibm.com/software/data/db2/express/download.html]]&lt;br /&gt;
&lt;br /&gt;
You will need to register with IBM before you can download.&lt;br /&gt;
&lt;br /&gt;
* Untar the received file as root&lt;br /&gt;
* Run exp/disk1/db2setup&lt;br /&gt;
* Follow the prompts:&lt;br /&gt;
** Setup user 'dasusr1'&lt;br /&gt;
** Setup user 'db2inst1' and database instance 'db2inst1'&lt;br /&gt;
&lt;br /&gt;
== Post-install actions ==&lt;br /&gt;
&lt;br /&gt;
This is where it gets yukky. DB2 wants to run a browser inside the VE. It wants to run Java applets inside the browser. I installed Iceweasel, but the post-install script does not recognise it. I was eventually able to hack the script to recognise and use the browser but it crashed on one of the Java applets. I think you can get by without running the post-install.&lt;br /&gt;
&lt;br /&gt;
Here's what to do instead:&lt;br /&gt;
&lt;br /&gt;
First, su to the instance owner:&lt;br /&gt;
&lt;br /&gt;
* su - db2inst1&lt;br /&gt;
&lt;br /&gt;
Try starting and stopping the database:&lt;br /&gt;
&lt;br /&gt;
* db2start&lt;br /&gt;
* db2stop&lt;br /&gt;
&lt;br /&gt;
If these don't work it means your environment variables are not set properly. IBM set these for me:&lt;br /&gt;
&lt;br /&gt;
 CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.&lt;br /&gt;
 DB2INSTANCE=db2inst1&lt;br /&gt;
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc&lt;br /&gt;
&lt;br /&gt;
Try creating IBM's sample database:&lt;br /&gt;
&lt;br /&gt;
* db2sampl&lt;br /&gt;
&lt;br /&gt;
== Setup a development environment ==&lt;br /&gt;
&lt;br /&gt;
I develop in perl so I was most interested in access to the database though the DBI library. I did this:&lt;br /&gt;
&lt;br /&gt;
* Use CPAN to download and install DBD::DB2&lt;br /&gt;
&lt;br /&gt;
If you don't use CPAN you can also do this (as root):&lt;br /&gt;
&lt;br /&gt;
* Download http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.1.tar.gz&lt;br /&gt;
* Untar the file and change into the directory&lt;br /&gt;
* perl Makefile.PL PREFIX=/usr&lt;br /&gt;
* make&lt;br /&gt;
* make test&lt;br /&gt;
* make install&lt;br /&gt;
&lt;br /&gt;
== Setup DB2 for autostart ==&lt;br /&gt;
&lt;br /&gt;
It seems that DB2 can be auto-started at VE boot time, but not auto-stopped. I used this script:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # Script to start DB2 instances on bootup.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 set -e&lt;br /&gt;
 &lt;br /&gt;
 . /lib/lsb/init-functions&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         echo Starting DB2&lt;br /&gt;
         /opt/ibm/db2/V9.1/instance/db2istrt&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         ;;&lt;br /&gt;
 restart|reload)&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
And I used this command to create the symlink to make it start at VE &amp;quot;boot&amp;quot; time:&lt;br /&gt;
&lt;br /&gt;
 update-rc.d db2 start 95 2 .&lt;br /&gt;
&lt;br /&gt;
== Testing your installation ==&lt;br /&gt;
&lt;br /&gt;
From the db2inst1 user, do:&lt;br /&gt;
&lt;br /&gt;
* db2&lt;br /&gt;
&lt;br /&gt;
Inside the db2 client, try:&lt;br /&gt;
&lt;br /&gt;
 connect to sample&lt;br /&gt;
 grant dbadm on database to user fred&lt;br /&gt;
 connect reset&lt;br /&gt;
&lt;br /&gt;
== Enjoy! ==&lt;br /&gt;
&lt;br /&gt;
Please provide feedback in the discussion (Talk) page about improvements to this HOWTO.&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3440</id>
		<title>DB2 installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3440"/>
		<updated>2007-09-06T14:45:09Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Fixed grant command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DB2 has been certified by IBM for use inside Virtuozzo. It works in OpenVZ too!&lt;br /&gt;
&lt;br /&gt;
IBM provides a free download of DB2 Express-C which is what I&lt;br /&gt;
installed.&lt;br /&gt;
&lt;br /&gt;
Here is a rough guide to installing DB2 into a freshly-created VE.&lt;br /&gt;
&lt;br /&gt;
== Create a new VE ==&lt;br /&gt;
&lt;br /&gt;
I created a new VE for the Debian distribution using debootstrap.&lt;br /&gt;
&lt;br /&gt;
== Set VE resource limits appropriately ==&lt;br /&gt;
&lt;br /&gt;
DB2 installation can fail and it will not be possible to operate the database if your resource limits are too low. I used these limits for a small database:&lt;br /&gt;
&lt;br /&gt;
* kmemsize to 10,000,000&lt;br /&gt;
* privvmpages to 300,000&lt;br /&gt;
* shmpages to 80,000&lt;br /&gt;
* numproc to 150&lt;br /&gt;
* tcpsndbuf to 700,000&lt;br /&gt;
* tcprcvbuf to 700,000&lt;br /&gt;
* diskspace to 6,000,000&lt;br /&gt;
&lt;br /&gt;
== Install additional packages ==&lt;br /&gt;
&lt;br /&gt;
* libstdc++5 (required for installation)&lt;br /&gt;
* pdksh (required for operation?)&lt;br /&gt;
* ssh   (may be required for operation)&lt;br /&gt;
* xbase-clients (for xauth)&lt;br /&gt;
* firefox (for post-installation)&lt;br /&gt;
* strace and telnet (for debugging)&lt;br /&gt;
* libdbi-perl gcc libc6-dev make (for building CPAN DBD::DB2 package)&lt;br /&gt;
&lt;br /&gt;
== Download the DB2 Express-C package ==&lt;br /&gt;
&lt;br /&gt;
DB2 Express-C version 9 is available from this page:&lt;br /&gt;
[[http://www-306.ibm.com/software/data/db2/express/download.html]]&lt;br /&gt;
&lt;br /&gt;
You will need to register with IBM before you can download.&lt;br /&gt;
&lt;br /&gt;
* Untar the received file as root&lt;br /&gt;
* Run exp/disk1/db2setup&lt;br /&gt;
* Follow the prompts:&lt;br /&gt;
** Setup user 'dasusr1'&lt;br /&gt;
** Setup user 'db2inst1' and database instance 'db2inst1'&lt;br /&gt;
&lt;br /&gt;
== Post-install actions ==&lt;br /&gt;
&lt;br /&gt;
This is where it gets yukky. DB2 wants to run a browser inside the VPS. It wants to run Java applets inside the browser. I installed Iceweasel, but the post-install script does not recognise it. I was eventually able to hack the script to recognise and use the browser but it crashed on one of the Java applets. I think you can get by without running the post-install.&lt;br /&gt;
&lt;br /&gt;
Here's what to do instead:&lt;br /&gt;
&lt;br /&gt;
First, su to the instance owner:&lt;br /&gt;
&lt;br /&gt;
* su - db2inst1&lt;br /&gt;
&lt;br /&gt;
Try starting and stopping the database:&lt;br /&gt;
&lt;br /&gt;
* db2start&lt;br /&gt;
* db2stop&lt;br /&gt;
&lt;br /&gt;
If these don't work it means your environment variables are not set properly. IBM set these for me:&lt;br /&gt;
&lt;br /&gt;
 CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.&lt;br /&gt;
 DB2INSTANCE=db2inst1&lt;br /&gt;
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc&lt;br /&gt;
&lt;br /&gt;
Try creating IBM's sample database:&lt;br /&gt;
&lt;br /&gt;
* db2sampl&lt;br /&gt;
&lt;br /&gt;
== Setup a development environment ==&lt;br /&gt;
&lt;br /&gt;
I develop in perl so I was most interested in access to the database though the DBI library. I did this:&lt;br /&gt;
&lt;br /&gt;
* Use CPAN to download and install DBD::DB2&lt;br /&gt;
&lt;br /&gt;
If you don't use CPAN you can also do this (as root):&lt;br /&gt;
&lt;br /&gt;
* Download http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.1.tar.gz&lt;br /&gt;
* Untar the file and change into the directory&lt;br /&gt;
* perl Makefile.PL PREFIX=/usr&lt;br /&gt;
* make&lt;br /&gt;
* make test&lt;br /&gt;
* make install&lt;br /&gt;
&lt;br /&gt;
== Setup DB2 for autostart ==&lt;br /&gt;
&lt;br /&gt;
It seems that DB2 can be auto-started at VE boot time, but not auto-stopped. I used this script:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # Script to start DB2 instances on bootup.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 set -e&lt;br /&gt;
 &lt;br /&gt;
 . /lib/lsb/init-functions&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         echo Starting DB2&lt;br /&gt;
         /opt/ibm/db2/V9.1/instance/db2istrt&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         ;;&lt;br /&gt;
 restart|reload)&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
And I used this command to create the symlink to make it start at VE &amp;quot;boot&amp;quot; time:&lt;br /&gt;
&lt;br /&gt;
 update-rc.d db2 start 95 2 .&lt;br /&gt;
&lt;br /&gt;
== Testing your installation ==&lt;br /&gt;
&lt;br /&gt;
From the db2inst1 user, do:&lt;br /&gt;
&lt;br /&gt;
* db2&lt;br /&gt;
&lt;br /&gt;
Inside the db2 client, try:&lt;br /&gt;
&lt;br /&gt;
 connect to sample&lt;br /&gt;
 grant dbadm on database to user fred&lt;br /&gt;
 connect reset&lt;br /&gt;
&lt;br /&gt;
== Enjoy! ==&lt;br /&gt;
&lt;br /&gt;
Please provide feedback in the discussion (Talk) page about improvements to this HOWTO.&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Checkpointing_and_live_migration&amp;diff=3436</id>
		<title>Checkpointing and live migration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Checkpointing_and_live_migration&amp;diff=3436"/>
		<updated>2007-09-06T09:15:06Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: This looks even better&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CPT is an extension to the OpenVZ kernel which can save the full state of a running VE and to restore it later on the same or on a different host in a way transparent to running applications and network connections. This technique has several applications, the most important being live (zero-downtime) migration of VEs and taking an instant snapshot of a running VE for later resume, i.e. CheckPoinTing.&lt;br /&gt;
&lt;br /&gt;
Before CPT, it was only possible to migrate a VE through a shutdown and subsequent reboot. The procedure not only introduces quite a long downtime for network services, it is not transparent for clients using the VE, making migration impossible when clients run some tasks which are not tolerant to shutdowns.&lt;br /&gt;
&lt;br /&gt;
Compared with this old scheme, CPT allows migration of a VE in a way which is essentially invisible both for users of this VE and for external clients using network services located inside the VE. It still introduces a short delay in service, required for actual checkpoint/restore of the processes, but this delay is indistinguishable from a short interruption of network connectivity.&lt;br /&gt;
&lt;br /&gt;
== Online migration ==&lt;br /&gt;
&lt;br /&gt;
There is a special utility vzmigrate in the OpenVZ distribution intended to support VE migration. With its help one can perform live (a.k.a. online) migration, i.e. during migration the VE “freezes” for some time, and after migration it continues to work as though nothing had happened. Online migration can be performed with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzmigrate --online &amp;lt;host&amp;gt; VEID&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During online migration all VE private data saved to an image file, which is transferred to the target host.&lt;br /&gt;
&lt;br /&gt;
In order for vzmigrate to work without asking for a password, ssh public keys from the source host should be placed in the destination host's &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; file. In other words, command &amp;lt;code&amp;gt;ssh root@host&amp;lt;/code&amp;gt; should not ask you for a password. See [[ssh keys]] for more info.&lt;br /&gt;
&lt;br /&gt;
== Manual Checkpoint and Restore Functions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vzmigrate&amp;lt;/code&amp;gt; is not strictly required to perform online migration. The &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; utility, accompanied with some file system backup tools, provides enough power to do all the tasks.&lt;br /&gt;
&lt;br /&gt;
A VE can be checkpointed with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This command saves all the state of a running VE to the dump file and stops the VE. If the option &amp;lt;code&amp;gt;--dumpfile&amp;lt;/code&amp;gt; is not set, &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; uses a default path &amp;lt;code&amp;gt;/vz/dump/Dump.VEID&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
After this it is possible to restore the VE to the same state executing:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the dump file and file system is transferred to another HW node, the same command can restore the VE there with the same success.&lt;br /&gt;
&lt;br /&gt;
It is a critical requirement that file system at the moment of restore must be identical to the file system at the moment of checkpointing. If this requirement is not met, depending on the severity of changes, the process of restoration can be aborted or the processes inside a VE can see this as an external corruption of open files. When a VE is restored on the same node where it was checkpointed, it is enough to not touch the file system accessible by the VE. When a VE is transferred to another node it is necessary to synchronize the VE file system before restore. &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; does not provide this functionality and external tools (i.e. &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt;) are required.&lt;br /&gt;
&lt;br /&gt;
== Step-by-step Checkpoint and Restore ==&lt;br /&gt;
&lt;br /&gt;
The process of checkpointing can be performed in stages. It consists of three steps.&lt;br /&gt;
&lt;br /&gt;
First step – suspend the VE. At this stage CPT moves all the processes to a special beforehand known state and stops VE network interfaces. This stage can be done with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --suspend&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second step – dumping VE. At this stage CPT saves the state of processes and global state of VE to an image file. All the process private data needs to be saved: address space, register set, opened files/pipes/sockets, System V IPC structures, current working directory, signal handlers, timers, terminal settings, user identities (uid, gid, etc), process identities (pid, pgrp, sid, etc), rlimit and other data. This stage can be done with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --dump --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Third step – killing or resuming processes. If the migration succeeds the VE can be stopped with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --kill&amp;lt;/pre&amp;gt;&lt;br /&gt;
If migration failed for some reason or if the goal was taking a snapshot of the VE state for later restore, CPT can resume the VE with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --resume&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process of restoring consists of two steps.&lt;br /&gt;
&lt;br /&gt;
The first step is to restore processes and to leave them in a special frozen state. After this step processes are ready to continue execution, however, in some cases CPT has to do some operations after a process is woken up, therefore CPT sets process return point to function in our module. This stage can be done with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --undump --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Second step – waking up processes or killing them if the restore process failed. After CPT wakes up process, it performs necessary operations in our function and continues execution. This stage can be done with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --resume&amp;lt;/pre&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --kill&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Technology]]&lt;br /&gt;
[[Category: Concepts]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Checkpointing_and_live_migration&amp;diff=3435</id>
		<title>Checkpointing and live migration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Checkpointing_and_live_migration&amp;diff=3435"/>
		<updated>2007-09-06T09:13:13Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Tidy up the grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CPT is an extension to the OpenVZ kernel which can save the full state of a running VE and to restore it later on the same or on a different host in a way transparent to running applications and network connections. This technique has several applications, the most important being live (zero-downtime) migration of VEs and taking an instant snapshot of a running VE for later resume, i.e. CheckPoinTing.&lt;br /&gt;
&lt;br /&gt;
Before CPT, it was only possible to migrate a VE through a shutdown and subsequent reboot. The procedure not only introduces quite a long downtime for network services, it is not transparent for clients using the VE, making migration impossible when clients run some tasks which are not tolerant to shutdowns.&lt;br /&gt;
&lt;br /&gt;
Compared with this old scheme, CPT allows migration of a VE in a way which is essentially invisible both for users of this VE and for external clients using network services located inside the VE. It still introduces a short delay in service, required for actual checkpoint/restore of the processes, but this delay is indistinguishable from a short interruption of network connectivity.&lt;br /&gt;
&lt;br /&gt;
== Online migration ==&lt;br /&gt;
&lt;br /&gt;
There is a special utility vzmigrate in the OpenVZ distribution intended to support VE migration. With its help one can perform live (a.k.a. online) migration, i.e. during migration the VE “freezes” for some time, and after migration it continues to work as though nothing had happened. Online migration can be performed with the&lt;br /&gt;
&amp;lt;pre&amp;gt;vzmigrate --online &amp;lt;host&amp;gt; VEID&amp;lt;/pre&amp;gt;&lt;br /&gt;
command. During online migration all VE private data saved to an image file, which is transferred to the target host.&lt;br /&gt;
&lt;br /&gt;
In order for vzmigrate to work without asking for a password, ssh public keys from the source host should be placed in the destination host's &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; file. In other words, command &amp;lt;code&amp;gt;ssh root@host&amp;lt;/code&amp;gt; should not ask you for a password. See [[ssh keys]] for more info.&lt;br /&gt;
&lt;br /&gt;
== Manual Checkpoint and Restore Functions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vzmigrate&amp;lt;/code&amp;gt; is not strictly required to perform online migration. The &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; utility, accompanied with some file system backup tools, provides enough power to do all the tasks.&lt;br /&gt;
&lt;br /&gt;
A VE can be checkpointed with command:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This command saves all the state of a running VE to the dump file and stops the VE. If the option &amp;lt;code&amp;gt;--dumpfile&amp;lt;/code&amp;gt; is not set, &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; uses a default path &amp;lt;code&amp;gt;/vz/dump/Dump.VEID&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
After this it is possible to restore the VE to the same state executing:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the dump file and file system is transferred to another HW node, the same command can restore the VE there with the same success.&lt;br /&gt;
&lt;br /&gt;
It is a critical requirement that file system at the moment of restore must be identical to the file system at the moment of checkpointing. If this requirement is not met, depending on the severity of changes, the process of restoration can be aborted or the processes inside a VE can see this as an external corruption of open files. When a VE is restored on the same node where it was checkpointed, it is enough to not touch the file system accessible by the VE. When a VE is transferred to another node it is necessary to synchronize the VE file system before restore. &amp;lt;code&amp;gt;vzctl&amp;lt;/code&amp;gt; does not provide this functionality and external tools (i.e. &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt;) are required.&lt;br /&gt;
&lt;br /&gt;
== Step-by-step Checkpoint and Restore ==&lt;br /&gt;
&lt;br /&gt;
The process of checkpointing can be performed in stages. It consists of three steps.&lt;br /&gt;
&lt;br /&gt;
First step – suspend the VE. At this stage CPT moves all the processes to a special beforehand known state and stops VE network interfaces. This stage can be done with the&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --suspend&amp;lt;/pre&amp;gt;&lt;br /&gt;
command.&lt;br /&gt;
&lt;br /&gt;
Second step – dumping VE. At this stage CPT saves the state of processes and global state of VE to an image file. All the process private data needs to be saved: address space, register set, opened files/pipes/sockets, System V IPC structures, current working directory, signal handlers, timers, terminal settings, user identities (uid, gid, etc), process identities (pid, pgrp, sid, etc), rlimit and other data. This stage can be done with the&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --dump --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
command.&lt;br /&gt;
&lt;br /&gt;
Third step – killing or resuming processes. If the migration succeeds the VE can be stopped with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --kill&amp;lt;/pre&amp;gt;&lt;br /&gt;
If migration failed for some reason or if the goal was taking a snapshot of the VE state for later restore, CPT can resume the VE with:&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl chkpnt VEID --resume&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process of restoring consists of two steps.&lt;br /&gt;
&lt;br /&gt;
The first step is to restore processes and to leave them in a special frozen state. After this step processes are ready to continue execution, however, in some cases CPT has to do some operations after a process is woken up, therefore CPT sets process return point to function in our module. This stage can be done with the&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --undump --dumpfile &amp;lt;path&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
command.&lt;br /&gt;
&lt;br /&gt;
Second step – waking up processes or killing them if the restore process failed. After CPT wakes up process, it performs necessary operations in our function and continues execution. This stage can be done with the&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl restore VEID --resume&lt;br /&gt;
vzctl restore VEID --kill&amp;lt;/pre&amp;gt;&lt;br /&gt;
commands.&lt;br /&gt;
&lt;br /&gt;
[[Category: Technology]]&lt;br /&gt;
[[Category: Concepts]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Use_cases&amp;diff=3434</id>
		<title>Use cases</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Use_cases&amp;diff=3434"/>
		<updated>2007-09-06T08:45:28Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Tidy grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
OpenVZ has a number of unique features that can be effectively used in the following scenarios:&lt;br /&gt;
&lt;br /&gt;
== Improved security ==&lt;br /&gt;
&lt;br /&gt;
Consider a Linux server used to serve mail, web site, and DNS. There are at least three different applications listening to and handling network requests, and any of them can contain security holes. Using OpenVZ, a server can be divided into three [[VE]]s, one for each application. Thus, if the DNS server is compromised, the other applications will still be left intact due to complete isolation between VEs.&lt;br /&gt;
&lt;br /&gt;
== Server consolidation == &lt;br /&gt;
&lt;br /&gt;
Having a separate physical server for each application is generally a good approach, it increases availability and improves security. However, separate servers lead to increased costs of hardware and collocation, and modern hardware is often underutilized in this scenario.&lt;br /&gt;
&lt;br /&gt;
With OpenVZ, you can enjoy the benefits of dedicated server without such drawbacks. Create a VE for each application and use the existing hardware more efficiently. This approach can be deployed totally transparently to users using OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Development and testing ==&lt;br /&gt;
&lt;br /&gt;
Developers often need access to several different Linux distributions to develop an application. Testing also needs to be performed on various software configurations. Therefore, testing and development groups often require a lot of hardware. &lt;br /&gt;
&lt;br /&gt;
Alternatively, using OpenVZ developers and QAs can create multiple partitions with different Linux distributions and configurations residing on one physical server. Each VE can have its own set of packages, system libraries, configuration files. You can do snapshots and rollbacks.&lt;br /&gt;
&lt;br /&gt;
== Hosting ==&lt;br /&gt;
* Isolated users&lt;br /&gt;
* A VE is like a real server, just very cheap&lt;br /&gt;
* Each user can have an individual versions of applications&lt;br /&gt;
* Much easier to administer&lt;br /&gt;
&lt;br /&gt;
== Educational ==&lt;br /&gt;
&lt;br /&gt;
With OpenVZ, a separate VE can be created for every student. Thus, each student gets their own root account and can do everything on their own server, e.g. experiment with firewall configuration rules (iptables).&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3433</id>
		<title>DB2 installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3433"/>
		<updated>2007-09-06T08:43:53Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Last one.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DB2 has been certified by IBM for use inside Virtuozzo. It works in OpenVZ too!&lt;br /&gt;
&lt;br /&gt;
IBM provides a free download of DB2 Express-C which is what I&lt;br /&gt;
installed.&lt;br /&gt;
&lt;br /&gt;
Here is a rough guide to installing DB2 into a freshly-created VE.&lt;br /&gt;
&lt;br /&gt;
== Create a new VE ==&lt;br /&gt;
&lt;br /&gt;
I created a new VE for the Debian distribution using debootstrap.&lt;br /&gt;
&lt;br /&gt;
== Set VE resource limits appropriately ==&lt;br /&gt;
&lt;br /&gt;
DB2 installation can fail and it will not be possible to operate the database if your resource limits are too low. I used these limits for a small database:&lt;br /&gt;
&lt;br /&gt;
* kmemsize to 10,000,000&lt;br /&gt;
* privvmpages to 300,000&lt;br /&gt;
* shmpages to 80,000&lt;br /&gt;
* numproc to 150&lt;br /&gt;
* tcpsndbuf to 700,000&lt;br /&gt;
* tcprcvbuf to 700,000&lt;br /&gt;
* diskspace to 6,000,000&lt;br /&gt;
&lt;br /&gt;
== Install additional packages ==&lt;br /&gt;
&lt;br /&gt;
* libstdc++5 (required for installation)&lt;br /&gt;
* pdksh (required for operation?)&lt;br /&gt;
* ssh   (may be required for operation)&lt;br /&gt;
* xbase-clients (for xauth)&lt;br /&gt;
* firefox (for post-installation)&lt;br /&gt;
* strace and telnet (for debugging)&lt;br /&gt;
* libdbi-perl gcc libc6-dev make (for building CPAN DBD::DB2 package)&lt;br /&gt;
&lt;br /&gt;
== Download the DB2 Express-C package ==&lt;br /&gt;
&lt;br /&gt;
DB2 Express-C version 9 is available from this page:&lt;br /&gt;
[[http://www-306.ibm.com/software/data/db2/express/download.html]]&lt;br /&gt;
&lt;br /&gt;
You will need to register with IBM before you can download.&lt;br /&gt;
&lt;br /&gt;
* Untar the received file as root&lt;br /&gt;
* Run exp/disk1/db2setup&lt;br /&gt;
* Follow the prompts:&lt;br /&gt;
** Setup user 'dasusr1'&lt;br /&gt;
** Setup user 'db2inst1' and database instance 'db2inst1'&lt;br /&gt;
&lt;br /&gt;
== Post-install actions ==&lt;br /&gt;
&lt;br /&gt;
This is where it gets yukky. DB2 wants to run a browser inside the VPS. It wants to run Java applets inside the browser. I installed Iceweasel, but the post-install script does not recognise it. I was eventually able to hack the script to recognise and use the browser but it crashed on one of the Java applets. I think you can get by without running the post-install.&lt;br /&gt;
&lt;br /&gt;
Here's what to do instead:&lt;br /&gt;
&lt;br /&gt;
First, su to the instance owner:&lt;br /&gt;
&lt;br /&gt;
* su - db2inst1&lt;br /&gt;
&lt;br /&gt;
Try starting and stopping the database:&lt;br /&gt;
&lt;br /&gt;
* db2start&lt;br /&gt;
* db2stop&lt;br /&gt;
&lt;br /&gt;
If these don't work it means your environment variables are not set properly. IBM set these for me:&lt;br /&gt;
&lt;br /&gt;
 CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.&lt;br /&gt;
 DB2INSTANCE=db2inst1&lt;br /&gt;
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc&lt;br /&gt;
&lt;br /&gt;
Try creating IBM's sample database:&lt;br /&gt;
&lt;br /&gt;
* db2sampl&lt;br /&gt;
&lt;br /&gt;
== Setup a development environment ==&lt;br /&gt;
&lt;br /&gt;
I develop in perl so I was most interested in access to the database though the DBI library. I did this:&lt;br /&gt;
&lt;br /&gt;
* Use CPAN to download and install DBD::DB2&lt;br /&gt;
&lt;br /&gt;
If you don't use CPAN you can also do this (as root):&lt;br /&gt;
&lt;br /&gt;
* Download http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.1.tar.gz&lt;br /&gt;
* Untar the file and change into the directory&lt;br /&gt;
* perl Makefile.PL PREFIX=/usr&lt;br /&gt;
* make&lt;br /&gt;
* make test&lt;br /&gt;
* make install&lt;br /&gt;
&lt;br /&gt;
== Setup DB2 for autostart ==&lt;br /&gt;
&lt;br /&gt;
It seems that DB2 can be auto-started at VE boot time, but not auto-stopped. I used this script:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # Script to start DB2 instances on bootup.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 set -e&lt;br /&gt;
 &lt;br /&gt;
 . /lib/lsb/init-functions&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         echo Starting DB2&lt;br /&gt;
         /opt/ibm/db2/V9.1/instance/db2istrt&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         ;;&lt;br /&gt;
 restart|reload)&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
And I used this command to create the symlink to make it start at VE &amp;quot;boot&amp;quot; time:&lt;br /&gt;
&lt;br /&gt;
 update-rc.d db2 start 95 2 .&lt;br /&gt;
&lt;br /&gt;
== Testing your installation ==&lt;br /&gt;
&lt;br /&gt;
From the db2inst1 user, do:&lt;br /&gt;
&lt;br /&gt;
* db2&lt;br /&gt;
&lt;br /&gt;
Inside the db2 client, try:&lt;br /&gt;
&lt;br /&gt;
 connect to sample&lt;br /&gt;
 grant all privileges to user fred (?not sure?)&lt;br /&gt;
 connect reset&lt;br /&gt;
&lt;br /&gt;
== Enjoy! ==&lt;br /&gt;
&lt;br /&gt;
Please provide feedback in the discussion (Talk) page about improvements to this HOWTO.&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3432</id>
		<title>DB2 installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3432"/>
		<updated>2007-09-06T08:42:12Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: Tidy it up a little now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DB2 has been certified by IBM for use inside Virtuozzo. It works in OpenVZ too!&lt;br /&gt;
&lt;br /&gt;
IBM provides a free download of DB2 Express-C which is what I&lt;br /&gt;
installed.&lt;br /&gt;
&lt;br /&gt;
Here is a rough guide to installing DB2 into a freshly-created VE.&lt;br /&gt;
&lt;br /&gt;
== Create a new VE ==&lt;br /&gt;
&lt;br /&gt;
I created a new VE for the Debian distribution using debootstrap.&lt;br /&gt;
&lt;br /&gt;
== Set VE resource limits appropriately ==&lt;br /&gt;
&lt;br /&gt;
DB2 installation can fail and it will not be possible to operate the database if your resource limits are too low. I used these limits for a small database:&lt;br /&gt;
&lt;br /&gt;
* kmemsize to 10,000,000&lt;br /&gt;
* privvmpages to 300,000&lt;br /&gt;
* shmpages to 80,000&lt;br /&gt;
* numproc to 150&lt;br /&gt;
* tcpsndbuf to 700,000&lt;br /&gt;
* tcprcvbuf to 700,000&lt;br /&gt;
* diskspace to 6,000,000&lt;br /&gt;
&lt;br /&gt;
== Install additional packages ==&lt;br /&gt;
&lt;br /&gt;
* libstdc++5 (required for installation)&lt;br /&gt;
* pdksh (required for operation?)&lt;br /&gt;
* ssh   (may be required for operation)&lt;br /&gt;
* xbase-clients (for xauth)&lt;br /&gt;
* firefox (for post-installation)&lt;br /&gt;
* strace and telnet (for debugging)&lt;br /&gt;
* libdbi-perl gcc libc6-dev make (for building CPAN DBD::DB2 package)&lt;br /&gt;
&lt;br /&gt;
== Download the DB2 Express-C package ==&lt;br /&gt;
&lt;br /&gt;
DB2 Express-C version 9 is available from this page:&lt;br /&gt;
[[http://www-306.ibm.com/software/data/db2/express/download.html]]&lt;br /&gt;
&lt;br /&gt;
You will need to register with IBM before you can download.&lt;br /&gt;
&lt;br /&gt;
* Untar the received file as root&lt;br /&gt;
* Run exp/disk1/db2setup&lt;br /&gt;
* Follow the prompts:&lt;br /&gt;
** Setup user 'dasusr1'&lt;br /&gt;
** Setup user 'db2inst1' and database instance 'db2inst1'&lt;br /&gt;
&lt;br /&gt;
== Post-install actions ==&lt;br /&gt;
&lt;br /&gt;
This is where it gets yukky. DB2 wants to run a browser inside the VPS. It wants to run Java applets inside the browser. I installed Iceweasel, but the post-install script does not recognise it. I was eventually able to hack the script to recognise and use the browser but it crashed on one of the Java applets. I think you can get by without running the post-install.&lt;br /&gt;
&lt;br /&gt;
Here's what to do instead:&lt;br /&gt;
&lt;br /&gt;
First, su to the instance owner:&lt;br /&gt;
&lt;br /&gt;
* su - db2inst1&lt;br /&gt;
&lt;br /&gt;
Try starting and stopping the database:&lt;br /&gt;
&lt;br /&gt;
* db2start&lt;br /&gt;
* db2stop&lt;br /&gt;
&lt;br /&gt;
If these don't work it means your environment variables are not set properly. IBM set these for me:&lt;br /&gt;
&lt;br /&gt;
 CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.&lt;br /&gt;
 DB2INSTANCE=db2inst1&lt;br /&gt;
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc&lt;br /&gt;
&lt;br /&gt;
Try creating IBM's sample database:&lt;br /&gt;
&lt;br /&gt;
* db2sampl&lt;br /&gt;
&lt;br /&gt;
== Setup a development environment ==&lt;br /&gt;
&lt;br /&gt;
I develop in perl so I was most interested in access to the database though the DBI library. I did this:&lt;br /&gt;
&lt;br /&gt;
* Use CPAN to download and install DBD::DB2&lt;br /&gt;
&lt;br /&gt;
If you don't use CPAN you can also do this (as root):&lt;br /&gt;
&lt;br /&gt;
* Download http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.1.tar.gz&lt;br /&gt;
* Untar the file and change into the directory&lt;br /&gt;
* perl Makefile.PL PREFIX=/usr&lt;br /&gt;
* make&lt;br /&gt;
* make test&lt;br /&gt;
* make install&lt;br /&gt;
&lt;br /&gt;
== Setup DB2 for autostart ==&lt;br /&gt;
&lt;br /&gt;
It seems that DB2 can be auto-started at VE boot time, but not auto-stopped. I used this script:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # Script to start DB2 instances on bootup.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 set -e&lt;br /&gt;
 &lt;br /&gt;
 . /lib/lsb/init-functions&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         echo Starting DB2&lt;br /&gt;
         /opt/ibm/db2/V9.1/instance/db2istrt&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         ;;&lt;br /&gt;
 restart|reload)&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
And I used this command to create the symlink to make it start at VE &amp;quot;boot&amp;quot; time:&lt;br /&gt;
&lt;br /&gt;
 update-rc.d db2 start 95 2 .&lt;br /&gt;
&lt;br /&gt;
== Testing your installation ==&lt;br /&gt;
&lt;br /&gt;
From the db2inst1 user, do:&lt;br /&gt;
&lt;br /&gt;
* db2&lt;br /&gt;
&lt;br /&gt;
Inside the db2 client, try:&lt;br /&gt;
&lt;br /&gt;
 connect to sample&lt;br /&gt;
 grant all privileges to user fred (?not sure?)&lt;br /&gt;
 connect reset&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3431</id>
		<title>DB2 installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=DB2_installation&amp;diff=3431"/>
		<updated>2007-09-06T08:40:14Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: How to get DB2 Express-C going in a Virtual Environment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DB2 has been certified by IBM for use inside Virtuozzo. It works in OpenVZ too!&lt;br /&gt;
&lt;br /&gt;
IBM provides a free download of DB2 Express-C which is what I&lt;br /&gt;
installed.&lt;br /&gt;
&lt;br /&gt;
Here is a rough guide to installing DB2 into a freshly-created VE.&lt;br /&gt;
&lt;br /&gt;
== Create a new VE ==&lt;br /&gt;
&lt;br /&gt;
I created a new VE for the Debian distribution using debootstrap.&lt;br /&gt;
&lt;br /&gt;
== Set VE resource limits appropriately ==&lt;br /&gt;
&lt;br /&gt;
DB2 installation can fail and it will not be possible to operate the database if your resource limits are too low. I used these limits for a small database:&lt;br /&gt;
&lt;br /&gt;
* kmemsize to 10,000,000&lt;br /&gt;
* privvmpages to 300,000&lt;br /&gt;
* shmpages to 80,000&lt;br /&gt;
* numproc to 150&lt;br /&gt;
* tcpsndbuf to 700,000&lt;br /&gt;
* tcprcvbuf to 700,000&lt;br /&gt;
* diskspace to 6,000,000&lt;br /&gt;
&lt;br /&gt;
== Install additional packages ==&lt;br /&gt;
&lt;br /&gt;
* libstdc++5 (required for installation)&lt;br /&gt;
* pdksh (required for operation?)&lt;br /&gt;
* ssh   (may be required for operation)&lt;br /&gt;
* xbase-clients (for xauth)&lt;br /&gt;
* firefox (for post-installation)&lt;br /&gt;
* strace and telnet (for debugging)&lt;br /&gt;
* libdbi-perl gcc libc6-dev make (for building CPAN DBD::DB2 package)&lt;br /&gt;
&lt;br /&gt;
== Download the DB2 Express-C package ==&lt;br /&gt;
&lt;br /&gt;
DB2 Express-C version 9 is available from this page:&lt;br /&gt;
[[http://www-306.ibm.com/software/data/db2/express/download.html]]&lt;br /&gt;
&lt;br /&gt;
You will need to register with IBM before you can download.&lt;br /&gt;
&lt;br /&gt;
* Untar the received file as root&lt;br /&gt;
* Run exp/disk1/db2setup&lt;br /&gt;
* Follow the prompts:&lt;br /&gt;
   * Setup user 'dasusr1'&lt;br /&gt;
   * Setup user 'db2inst1' and database instance 'db2inst1'&lt;br /&gt;
&lt;br /&gt;
== Post-install actions ==&lt;br /&gt;
&lt;br /&gt;
This is where it gets yukky. DB2 wants to run a browser inside the VPS. It wants to run Java applets inside the browser. I installed Iceweasel, but the post-install script does not recognise it. I was eventually able to hack the script to recognise and use the browser but it crashed on one of the Java applets. I think you can get by without running the post-install.&lt;br /&gt;
&lt;br /&gt;
Here's what to do instead:&lt;br /&gt;
&lt;br /&gt;
First, su to the instance owner:&lt;br /&gt;
&lt;br /&gt;
* su - db2inst1&lt;br /&gt;
&lt;br /&gt;
Try starting and stopping the database:&lt;br /&gt;
&lt;br /&gt;
* db2start&lt;br /&gt;
* db2stop&lt;br /&gt;
&lt;br /&gt;
If these don't work it means your environment variables are not set properly. IBM set these for me:&lt;br /&gt;
&lt;br /&gt;
* CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:.&lt;br /&gt;
* DB2INSTANCE=db2inst1&lt;br /&gt;
* PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc&lt;br /&gt;
&lt;br /&gt;
Try creating IBM's sample database:&lt;br /&gt;
&lt;br /&gt;
* db2sampl&lt;br /&gt;
&lt;br /&gt;
== Setup a development environment ==&lt;br /&gt;
&lt;br /&gt;
I develop in perl so I was most interested in access to the database though the DBI library. I did this:&lt;br /&gt;
&lt;br /&gt;
* Use CPAN to download and install DBD::DB2&lt;br /&gt;
&lt;br /&gt;
If you don't use CPAN you can also do this (as root):&lt;br /&gt;
&lt;br /&gt;
* Download http://search.cpan.org/CPAN/authors/id/I/IB/IBMTORDB2/DBD-DB2-1.1.tar.gz&lt;br /&gt;
* Untar the file and change into the directory&lt;br /&gt;
* perl Makefile.PL PREFIX=/usr&lt;br /&gt;
* make&lt;br /&gt;
* make test&lt;br /&gt;
* make install&lt;br /&gt;
&lt;br /&gt;
== Setup DB2 for autostart ==&lt;br /&gt;
&lt;br /&gt;
It seems that DB2 can be auto-started at VE boot time, but not auto-stopped. I used this script:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # Script to start DB2 instances on bootup.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 set -e&lt;br /&gt;
 &lt;br /&gt;
 . /lib/lsb/init-functions&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         echo Starting DB2&lt;br /&gt;
         /opt/ibm/db2/V9.1/instance/db2istrt&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         ;;&lt;br /&gt;
 restart|reload)&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
&lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
And I used this command to create the symlink to make it start at VE &amp;quot;boot&amp;quot; time:&lt;br /&gt;
&lt;br /&gt;
* update-rc.d db2 start 95 2 .&lt;br /&gt;
&lt;br /&gt;
== Testing your installation ==&lt;br /&gt;
&lt;br /&gt;
From the db2inst1 user, do:&lt;br /&gt;
&lt;br /&gt;
* db2&lt;br /&gt;
&lt;br /&gt;
Inside the db2 client, try:&lt;br /&gt;
&lt;br /&gt;
* connect to sample&lt;br /&gt;
* grant all privileges to user fred (?not sure?)&lt;br /&gt;
* connect reset&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC_secondary_parameters&amp;diff=3305</id>
		<title>UBC secondary parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC_secondary_parameters&amp;diff=3305"/>
		<updated>2007-07-11T12:30:10Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: /* kmemsize */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UBC toc}}&lt;br /&gt;
&lt;br /&gt;
'''Secondary (dependant) UBC parameters''' are directly connected&lt;br /&gt;
to the [[UBC primary parameters|primary ones]] and can't be configured arbitrarily.&lt;br /&gt;
&lt;br /&gt;
== kmemsize ==&lt;br /&gt;
Size of unswappable memory in bytes, allocated by the operating system kernel.&lt;br /&gt;
&lt;br /&gt;
It includes all the kernel internal data structures associated with the&lt;br /&gt;
Virtual Environment's processes, except the network buffers discussed below.&lt;br /&gt;
These data structures reside in the first gigabyte of the computer's RAM,&lt;br /&gt;
so called [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
This parameter is related to the number of processes ([[numproc]]).&lt;br /&gt;
Each process consumes certain amount of kernel memory —&lt;br /&gt;
24 kilobytes at minimum, 30–60 KB typically.&lt;br /&gt;
Very large processes may consume much more than that.&lt;br /&gt;
&lt;br /&gt;
It is important to have a certain safety gap between the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; and&lt;br /&gt;
the &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt; of the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
(for example, 10%, as in [[UBC configuration examples]]).  Equal &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt; of&lt;br /&gt;
the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; parameter may lead to the situation where the kernel will&lt;br /&gt;
need to kill Virtual Environment's applications to keep the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt;&lt;br /&gt;
usage under the limit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Kmemsize&amp;lt;/code&amp;gt; limits can't be set arbitrarily high.&lt;br /&gt;
The total amount of &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; consumable by all Virtual Environments&lt;br /&gt;
in the system plus the socket buffer space (see below) is limited by the&lt;br /&gt;
hardware resources of the system.&lt;br /&gt;
This total limit is discussed in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
== tcpsndbuf ==&lt;br /&gt;
The total size of buffers used to send data over TCP network connections.&lt;br /&gt;
These socket buffers reside in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tcpsndbuf&amp;lt;/code&amp;gt; parameter depends on number of TCP&lt;br /&gt;
sockets ([[numtcpsock]]) and should allow for some minimal amount of&lt;br /&gt;
socket buffer memory for each socket, as discussed in [[UBC consistency check]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;tcpsndbuf_{lim} - tcpsndbuf_{bar} \ge 2.5KB \cdot numtcpsock \rm.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this restriction is not satisfied, some network connections&lt;br /&gt;
may silently stall, being unable to transmit data.&lt;br /&gt;
&lt;br /&gt;
Setting high values for &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
may, but doesn't necessarily, increase performance of network communications.&lt;br /&gt;
Note that, unlike most other parameters, hitting &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt;&lt;br /&gt;
limits and failed socket buffer allocations&lt;br /&gt;
do not have strong negative effect on the applications, but just reduce&lt;br /&gt;
performance of network communications.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tcpsndbuf&amp;lt;/code&amp;gt; limits can't be set arbitrarily high.&lt;br /&gt;
The total amount of &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt; consumable by all Virtual Environments&lt;br /&gt;
in the system plus the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; and other socket buffers is limited&lt;br /&gt;
by the hardware resources of the system.&lt;br /&gt;
This total limit is discussed in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
== tcprcvbuf ==&lt;br /&gt;
The total size of buffers used to temporary store the data coming from TCP network connections.&lt;br /&gt;
These socket buffers also reside in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tcprcvbuf&amp;lt;/code&amp;gt; parameter depends on number of TCP&lt;br /&gt;
sockets ([[numtcpsock]]) and should allow for some minimal amount of&lt;br /&gt;
socket buffer memory for each socket, as discussed in [[UBC consistency check]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;tcprcvbuf_{lim} - tcprcvbuf_{bar} \ge 2.5KB \cdot numtcpsock \rm.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this restriction is not satisfied, some network connections&lt;br /&gt;
may stall, being unable to receive data, and will be terminated&lt;br /&gt;
after a couple of minutes.&lt;br /&gt;
&lt;br /&gt;
Similarly to &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt;, setting high values for &amp;lt;code&amp;gt;tcprcvbuf&amp;lt;/code&amp;gt;&lt;br /&gt;
parameter may, but doesn't necessarily, increase performance of network&lt;br /&gt;
communications.&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;tcprcvbuf&amp;lt;/code&amp;gt; limits and failed socket buffer allocations&lt;br /&gt;
do not have strong negative effect on the applications, but just reduce&lt;br /&gt;
performance of network communications.&lt;br /&gt;
However, staying above the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;tcprcvbuf&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
for a long time is less harmless than for &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt;.&lt;br /&gt;
Long periods of exceeding the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; may cause termination&lt;br /&gt;
of some connections.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tcprcvbuf&amp;lt;/code&amp;gt; limits can't be set arbitrarily high.&lt;br /&gt;
The total amount of &amp;lt;code&amp;gt;tcprcvbuf&amp;lt;/code&amp;gt; consumable by all Virtual Environments&lt;br /&gt;
in the system plus the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; and other socket buffers is limited&lt;br /&gt;
by the hardware resources of the system.&lt;br /&gt;
This total limit is discussed in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
== othersockbuf ==&lt;br /&gt;
The total size of buffers used by local (UNIX-domain) connections between&lt;br /&gt;
processes inside the system (such as connections to a local database server)&lt;br /&gt;
and send buffers of UDP and other datagram protocols.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Othersockbuf&amp;lt;/code&amp;gt; parameter depends on number of non-TCP sockets (&amp;lt;code&amp;gt;[[numothersock]]&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Othersockbuf&amp;lt;/code&amp;gt; configuration should satisfy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;othersockbuf_{lim} - othersockbuf_{bar} \ge 2.5KB \cdot numothersock.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increased limit for &amp;lt;code&amp;gt;othersockbuf&amp;lt;/code&amp;gt; is necessary for high performance of&lt;br /&gt;
communications through local (UNIX-domain) sockets.&lt;br /&gt;
However, similarly to &amp;lt;code&amp;gt;tcpsndbuf&amp;lt;/code&amp;gt;, hitting &amp;lt;code&amp;gt;othersockbuf&amp;lt;/code&amp;gt; affects&lt;br /&gt;
the communication performance only and does not affect the functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Othersockbuf&amp;lt;/code&amp;gt; limits can't be set arbitrarily high.&lt;br /&gt;
The total amount of &amp;lt;code&amp;gt;othersockbuf&amp;lt;/code&amp;gt; consumable by all Virtual Environments&lt;br /&gt;
in the system plus the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; and other socket buffers&lt;br /&gt;
is limited by the hardware resources of the system.&lt;br /&gt;
This total limit is discussed in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
== dgramrcvbuf ==&lt;br /&gt;
The total size of buffers used to temporary store the incoming packets of UDP and&lt;br /&gt;
other datagram protocols.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Dgramrcvbuf&amp;lt;/code&amp;gt; parameters depend on number of&lt;br /&gt;
non-TCP sockets (&amp;lt;code&amp;gt;[[numothersock]]&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Dgramrcvbuf&amp;lt;/code&amp;gt; limits usually don't need to be high.&lt;br /&gt;
Only if the Virtual Environments needs to send and receive very large&lt;br /&gt;
datagrams, the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt;s for both &amp;lt;code&amp;gt;othersockbuf&amp;lt;/code&amp;gt; and&lt;br /&gt;
&amp;lt;code&amp;gt;dgramrcvbuf&amp;lt;/code&amp;gt; parameters should be raised.&lt;br /&gt;
&lt;br /&gt;
Hitting &amp;lt;code&amp;gt;dgramrcvbuf&amp;lt;/code&amp;gt; means that some datagrams are dropped, which may&lt;br /&gt;
or may not be important for application functionality.&lt;br /&gt;
UDP is a protocol with not guaranteed delivery, so even if the buffers&lt;br /&gt;
permit, the datagrams may be as well dropped later on any stage of the&lt;br /&gt;
processing, and applications should be prepared for it.&lt;br /&gt;
&lt;br /&gt;
Unlike other socket buffer parameters, for &amp;lt;code&amp;gt;dgramrcvbuf&amp;lt;/code&amp;gt;&lt;br /&gt;
the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; should be set to the &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Dgramrcvbuf&amp;lt;/code&amp;gt; limits can't be set arbitrarily high.&lt;br /&gt;
The total amount of &amp;lt;code&amp;gt;dgramrcvbuf&amp;lt;/code&amp;gt; consumable by all Virtual Environments&lt;br /&gt;
in the system plus the &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt; and other socket buffers&lt;br /&gt;
is limited by the hardware resources of the system.&lt;br /&gt;
This total limit is discussed in [[UBC systemwide configuration#“Low memory”|“low memory”]].&lt;br /&gt;
&lt;br /&gt;
== oomguarpages ==&lt;br /&gt;
The guaranteed amount of memory for the case the memory is “over-booked”&lt;br /&gt;
(out-of-memory kill guarantee).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Oomguarpages&amp;lt;/code&amp;gt; parameter is related to &amp;lt;code&amp;gt;[[vmguarpages]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
If applications start to consume more memory than the computer has,&lt;br /&gt;
the system faces an out-of-memory condition.&lt;br /&gt;
In this case the operating system will start to kill Virtual Environment's&lt;br /&gt;
processes to free some memory and prevent the total death&lt;br /&gt;
of the system.  Although it happens very rarely in typical system loads,&lt;br /&gt;
killing processes in out-of-memory situations is a normal reaction of the&lt;br /&gt;
system, and it is built into every Linux kernel&amp;lt;ref&amp;gt;The possible reasons of out-of-memory situations are the excess of total &amp;lt;code&amp;gt;[[vmguarpages]]&amp;lt;/code&amp;gt; guarantees the available physical resources or high memory consumption by system processes.  Also, the kernel might allow some Virtual Environments to allocate memory above their &amp;lt;code&amp;gt;[[vmguarpages]]&amp;lt;/code&amp;gt; guarantees when the system had a lot of free memory, and later, when other Virtual Environments claim their guarantees, the system will experience the memory shortage.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[Oomguarpages]]&amp;lt;/code&amp;gt; parameter accounts the total amount of&lt;br /&gt;
memory and swap space used by the processes of a particular&lt;br /&gt;
Virtual Environment.&lt;br /&gt;
The &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; of the &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; parameter is the out-of-memory&lt;br /&gt;
guarantee.&lt;br /&gt;
&lt;br /&gt;
If the current usage of memory and swap space&lt;br /&gt;
(the value of &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt;) plus the amount of used kernel memory&lt;br /&gt;
(&amp;lt;code&amp;gt;[[kmemsize]]&amp;lt;/code&amp;gt;) and socket buffers is below the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt;,&lt;br /&gt;
processes in this Virtual Environment are guaranteed not to be killed in&lt;br /&gt;
out-of-memory situations.&lt;br /&gt;
If the system is in out-of-memory situation and there are several&lt;br /&gt;
Virtual Environments with &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; excess, applications in the&lt;br /&gt;
Virtual Environment with the biggest excess will be killed first.&lt;br /&gt;
The &amp;lt;code&amp;gt;failcnt&amp;lt;/code&amp;gt; counter of &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
increases when a process in this Virtual Environment is killed because&lt;br /&gt;
of out-of-memory situation.&lt;br /&gt;
&lt;br /&gt;
If the administrator needs to make sure that some application won't be&lt;br /&gt;
forcedly killed regardless of the application's behavior,&lt;br /&gt;
setting the &amp;lt;code&amp;gt;[[privvmpages]]&amp;lt;/code&amp;gt; limit to a value not greater than the&lt;br /&gt;
&amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; guarantee significantly reduce the likelihood of&lt;br /&gt;
the application being killed,&lt;br /&gt;
and setting it to a half of the &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; guarantee completely&lt;br /&gt;
prevents it.&lt;br /&gt;
Such configurations are not popular because they significantly reduce&lt;br /&gt;
the utilization of the hardware.&lt;br /&gt;
&lt;br /&gt;
The meaning of the &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;limit for the &amp;lt;code&amp;gt;oomguarpages&amp;lt;/code&amp;gt; parameter is&lt;br /&gt;
unspecified in the current version.&lt;br /&gt;
&lt;br /&gt;
The total out-of-memory guarantees given to the Virtual Environments should&lt;br /&gt;
not exceed the physical capacity of the computer, as discussed in [[UBC systemwide configuration#Memory and swap space]].&lt;br /&gt;
If guarantees are given for more than the system has, in out-of-memory&lt;br /&gt;
situations applications in Virtual Environments with guaranteed level of&lt;br /&gt;
service and system daemons may be killed.&lt;br /&gt;
&lt;br /&gt;
== privvmpages ==&lt;br /&gt;
Memory allocation limit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Privvmpages&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
allows controlling the amount of memory allocated by applications.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; parameter&lt;br /&gt;
control the upper boundary of the total size of allocated memory.&lt;br /&gt;
Note that this upper boundary doesn't guarantee that the Virtual Environment&lt;br /&gt;
will be able to allocate that much memory, neither does it guarantee that&lt;br /&gt;
other Virtual Environments will be able to allocate their fair share of&lt;br /&gt;
memory.&lt;br /&gt;
The primary mechanism to control memory allocation is the &amp;lt;code&amp;gt;[[vmguarpages]]&amp;lt;/code&amp;gt;&lt;br /&gt;
guarantee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Privvmpages&amp;lt;/code&amp;gt; parameter accounts allocated (but, possibly,&lt;br /&gt;
not used yet) memory.&lt;br /&gt;
The accounted value is an estimation how much memory will be really consumed&lt;br /&gt;
when the Virtual Environment's applications start to use the allocated&lt;br /&gt;
memory.&lt;br /&gt;
Consumed memory is accounted into &amp;lt;code&amp;gt;[[oomguarpages]]&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
Since the memory accounted into &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; may not be actually used,&lt;br /&gt;
the sum of current &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; values for all Virtual Environments&lt;br /&gt;
may exceed the RAM and swap size of the computer.&lt;br /&gt;
&lt;br /&gt;
There should be a safety gap between the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt;&lt;br /&gt;
for &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; parameter to reduce the number of memory allocation&lt;br /&gt;
failures that the application is unable to handle.&lt;br /&gt;
This gap will be used for “high-priority” memory allocations, such&lt;br /&gt;
as process stack expansion.&lt;br /&gt;
Normal priority allocations will fail when the &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; if&lt;br /&gt;
&amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; is reached.&lt;br /&gt;
&lt;br /&gt;
Total &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; should correlate with the physical resources of the&lt;br /&gt;
computer.&lt;br /&gt;
Also, it is important not to allow any Virtual Environment to allocate a&lt;br /&gt;
significant portion of all system RAM to avoid serious service level&lt;br /&gt;
degradation for other VEs.&lt;br /&gt;
Both these configuration requirements are discussed in [[UBC systemwide configuration#Allocated memory]].&lt;br /&gt;
&lt;br /&gt;
There's also an article describing how [[user pages accounting]] works.&lt;br /&gt;
&lt;br /&gt;
== Units ==&lt;br /&gt;
&amp;lt;code&amp;gt;Oomguarpages&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt;&lt;br /&gt;
values are measured in [[memory page]]s.&lt;br /&gt;
For other secondary parameters, the values are in bytes.&lt;br /&gt;
&lt;br /&gt;
== System-wide limits ==&lt;br /&gt;
All secondary parameters are related to memory.&lt;br /&gt;
Total limits on memory-related parameters must not exceed the physical&lt;br /&gt;
resources of the computer.&lt;br /&gt;
The restrictions on the configuration of memory-related parameters are listed&lt;br /&gt;
in [[UBC systemwide configuration]].&lt;br /&gt;
Those restrictions are very important, because their violation may&lt;br /&gt;
allow any Virtual Environment cause the whole system to hang.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3300</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=3300"/>
		<updated>2007-07-10T07:52:24Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: misc grammar updates&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 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 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>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3299</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=3299"/>
		<updated>2007-07-10T07:49:06Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: cleanup&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.&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 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>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3298</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=3298"/>
		<updated>2007-07-10T07:45:21Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: /* install the toolset */&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;
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 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>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Kernel_configuration&amp;diff=3297</id>
		<title>Kernel configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Kernel_configuration&amp;diff=3297"/>
		<updated>2007-07-10T07:41:23Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: more grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article summarises various kernel configuration issues.&lt;br /&gt;
&lt;br /&gt;
== OpenVZ related kernel config options ==&lt;br /&gt;
&lt;br /&gt;
Please make sure the following config options are enabled&lt;br /&gt;
in your kernel .config file before compilation process:&lt;br /&gt;
 CONFIG_SCHED_VCPU=y&lt;br /&gt;
 CONFIG_FAIRSCHED=y&lt;br /&gt;
&lt;br /&gt;
 CONFIG_SIM_FS=m&lt;br /&gt;
 CONFIG_VZ_QUOTA=m&lt;br /&gt;
 # CONFIG_VZ_QUOTA_UNLOAD is not set&lt;br /&gt;
 CONFIG_VZ_QUOTA_UGID=y&lt;br /&gt;
&lt;br /&gt;
 CONFIG_VE=y&lt;br /&gt;
 CONFIG_VE_CALLS=m&lt;br /&gt;
 CONFIG_VZ_GENCALLS=y&lt;br /&gt;
 CONFIG_VE_NETDEV=m&lt;br /&gt;
 CONFIG_VE_ETHDEV=m&lt;br /&gt;
 CONFIG_VZ_DEV=m&lt;br /&gt;
 CONFIG_VE_IPTABLES=y&lt;br /&gt;
 CONFIG_VZ_WDOG=m&lt;br /&gt;
&lt;br /&gt;
 CONFIG_VZ_CHECKPOINT=m&lt;br /&gt;
&lt;br /&gt;
{{Note|On architectures that do not currently support checkpointing (i.e. ppc and sparc) &amp;lt;code&amp;gt;CONFIG_VZ_CHECKPOINT&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== ACPI sleep ==&lt;br /&gt;
&lt;br /&gt;
It is a bit tricky to make ACPI sleep and OpenVZ work together.&lt;br /&gt;
&lt;br /&gt;
ACPI sleep is enabled by &amp;lt;code&amp;gt;ACPI_SLEEP&amp;lt;/code&amp;gt; kernel option. The following dependencies are declared in kernel configs:&lt;br /&gt;
&lt;br /&gt;
 ACPI_SLEEP depends on X86 &amp;amp;&amp;amp; (!SMP || SUSPEND_SMP)&lt;br /&gt;
 SUSPEND_SMP depends on HOTPLUG_CPU &amp;amp;&amp;amp; X86 &amp;amp;&amp;amp; PM&lt;br /&gt;
 FAIRSCHED depends on SCHED_VCPU&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;code&amp;gt;SCHED_VCPU&amp;lt;/code&amp;gt; is incompatible with &amp;lt;code&amp;gt;HOTPLUG_CPU&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ./kernel/cpu.c:#error &amp;quot;CONFIG_HOTPLUG_CPU isn't supported with CONFIG_SCHED_VCPU&amp;quot;&lt;br /&gt;
&lt;br /&gt;
On a non-SMP machine, you may disable &amp;lt;code&amp;gt;SMP&amp;lt;/code&amp;gt;, this will resolve the conflict.&lt;br /&gt;
&lt;br /&gt;
If you have an SMP machine, you can only disable &amp;lt;code&amp;gt;FAIRSCHED&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SCHED_VCPU&amp;lt;/code&amp;gt;. It will reduce some isolation between VEs (CPU scheduling will be performed per-task, not per-VE, and &amp;lt;code&amp;gt;cpuunits&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cpulimit&amp;lt;/code&amp;gt; settings will not take effect), but it is an acceptable solution if your VEs are trusted (and it's hard to imagine untrusted VEs on a notebook.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel]]&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Kernel_configuration&amp;diff=3296</id>
		<title>Kernel configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Kernel_configuration&amp;diff=3296"/>
		<updated>2007-07-10T07:37:04Z</updated>

		<summary type="html">&lt;p&gt;Elronxenu: spelling, grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article summarises various kernel configuration issues.&lt;br /&gt;
&lt;br /&gt;
== OpenVZ related kernel config options ==&lt;br /&gt;
&lt;br /&gt;
Please make sure the following config options are enabled&lt;br /&gt;
in your kernel .config file before compilation process:&lt;br /&gt;
 CONFIG_SCHED_VCPU=y&lt;br /&gt;
 CONFIG_FAIRSCHED=y&lt;br /&gt;
&lt;br /&gt;
 CONFIG_SIM_FS=m&lt;br /&gt;
 CONFIG_VZ_QUOTA=m&lt;br /&gt;
 # CONFIG_VZ_QUOTA_UNLOAD is not set&lt;br /&gt;
 CONFIG_VZ_QUOTA_UGID=y&lt;br /&gt;
&lt;br /&gt;
 CONFIG_VE=y&lt;br /&gt;
 CONFIG_VE_CALLS=m&lt;br /&gt;
 CONFIG_VZ_GENCALLS=y&lt;br /&gt;
 CONFIG_VE_NETDEV=m&lt;br /&gt;
 CONFIG_VE_ETHDEV=m&lt;br /&gt;
 CONFIG_VZ_DEV=m&lt;br /&gt;
 CONFIG_VE_IPTABLES=y&lt;br /&gt;
 CONFIG_VZ_WDOG=m&lt;br /&gt;
&lt;br /&gt;
 CONFIG_VZ_CHECKPOINT=m&lt;br /&gt;
&lt;br /&gt;
{{Note|On architectures that do not currently support checkpointing (i.e. ppc and sparc) &amp;lt;code&amp;gt;CONFIG_VZ_CHECKPOINT&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== ACPI sleep ==&lt;br /&gt;
&lt;br /&gt;
It is a bit tricky to make ACPI sleep and OpenVZ work together.&lt;br /&gt;
&lt;br /&gt;
ACPI sleep is enabled by &amp;lt;code&amp;gt;ACPI_SLEEP&amp;lt;/code&amp;gt; kernel option. The following dependencies are declared in kernel configs:&lt;br /&gt;
&lt;br /&gt;
 ACPI_SLEEP depends on X86 &amp;amp;&amp;amp; (!SMP || SUSPEND_SMP)&lt;br /&gt;
 SUSPEND_SMP depends on HOTPLUG_CPU &amp;amp;&amp;amp; X86 &amp;amp;&amp;amp; PM&lt;br /&gt;
 FAIRSCHED depends on SCHED_VCPU&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;code&amp;gt;SCHED_VCPU&amp;lt;/code&amp;gt; is incompatible with &amp;lt;code&amp;gt;HOTPLUG_CPU&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ./kernel/cpu.c:#error &amp;quot;CONFIG_HOTPLUG_CPU isn't supported with CONFIG_SCHED_VCPU&amp;quot;&lt;br /&gt;
&lt;br /&gt;
On non-SMP machine, you may disable &amp;lt;code&amp;gt;SMP&amp;lt;/code&amp;gt;, this will resolve the conflict.&lt;br /&gt;
&lt;br /&gt;
If you have SMP machine, you can only disable &amp;lt;code&amp;gt;FAIRSCHED&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SCHED_VCPU&amp;lt;/code&amp;gt;. It will reduce some isolation between VEs (CPU scheduling will be performed per-task, not per-VE, and &amp;lt;code&amp;gt;cpuunits&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cpulimit&amp;lt;/code&amp;gt; settings will not take effect), but it is an acceptable solution if your VEs are trusted (and it's hard to imagine untrusted VEs on a notebook.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel]]&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Elronxenu</name></author>
		
	</entry>
</feed>