<?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=Geejay</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=Geejay"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Geejay"/>
	<updated>2026-06-10T02:58:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=18627</id>
		<title>Control panels</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=18627"/>
		<updated>2016-01-01T15:03:09Z</updated>

		<summary type="html">&lt;p&gt;Geejay: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
This page contains links to different control panels for OpenVZ, written by third parties. If you know the project that's missing here, please add it.&lt;br /&gt;
&lt;br /&gt;
== Featured and recommended == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://owp.softunity.com.ru/ OVZ Web Panel] === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|| &lt;br /&gt;
* Written in Ruby - [https://github.com/sibprogrammer/owp github page], [http://code.google.com/p/ovz-web-panel/ old site]&lt;br /&gt;
* Automatic installer&lt;br /&gt;
* Backup/restore/clone CT&lt;br /&gt;
* Pretty interface with charts&lt;br /&gt;
* Multi-user/roles/server/lingual support, user requests, event logging&lt;br /&gt;
* Remote API&lt;br /&gt;
* IP management&lt;br /&gt;
* Version 2.4 released on 2013-04-04. Last github update 2015-06-26.&lt;br /&gt;
||&lt;br /&gt;
[[File:Ovz-web-panel.png|200px|left|link=http://owp.softunity.com.ru/]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Free software / Open source (in alphabetical order) == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* FOSVM (Free Open Source Virtual Machine manager): [http://fosvm.sourceforge.net/ homepage] |  Uses php and bash scripts, monitors bandwidth, Version 0.03a. Last updated 2009-05-18.&lt;br /&gt;
* HyperVM: [http://lxcenter.org/software/hypervm/ homepage] AGPL V3&lt;br /&gt;
* MiniCloud: [https://github.com/ryandoyle/minicloud homepage] | A set of client/server programs that provides similar functionality to the EC2 CLI tools for OpenVZ.&lt;br /&gt;
* OpenNode: [http://opennodecloud.com/ homepage (English)] - Bare-metal ISO installer (CentOS based) providing openvz, kvm, libvirt and func out-of-box together with OpenNode Management Server appliance - containing also ajax Web Management Console with secure HTML5 vnc and ssh vm consoles.&lt;br /&gt;
* OpenVZ Web Panel [http://code.google.com/p/ovz-web-panel/ homepage] - Version 2.1. Written on Ruby. Automatic installer, backup/restore/clone, pretty interface with charts, multi-user/roles/server/lingual support, user requests, event logging and all NEW: remote API, IP management and VZ migrations. Version 2.1 released on 2012-05-02. Very active development. &lt;br /&gt;
* Proxmox Virtual Environment: [http://pve.proxmox.com Proxmox VE Wiki] - including bare-metal ISO installer. Requires 64bit Processor.&lt;br /&gt;
* unxsVZ OpenVZ Multiple datacenter infrastructure manager for CentOS: [http://openisp.net/openisp/unxsVZ unxsVZ Trac Wiki] | Includes autonomic UBC adjusting, traffic and stats graphs. Supports hot-cold container clones, remote datacenter backups, IP and other resource management, container set group commands, NAT, and many advanced features. Very active development. Allows one or two staff to manage more than 1k containers on dozens of nodes across multiple datacenters. Installs via yum. GPLv2 licensed.&lt;br /&gt;
* VirtuoCP (formerly Vtonf): [http://sourceforge.net/projects/vtonf/ homepage] | According to the documentation only runs on CentOS 4.5 or higher. Last update 2010-10-17.&lt;br /&gt;
&lt;br /&gt;
== Proprietary / non-free == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* Aventurin{e}: [http://www.aventurin.net/ homepage (English)]&lt;br /&gt;
* NGASI: [http://www.ngasi.com/cloud/cp/index.zul homepage] is the Out-of-the-Box Platform-as-a-Service (PaaS) Solution. Quickly and easily create a cloud based P-a-a-S with 2 or more Virtuzzo/OpenVZ servers.&lt;br /&gt;
* oVZManager [http://www.ovzmanager.de homepage (Webinterface German and English)] Terminal and Rescue, IPv6 - Admin, Reseller, Customer - Windows Support over KVM &lt;br /&gt;
* Plesk [http://www.odin.com/products/plesk/ homepage], a control panel from Odin.&lt;br /&gt;
* SolusVM [http://www.solusvm.com homepage]. Also supports KVM, Xen PV &amp;amp; HVM. Includes support for VSwap&lt;br /&gt;
* TekBASE: [http://teklab.de/ homepage (German)] Admin, Customer panel for openvz, game, stream and voice servers&lt;br /&gt;
* VMmanager: [http://ispsystem.com/en/software/vmmanager/ homepage (English)], a control panel for virtual machines management. &lt;br /&gt;
* Virtualizor [http://www.virtualizor.com homepage] by Softaculous. Also supports Xen PV &amp;amp; HVM, Linux KVM. Powers over 10000 VMs.&lt;br /&gt;
* HostGuard [http://www.hostguard.net/ homepage]. Also supports KVM. Xen support due in February 2014.&lt;br /&gt;
&lt;br /&gt;
== Frozen projects == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* EasyVZ: [http://sourceforge.net/projects/easyvz sf.net project page] (little bit outdated, but working and free.  Last update Apr 2013) (requires Unix/Linux)&lt;br /&gt;
* vpsAdmin [http://www.vpsadmin.org homepage (french)] - GPLv3 license, PHP+MySQL+Bash, Multi-server &amp;amp; Multilingual support, vpsAdmin 1.0 released on January 19, 2010&lt;br /&gt;
* WebVZ: [http://webvz.sourceforge.net/ homepage] Version 2.0 released September 7, 2008 (Moved to [https://github.com/shuaibzahda/webvz/commits/master GitHub], last commit 2009-03-20). Requires Ruby on Rails.&lt;br /&gt;
* Webmin: [http://www.webmin.com/ homepage] | [http://www.webmin.com/cgi-bin/search_third.cgi?search=OpenVZ OpenVZ plugin] | Version 1.0, last updated 2006-02-07&lt;br /&gt;
&lt;br /&gt;
== Closed projects == &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
* BoxCtrl-VZ [http://www.boxctrl.com homepage] - Free and open source. Uses PHP, XML, and bash scripts. Lightweight. Released on Feb. 18th, 2012. Website does not exist&lt;br /&gt;
* Mwamko: [http://mwamko.org/ homepage] Last activity May 2007 - Website does not exist&lt;br /&gt;
* Panenthe: [http://www.panenthe.com/ homepage (English)] • [http://www.panenthe.com/products/panenthe-media/cat_id=4/ Screen shots] &amp;lt;- does not exist anymore since 2010&lt;br /&gt;
* RoboVZ: [http://sharesource.org/project/robovz homepage] {{forum|2559}} Lots of promises since announced in May 2007, nothing usable yet.  Possibly GPL license.  No activity in 2 years, calling it frozen.&lt;br /&gt;
* VZ-Manager: [http://vzmanager.de/ homepage (German)] website shows apache default page (11. 02. 2010)&lt;br /&gt;
* VZMaster [http://www.vzmaster.com homepage], [http://www.vzmaster.com/downloads/usermanual_vzmaster_1.0.0.pdf User Manual] -- We also provide complete OpenVZ Distro based on Ubuntu Server distribution. - Website is offline&lt;br /&gt;
* SLKVM [http://solukom.com/software/slkvm homepage]: console scripts to handle vz virtualization in a two node cluster. Website is down.&lt;br /&gt;
* FluidVM: [http://www.fluidvm.com Home Page]: website is not available&lt;br /&gt;
* Sysvm: [http://sysvm.com Home Page], The Enterprise hybrid vps control panel with ipv6 and load balancing, formally known as vcPanel. [http://sysvm.com/Demo Demo] , website is not available&lt;br /&gt;
* vePortal: [http://www.veportal.com/ homepage (English)] - Widely used OpenVZ Management Panel. Seems to be closed: &amp;quot;The vePortal project is currently not accepting new orders&amp;quot;&lt;br /&gt;
* VirtPanel [http://www.virtpanel.com homepage], Support for Xen and VMware in the future. Website does not exist.&lt;br /&gt;
&lt;br /&gt;
== In development == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
* easyVZ! [http://www.easyVZ.org/ homepage] &lt;br /&gt;
* DTC-Xen [http://www.gplhost.com/software-dtc-xen.html homepage] - Currently being ported to OpenVZ by its main developers.&lt;br /&gt;
* VZControl [https://github.com/mrkmg/vzcontrol github] - CLI interface to administer multiple OpenVZ Hosts. Written in PHP5. Last update in Nov 2013&lt;br /&gt;
&lt;br /&gt;
== 3rd party wrappers == &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Beside control panels that are designed to work with OpenVZ, a lot of great tools have been released that allow you to centralized manage your servers in general. If you are in knowledge of a popular programming language like Ruby, Python or Perl it's easy to create your own OpenVZ modules for them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
'''Perl'''&lt;br /&gt;
* (R)?ex [http://rexify.org/] - With (R)?ex you can manage all your boxes from a central point through the complete process of configuration management and software deployment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
'''Python'''&lt;br /&gt;
* Fabric [http://docs.fabfile.org/en/latest/] - Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
'''Ruby'''&lt;br /&gt;
* Capistrano [https://github.com/capistrano/capistrano] - Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you have a working modul for one of them or can suggest more such tools, feel free to add them!&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=18626</id>
		<title>Control panels</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=18626"/>
		<updated>2016-01-01T15:02:23Z</updated>

		<summary type="html">&lt;p&gt;Geejay: added last date of software update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
This page contains links to different control panels for OpenVZ, written by third parties. If you know the project that's missing here, please add it.&lt;br /&gt;
&lt;br /&gt;
== Featured and recommended == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://owp.softunity.com.ru/ OVZ Web Panel] === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|| &lt;br /&gt;
* Written in Ruby - [https://github.com/sibprogrammer/owp github page], [http://code.google.com/p/ovz-web-panel/ old site]&lt;br /&gt;
* Automatic installer&lt;br /&gt;
* Backup/restore/clone CT&lt;br /&gt;
* Pretty interface with charts&lt;br /&gt;
* Multi-user/roles/server/lingual support, user requests, event logging&lt;br /&gt;
* Remote API&lt;br /&gt;
* IP management&lt;br /&gt;
* Version 2.4 released on 2013-04-04. Last git software update 2015-06-26.&lt;br /&gt;
||&lt;br /&gt;
[[File:Ovz-web-panel.png|200px|left|link=http://owp.softunity.com.ru/]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Free software / Open source (in alphabetical order) == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* FOSVM (Free Open Source Virtual Machine manager): [http://fosvm.sourceforge.net/ homepage] |  Uses php and bash scripts, monitors bandwidth, Version 0.03a. Last updated 2009-05-18.&lt;br /&gt;
* HyperVM: [http://lxcenter.org/software/hypervm/ homepage] AGPL V3&lt;br /&gt;
* MiniCloud: [https://github.com/ryandoyle/minicloud homepage] | A set of client/server programs that provides similar functionality to the EC2 CLI tools for OpenVZ.&lt;br /&gt;
* OpenNode: [http://opennodecloud.com/ homepage (English)] - Bare-metal ISO installer (CentOS based) providing openvz, kvm, libvirt and func out-of-box together with OpenNode Management Server appliance - containing also ajax Web Management Console with secure HTML5 vnc and ssh vm consoles.&lt;br /&gt;
* OpenVZ Web Panel [http://code.google.com/p/ovz-web-panel/ homepage] - Version 2.1. Written on Ruby. Automatic installer, backup/restore/clone, pretty interface with charts, multi-user/roles/server/lingual support, user requests, event logging and all NEW: remote API, IP management and VZ migrations. Version 2.1 released on 2012-05-02. Very active development. &lt;br /&gt;
* Proxmox Virtual Environment: [http://pve.proxmox.com Proxmox VE Wiki] - including bare-metal ISO installer. Requires 64bit Processor.&lt;br /&gt;
* unxsVZ OpenVZ Multiple datacenter infrastructure manager for CentOS: [http://openisp.net/openisp/unxsVZ unxsVZ Trac Wiki] | Includes autonomic UBC adjusting, traffic and stats graphs. Supports hot-cold container clones, remote datacenter backups, IP and other resource management, container set group commands, NAT, and many advanced features. Very active development. Allows one or two staff to manage more than 1k containers on dozens of nodes across multiple datacenters. Installs via yum. GPLv2 licensed.&lt;br /&gt;
* VirtuoCP (formerly Vtonf): [http://sourceforge.net/projects/vtonf/ homepage] | According to the documentation only runs on CentOS 4.5 or higher. Last update 2010-10-17.&lt;br /&gt;
&lt;br /&gt;
== Proprietary / non-free == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* Aventurin{e}: [http://www.aventurin.net/ homepage (English)]&lt;br /&gt;
* NGASI: [http://www.ngasi.com/cloud/cp/index.zul homepage] is the Out-of-the-Box Platform-as-a-Service (PaaS) Solution. Quickly and easily create a cloud based P-a-a-S with 2 or more Virtuzzo/OpenVZ servers.&lt;br /&gt;
* oVZManager [http://www.ovzmanager.de homepage (Webinterface German and English)] Terminal and Rescue, IPv6 - Admin, Reseller, Customer - Windows Support over KVM &lt;br /&gt;
* Plesk [http://www.odin.com/products/plesk/ homepage], a control panel from Odin.&lt;br /&gt;
* SolusVM [http://www.solusvm.com homepage]. Also supports KVM, Xen PV &amp;amp; HVM. Includes support for VSwap&lt;br /&gt;
* TekBASE: [http://teklab.de/ homepage (German)] Admin, Customer panel for openvz, game, stream and voice servers&lt;br /&gt;
* VMmanager: [http://ispsystem.com/en/software/vmmanager/ homepage (English)], a control panel for virtual machines management. &lt;br /&gt;
* Virtualizor [http://www.virtualizor.com homepage] by Softaculous. Also supports Xen PV &amp;amp; HVM, Linux KVM. Powers over 10000 VMs.&lt;br /&gt;
* HostGuard [http://www.hostguard.net/ homepage]. Also supports KVM. Xen support due in February 2014.&lt;br /&gt;
&lt;br /&gt;
== Frozen projects == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* EasyVZ: [http://sourceforge.net/projects/easyvz sf.net project page] (little bit outdated, but working and free.  Last update Apr 2013) (requires Unix/Linux)&lt;br /&gt;
* vpsAdmin [http://www.vpsadmin.org homepage (french)] - GPLv3 license, PHP+MySQL+Bash, Multi-server &amp;amp; Multilingual support, vpsAdmin 1.0 released on January 19, 2010&lt;br /&gt;
* WebVZ: [http://webvz.sourceforge.net/ homepage] Version 2.0 released September 7, 2008 (Moved to [https://github.com/shuaibzahda/webvz/commits/master GitHub], last commit 2009-03-20). Requires Ruby on Rails.&lt;br /&gt;
* Webmin: [http://www.webmin.com/ homepage] | [http://www.webmin.com/cgi-bin/search_third.cgi?search=OpenVZ OpenVZ plugin] | Version 1.0, last updated 2006-02-07&lt;br /&gt;
&lt;br /&gt;
== Closed projects == &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
* BoxCtrl-VZ [http://www.boxctrl.com homepage] - Free and open source. Uses PHP, XML, and bash scripts. Lightweight. Released on Feb. 18th, 2012. Website does not exist&lt;br /&gt;
* Mwamko: [http://mwamko.org/ homepage] Last activity May 2007 - Website does not exist&lt;br /&gt;
* Panenthe: [http://www.panenthe.com/ homepage (English)] • [http://www.panenthe.com/products/panenthe-media/cat_id=4/ Screen shots] &amp;lt;- does not exist anymore since 2010&lt;br /&gt;
* RoboVZ: [http://sharesource.org/project/robovz homepage] {{forum|2559}} Lots of promises since announced in May 2007, nothing usable yet.  Possibly GPL license.  No activity in 2 years, calling it frozen.&lt;br /&gt;
* VZ-Manager: [http://vzmanager.de/ homepage (German)] website shows apache default page (11. 02. 2010)&lt;br /&gt;
* VZMaster [http://www.vzmaster.com homepage], [http://www.vzmaster.com/downloads/usermanual_vzmaster_1.0.0.pdf User Manual] -- We also provide complete OpenVZ Distro based on Ubuntu Server distribution. - Website is offline&lt;br /&gt;
* SLKVM [http://solukom.com/software/slkvm homepage]: console scripts to handle vz virtualization in a two node cluster. Website is down.&lt;br /&gt;
* FluidVM: [http://www.fluidvm.com Home Page]: website is not available&lt;br /&gt;
* Sysvm: [http://sysvm.com Home Page], The Enterprise hybrid vps control panel with ipv6 and load balancing, formally known as vcPanel. [http://sysvm.com/Demo Demo] , website is not available&lt;br /&gt;
* vePortal: [http://www.veportal.com/ homepage (English)] - Widely used OpenVZ Management Panel. Seems to be closed: &amp;quot;The vePortal project is currently not accepting new orders&amp;quot;&lt;br /&gt;
* VirtPanel [http://www.virtpanel.com homepage], Support for Xen and VMware in the future. Website does not exist.&lt;br /&gt;
&lt;br /&gt;
== In development == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
* easyVZ! [http://www.easyVZ.org/ homepage] &lt;br /&gt;
* DTC-Xen [http://www.gplhost.com/software-dtc-xen.html homepage] - Currently being ported to OpenVZ by its main developers.&lt;br /&gt;
* VZControl [https://github.com/mrkmg/vzcontrol github] - CLI interface to administer multiple OpenVZ Hosts. Written in PHP5. Last update in Nov 2013&lt;br /&gt;
&lt;br /&gt;
== 3rd party wrappers == &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Beside control panels that are designed to work with OpenVZ, a lot of great tools have been released that allow you to centralized manage your servers in general. If you are in knowledge of a popular programming language like Ruby, Python or Perl it's easy to create your own OpenVZ modules for them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
'''Perl'''&lt;br /&gt;
* (R)?ex [http://rexify.org/] - With (R)?ex you can manage all your boxes from a central point through the complete process of configuration management and software deployment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
'''Python'''&lt;br /&gt;
* Fabric [http://docs.fabfile.org/en/latest/] - Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
'''Ruby'''&lt;br /&gt;
* Capistrano [https://github.com/capistrano/capistrano] - Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you have a working modul for one of them or can suggest more such tools, feel free to add them!&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=12021</id>
		<title>Control panels</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=12021"/>
		<updated>2012-02-21T05:22:20Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* inserted HyperVM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains links to different control panels for OpenVZ, written by third parties. If you know the project that's missing here, please add it.&lt;br /&gt;
&lt;br /&gt;
== Free software / Open source (in alphabetical order) ==&lt;br /&gt;
* BoxCtrl-VZ [http://www.boxctrl.com homepage] - Free and open source. Uses PHP, XML, and bash scripts. Lightweight. Released on Feb. 18th, 2012.&lt;br /&gt;
* FOSVM (Free Open Source Virtual Machine manager): [http://fosvm.sourceforge.net/ homepage] |  Uses php and bash scripts, monitors bandwidth, Version 0.03a. Last updated 2009-05-18.&lt;br /&gt;
* HyperVM: [http://lxcenter.org/software/hypervm/ homepage] AGPL V3&lt;br /&gt;
* MiniCloud: [https://github.com/ryandoyle/minicloud homepage] | A set of client/server programs that provides similar functionality to the EC2 CLI tools for OpenVZ.&lt;br /&gt;
* OpenNode: [http://opennode.activesys.org/ homepage (English)] - Bare-metal ISO installer (CentOS based) providing openvz, kvm, libvirt and func out-of-box together with OpenNode Management Server appliance - containing also ajax Web Management Console with secure HTML5 vnc and ssh vm consoles.&lt;br /&gt;
* OpenVZ Web Panel [http://code.google.com/p/ovz-web-panel/ homepage] - Version 2.0. Written on Ruby. Automatic installer, backup/restore/clone, pretty interface with charts, multi-user/roles/server/lingual support, user requests, event logging and all NEW: remote API, IP management and VZ migrations. Version 2.0 released on 2011-04-17. Very active development. &lt;br /&gt;
* Proxmox Virtual Environment: [http://pve.proxmox.com Proxmox VE Wiki] - including bare-metal ISO installer. Requires 64bit Processor.&lt;br /&gt;
* SLKVM [http://solukom.com/software/slkvm homepage]: console scripts to handle vz virtualization in a two node cluster.&lt;br /&gt;
* unxsVZ OpenVZ Infrastructure Manager: [http://openisp.net/openisp/unxsVZ unxsVZ Trac Wiki] | Includes autonomic UBC adjusting and per container traffic graphs. Supports hot-spare clones and mount/umount conf file templates. Very active development. Last change to public svn code base July 24, 2011. &lt;br /&gt;
* VirtuoCP ( formerly Vtonf): [http://sourceforge.net/projects/vtonf/ homepage] | According to the documentation only runs on CentOS 4.5 or higher. Last update 2008-05-18.&lt;br /&gt;
&lt;br /&gt;
== Proprietary / non-free ==&lt;br /&gt;
* Aventurin{e}: [http://www.aventurin.net/ homepage (English)]&lt;br /&gt;
* FluidVM: [http://www.fluidvm.com Home Page] free (trial) for up to 5 VE's&lt;br /&gt;
* NGASI: [http://www.ngasi.com/cloud/cp/index.zul homepage] is the Out-of-the-Box Platform-as-a-Service (PaaS) Solution. Quickly and easily create a cloud based P-a-a-S with 2 or more Virtuzzo/OpenVZ servers.&lt;br /&gt;
* oVZManager [http://www.ovzmanager.de homepage (Webinterface German and English)] Terminal and Rescue, IPv6 - Admin, Reseller, Customer - Windows Support over KVM -Free 30 day trial&lt;br /&gt;
* Panenthe: [http://www.panenthe.com/ homepage (English)] • [http://www.panenthe.com/products/panenthe-media/cat_id=4/ Screen shots]&lt;br /&gt;
* SolusVM [http://www.solusvm.com homepage], Appears to be reasonably priced. Also supports KVM, Xen PV &amp;amp; HVM. Soluslabs Ltd (the company behind SolusVM) announced SolusVM hosts over 153,000 OpenVZ containers across it's clientbase (stats October 2011). Highly maintained, Free 15 day trial &amp;amp; 24/7 support included in license fee. '''Now includes support for VSwap'''&lt;br /&gt;
* Sysvm :[http://sysvm.com Home Page], The Enterprise hybrid vps control panel with ipv6 and load balancing,formally known as vcPanel . It is the first centralized VPS control panel for managing VPS around the globe [http://sysvm.com/Demo Demo] 15 day free trial&lt;br /&gt;
* VDSmanager for Linux :[http://ispsystem.com/en/software/vdsmanager/ homepage (English)]&lt;br /&gt;
* vePortal: [http://www.veportal.com/ homepage (English)] - Widely used OpenVZ Management Panel.&lt;br /&gt;
* VirtPanel [http://www.virtpanel.com homepage], Support for Xen and VMware in the future.&lt;br /&gt;
* Virtualizor [http://www.virtualizor.com homepage] by Softaculous. Also supports Xen PV &amp;amp; HVM&lt;br /&gt;
* VZMaster [http://www.vzmaster.com homepage], [http://www.vzmaster.com/downloads/usermanual_vzmaster_1.0.0.pdf User Manual] -- We also provide complete OpenVz Distro based on Ubuntu Server distribution.&lt;br /&gt;
&lt;br /&gt;
== Frozen projects ==&lt;br /&gt;
* EasyVZ: [http://easyvz.sourceforge.net/ screenshots] | [http://sourceforge.net/projects/easyvz sf.net project page] (little bit outdated, but working and free.  Last update Feb 2007) (requires Unix/Linux)&lt;br /&gt;
* Mwamko: [http://mwamko.org/ homepage] Last activity May 2007&lt;br /&gt;
* RoboVZ: [http://sharesource.org/project/robovz homepage] {{forum|2559}} Lots of promises since announced in May 2007, nothing usable yet.  Possibly GPL license.  No activity in 2 years, calling it frozen.&lt;br /&gt;
* vpsAdmin (www.vpsadmin.org) - GPLv3 license, PHP+MySQL+Bash, Multi-server &amp;amp; Multilingual support, vpsAdmin 1.0 released on January 19, 2010&lt;br /&gt;
* VZ-Manager: [http://vzmanager.de/ homepage (German)] website shows apache default page (11. 02. 2010)&lt;br /&gt;
* WebVZ: [http://webvz.sourceforge.net/ homepage] Version 2.0 released September 7, 2008 (Moved to [https://github.com/shuaibzahda/webvz/commits/master GitHub], last commit 2009-03-20). Requires Ruby on Rails.&lt;br /&gt;
* Webmin: [http://www.webmin.com/ homepage] | [http://www.webmin.com/cgi-bin/search_third.cgi?search=OpenVZ OpenVZ plugin] | Version 1.0, last updated 2006-02-07&lt;br /&gt;
&lt;br /&gt;
== In development ==&lt;br /&gt;
* easyVZ! [http://www.easyVZ.org/ homepage] &lt;br /&gt;
* DTC-Xen [http://www.gplhost.com/software-dtc-xen.html homepage] - Currently being ported to OpenVZ by its main developers.&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=12020</id>
		<title>Control panels</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Control_panels&amp;diff=12020"/>
		<updated>2012-02-21T05:15:39Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* moved HyperVM to free */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains links to different control panels for OpenVZ, written by third parties. If you know the project that's missing here, please add it.&lt;br /&gt;
&lt;br /&gt;
== Free software / Open source (in alphabetical order) ==&lt;br /&gt;
* BoxCtrl-VZ [http://www.boxctrl.com homepage] - Free and open source. Uses PHP, XML, and bash scripts. Lightweight. Released on Feb. 18th, 2012.&lt;br /&gt;
* FOSVM (Free Open Source Virtual Machine manager): [http://fosvm.sourceforge.net/ homepage] |  Uses php and bash scripts, monitors bandwidth, Version 0.03a. Last updated 2009-05-18.&lt;br /&gt;
* MiniCloud: [https://github.com/ryandoyle/minicloud homepage] | A set of client/server programs that provides similar functionality to the EC2 CLI tools for OpenVZ.&lt;br /&gt;
* OpenNode: [http://opennode.activesys.org/ homepage (English)] - Bare-metal ISO installer (CentOS based) providing openvz, kvm, libvirt and func out-of-box together with OpenNode Management Server appliance - containing also ajax Web Management Console with secure HTML5 vnc and ssh vm consoles.  &lt;br /&gt;
* OpenVZ Web Panel [http://code.google.com/p/ovz-web-panel/ homepage] - Version 2.0. Written on Ruby. Automatic installer, backup/restore/clone, pretty interface with charts, multi-user/roles/server/lingual support, user requests, event logging and all NEW: remote API, IP management and VZ migrations. Version 2.0 released on 2011-04-17. Very active development. &lt;br /&gt;
* Proxmox Virtual Environment: [http://pve.proxmox.com Proxmox VE Wiki] - including bare-metal ISO installer. Requires 64bit Processor.&lt;br /&gt;
* SLKVM [http://solukom.com/software/slkvm homepage]: console scripts to handle vz virtualization in a two node cluster.&lt;br /&gt;
* unxsVZ OpenVZ Infrastructure Manager: [http://openisp.net/openisp/unxsVZ unxsVZ Trac Wiki] | Includes autonomic UBC adjusting and per container traffic graphs. Supports hot-spare clones and mount/umount conf file templates. Very active development. Last change to public svn code base July 24, 2011. &lt;br /&gt;
* VirtuoCP ( formerly Vtonf): [http://sourceforge.net/projects/vtonf/ homepage] | According to the documentation only runs on CentOS 4.5 or higher. Last update 2008-05-18.&lt;br /&gt;
&lt;br /&gt;
== Proprietary / non-free ==&lt;br /&gt;
* Aventurin{e}: [http://www.aventurin.net/ homepage (English)]&lt;br /&gt;
* FluidVM: [http://www.fluidvm.com Home Page] free (trial) for up to 5 VE's&lt;br /&gt;
* NGASI: [http://www.ngasi.com/cloud/cp/index.zul homepage] is the Out-of-the-Box Platform-as-a-Service (PaaS) Solution. Quickly and easily create a cloud based P-a-a-S with 2 or more Virtuzzo/OpenVZ servers.&lt;br /&gt;
* oVZManager [http://www.ovzmanager.de homepage (Webinterface German and English)] Terminal and Rescue, IPv6 - Admin, Reseller, Customer - Windows Support over KVM -Free 30 day trial&lt;br /&gt;
* Panenthe: [http://www.panenthe.com/ homepage (English)] • [http://www.panenthe.com/products/panenthe-media/cat_id=4/ Screen shots]&lt;br /&gt;
* SolusVM [http://www.solusvm.com homepage], Appears to be reasonably priced. Also supports KVM, Xen PV &amp;amp; HVM. Soluslabs Ltd (the company behind SolusVM) announced SolusVM hosts over 153,000 OpenVZ containers across it's clientbase (stats October 2011). Highly maintained, Free 15 day trial &amp;amp; 24/7 support included in license fee. '''Now includes support for VSwap'''&lt;br /&gt;
* Sysvm :[http://sysvm.com Home Page], The Enterprise hybrid vps control panel with ipv6 and load balancing,formally known as vcPanel . It is the first centralized VPS control panel for managing VPS around the globe [http://sysvm.com/Demo Demo] 15 day free trial&lt;br /&gt;
* VDSmanager for Linux :[http://ispsystem.com/en/software/vdsmanager/ homepage (English)]&lt;br /&gt;
* vePortal: [http://www.veportal.com/ homepage (English)] - Widely used OpenVZ Management Panel.&lt;br /&gt;
* VirtPanel [http://www.virtpanel.com homepage], Support for Xen and VMware in the future.&lt;br /&gt;
* Virtualizor [http://www.virtualizor.com homepage] by Softaculous. Also supports Xen PV &amp;amp; HVM&lt;br /&gt;
* VZMaster [http://www.vzmaster.com homepage], [http://www.vzmaster.com/downloads/usermanual_vzmaster_1.0.0.pdf User Manual] -- We also provide complete OpenVz Distro based on Ubuntu Server distribution.&lt;br /&gt;
&lt;br /&gt;
== Frozen projects ==&lt;br /&gt;
* EasyVZ: [http://easyvz.sourceforge.net/ screenshots] | [http://sourceforge.net/projects/easyvz sf.net project page] (little bit outdated, but working and free.  Last update Feb 2007) (requires Unix/Linux)&lt;br /&gt;
* Mwamko: [http://mwamko.org/ homepage] Last activity May 2007&lt;br /&gt;
* RoboVZ: [http://sharesource.org/project/robovz homepage] {{forum|2559}} Lots of promises since announced in May 2007, nothing usable yet.  Possibly GPL license.  No activity in 2 years, calling it frozen.&lt;br /&gt;
* vpsAdmin (www.vpsadmin.org) - GPLv3 license, PHP+MySQL+Bash, Multi-server &amp;amp; Multilingual support, vpsAdmin 1.0 released on January 19, 2010&lt;br /&gt;
* VZ-Manager: [http://vzmanager.de/ homepage (German)] website shows apache default page (11. 02. 2010)&lt;br /&gt;
* WebVZ: [http://webvz.sourceforge.net/ homepage] Version 2.0 released September 7, 2008 (Moved to [https://github.com/shuaibzahda/webvz/commits/master GitHub], last commit 2009-03-20). Requires Ruby on Rails.&lt;br /&gt;
* Webmin: [http://www.webmin.com/ homepage] | [http://www.webmin.com/cgi-bin/search_third.cgi?search=OpenVZ OpenVZ plugin] | Version 1.0, last updated 2006-02-07&lt;br /&gt;
&lt;br /&gt;
== In development ==&lt;br /&gt;
* easyVZ! [http://www.easyVZ.org/ homepage] &lt;br /&gt;
* DTC-Xen [http://www.gplhost.com/software-dtc-xen.html homepage] - Currently being ported to OpenVZ by its main developers.&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=6534</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=6534"/>
		<updated>2008-10-17T15:20:39Z</updated>

		<summary type="html">&lt;p&gt;Geejay: Added specifics of iptables usage within a container. The method differs from securing a physical server!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and container templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container private&lt;br /&gt;
directories (by default &amp;lt;code&amp;gt;/var/lib/vz/private/&amp;lt;CTID&amp;gt;&amp;lt;/code&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind that per-container quota in this context includes not only pure per-container quota but also usual Linux disk quota used in container, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for containers because the root user of container will be able to overcome the 5% disk space barrier in some situations. If the  HN root partition is completely filled, it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems so use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org:&lt;br /&gt;
&lt;br /&gt;
; by Ola Lundqvist &amp;lt;opal@debian.org&amp;gt;&lt;br /&gt;
: (OpenVZ kernels only)&lt;br /&gt;
: apt-uri http://download.openvz.org/debian&lt;br /&gt;
&lt;br /&gt;
; by Thorsten Schifferdecker &amp;lt;tsd@debian.systs.org&amp;gt;&lt;br /&gt;
: apt-uri http://download.openvz.org/debian-systs&lt;br /&gt;
: (Mirror of OpenVZ Repository from http://debian.systs.org/)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps use the repository at http://download.openvz.org/debian-systs; the actual OpenVZ Tools for Debian exist only as unstable builds, see http://packages.debian.org/vzctl}}&lt;br /&gt;
&lt;br /&gt;
{{Note|By default, on Ubuntu systems root tasks are executed with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is even an '''lenny''' repository with kernel 2.6.24. '''Use it at your own risk!'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs lenny openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ kernel (the Debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from http://download.openvz.org'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian kernel config and OpenVZ Settings'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically, or execute update-grub; lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
: A utility to control OpenVZ containers (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
: A utility to manage quotas for containers. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # [sudo] sysctl -p&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward&lt;br /&gt;
compatibility to OpenVZ as installed in other distributions&lt;br /&gt;
(Debian vz root directory is /var/lib/vz to be FHS-compliant.}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
=== OS templates ===&lt;br /&gt;
&lt;br /&gt;
To install a container, you need OS template(s).&lt;br /&gt;
&lt;br /&gt;
Precreated templates can be found [http://download.openvz.org/contrib/template/precreated/ here].&lt;br /&gt;
&lt;br /&gt;
You can create your own templates, see &lt;br /&gt;
[[Debian template creation]], [[Ubuntu Gutsy template creation]] and [[:Category: Templates]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
== Additional User Tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
&lt;br /&gt;
; [[vzdump]]&lt;br /&gt;
:    A utility to backup and restore container. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
== Secure it ==&lt;br /&gt;
&lt;br /&gt;
If you want to secure your container with individual firewall rules (instead or additionally to securing the host node) then you must run iptables inside the container. This works slightly different than on a physical server. So make sure that you check that iptables rules are indeed applied as expected inside the container.&lt;br /&gt;
&lt;br /&gt;
Iptables modules required by the container must be specified in the general vz.conf file or the vzXXX.conf file of the container.&lt;br /&gt;
&lt;br /&gt;
Add the following line into vz.conf to activate the respective iptables modules for all containers.&lt;br /&gt;
&lt;br /&gt;
 IPTABLES=&amp;quot;ip_tables ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_LOG ipt_conntrack ipt_helper ipt_state iptable_nat ip_nat_ftp ip_nat_irc ipt_TOS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[http://wiki.debian.org/DebianFirewall][Configure]] your iptable rules inside the container.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Note that iptables rules inside the container are not applied automatically as on a physical server by starting the iptables module! Follow the instructions below}}&lt;br /&gt;
&lt;br /&gt;
To make sure the iptables rules are applied on a startup/reboot we'll create a new file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
Add these lines to it:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 /sbin/iptables-restore &amp;lt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
The file needs to be executable so change the permissions:&lt;br /&gt;
&lt;br /&gt;
 chmod +x /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
Start iptables&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables start&lt;br /&gt;
&lt;br /&gt;
If the startup shows errors then you have probably not activated the needed iptables modules. See above.&lt;br /&gt;
&lt;br /&gt;
Check inside the container that your iptables rules are indeed applied:&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
If the rules do not show up as you would expect on a physical server then you might not have activated the needed iptables modules.&lt;br /&gt;
&lt;br /&gt;
== Start it! ==&lt;br /&gt;
&lt;br /&gt;
 # [sudo] /etc/init.d/vz start&lt;br /&gt;
&lt;br /&gt;
This does not make the vz system automatically start at boot time.  For automatic start:&lt;br /&gt;
&lt;br /&gt;
 # [sudo] update-rc.d vz defaults 98&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a minimal OS template&lt;br /&gt;
to create a first container and do some&lt;br /&gt;
[[basic operations in OpenVZ environment]]. Read the [[download:doc/OpenVZ-Users-Guide.pdf]], browse this wiki.&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Debian]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=6533</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=6533"/>
		<updated>2008-10-17T14:50:00Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Geejay: /* openSUSE/SLES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&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;
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
Hint: Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.&lt;br /&gt;
&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 container 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 container 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 container 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;
If you copied from the dummy container then this step is already accomplished.&lt;br /&gt;
&lt;br /&gt;
=== IP address(es) ===&lt;br /&gt;
Also, you have to supply an IP for a new container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; and remove this. This is highly distribution-dependent; please add info for your distro here.&lt;br /&gt;
&lt;br /&gt;
For Suse 11.0, It is found in /etc/init.d/boot &lt;br /&gt;
&lt;br /&gt;
After you made sure your &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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;
=== Disable udev if you create DEVNODES devices ===&lt;br /&gt;
&lt;br /&gt;
If you are creating devices for the container with a DEVNODES statement in a veid.conf file then these devices may be overwritten/deleted by udev when the container starts. As udev cannot &amp;quot;see&amp;quot; the device from within the container it disables it. Therefore, if you have DEVNODES statements in veid.conf then disable udev.&lt;br /&gt;
&lt;br /&gt;
In Fedora, Redhat, Centos, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
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 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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 1777 tmp&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
* Debian Etch i386 with apache2, MySQL, etc. --[[User:geejay|geejay]] 17:29, 26 May 2008 (GMT)&lt;br /&gt;
* Centos 4.6 with apache2, MySQL, Qmail etc. --[[User:Bharathchari|Bharathchari]] 08:06, 13 June 2008 (EDT)&lt;br /&gt;
* Centos 4.6 with cPanel/WHM (Apache2, Mysql, Exim, etc) --[[User:Zccopwrx|Zccopwrx]] 08:16, 30 July 2008 (EDT)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=6050</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=6050"/>
		<updated>2008-06-05T22:07:27Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* SECURE IT ! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and container templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container private&lt;br /&gt;
directories (by default &amp;lt;code&amp;gt;/var/lib/vz/private/&amp;lt;CTID&amp;gt;&amp;lt;/code&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind that per-container quota in this context includes not only pure per-container quota but also usual Linux disk quota used in container, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for containers because the root user of container will be able to overcome the 5% disk space barrier in some situations. If the  HN root partition is completely filled, it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems so use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org:&lt;br /&gt;
&lt;br /&gt;
; by Ola Lundqvist &amp;lt;opal@debian.org&amp;gt;&lt;br /&gt;
: (OpenVZ kernels only)&lt;br /&gt;
: apt-uri http://download.openvz.org/debian&lt;br /&gt;
&lt;br /&gt;
; by Thorsten Schifferdecker &amp;lt;tsd@debian.systs.org&amp;gt;&lt;br /&gt;
: apt-uri http://download.openvz.org/debian-systs&lt;br /&gt;
: (Mirror of OpenVZ Repository from http://debian.systs.org/)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository at http://download.openvz.org/debian-systs, the actually OpenVZ Tools for Debian are exist only in unstable, see http://packages.debian.org/vzctl}}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on Ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is even an '''lenny''' repository with kernel 2.6.24. '''Use it at your own risk!'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs lenny openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ kernel (the Debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from http://download.openvz.org'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian kernel config and OpenVZ Settings'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically, or execute update-grub; lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
: A utility to control OpenVZ containers (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
: A utility to manage quotas for containers. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # [sudo] sysctl -p&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward&lt;br /&gt;
compatibility to OpenVZ as installed in other distributions&lt;br /&gt;
(Debian vz root directory is /var/lib/vz to be FHS-compliant.}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
=== OS templates ===&lt;br /&gt;
&lt;br /&gt;
To install a container, you need OS template(s).&lt;br /&gt;
&lt;br /&gt;
Precreated templates can be found [http://download.openvz.org/contrib/template/precreated/ here].&lt;br /&gt;
&lt;br /&gt;
You can create your own templates, see &lt;br /&gt;
[[Debian template creation]], [[Ubuntu Gutsy template creation] and [[Category:Templates]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
== Additional User Tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
&lt;br /&gt;
; [[vzdump]]&lt;br /&gt;
:    A utility to backup and restore container. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a minimal OS template&lt;br /&gt;
to create a first container and do some&lt;br /&gt;
[[basic operations in OpenVZ environment]]. Read the [[download:doc/OpenVZ-Users-Guide.pdf]], browse this wiki.&lt;br /&gt;
&lt;br /&gt;
== SECURE IT ! ==&lt;br /&gt;
&lt;br /&gt;
Now comes a small advice from someone who got his debian 4.0 container hacked by some script kiddies with a ssh brute-force method within a day after deployment. I believed naively that iptables was active on boot of the container as I had used webmin inside the VE to activate iptables on boot. &lt;br /&gt;
&lt;br /&gt;
That is not so! Although webmin shows that iptables (Linux Firewall) is active on boot, it is not. You need to make a startup script for iptables as described further down. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now see what rules are already configured. Issue this command inside your container:&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
The output will be similar to this:&lt;br /&gt;
&lt;br /&gt;
 Chain INPUT (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
 Chain FORWARD (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
 Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
&lt;br /&gt;
This allows anyone access to anything from anywhere.&lt;br /&gt;
[edit]&lt;br /&gt;
New iptables rules&lt;br /&gt;
&lt;br /&gt;
Let's tighten that up a bit by creating a test iptables file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/iptables.test.rules&lt;br /&gt;
&lt;br /&gt;
In this file enter some basic rules:&lt;br /&gt;
&lt;br /&gt;
*filter&lt;br /&gt;
&lt;br /&gt;
Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0&lt;br /&gt;
 -A INPUT -i lo -j ACCEPT&lt;br /&gt;
 -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT&lt;br /&gt;
&lt;br /&gt;
Accepts all established inbound connections&lt;br /&gt;
 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows all outbound traffic&lt;br /&gt;
You could modify this to only allow certain traffic&lt;br /&gt;
 -A OUTPUT -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)&lt;br /&gt;
 -A INPUT -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows SSH connections for script kiddies&lt;br /&gt;
THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE&lt;br /&gt;
 -A INPUT -p tcp -m state --state NEW --dport 30000 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Now you should read up on iptables rules and consider whether ssh access &lt;br /&gt;
for everyone is really desired. Most likely you will only allow access from certain IPs.&lt;br /&gt;
&lt;br /&gt;
Allow ping&lt;br /&gt;
 -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
log iptables denied calls (access via 'dmesg' command)&lt;br /&gt;
 -A INPUT -m limit --limit 5/min -j LOG --log-prefix &amp;quot;iptables denied: &amp;quot; --log-level 7&lt;br /&gt;
&lt;br /&gt;
Reject all other inbound - default deny unless explicitly allowed policy&lt;br /&gt;
 -A INPUT -j REJECT&lt;br /&gt;
 -A FORWARD -j REJECT&lt;br /&gt;
&lt;br /&gt;
COMMIT&lt;br /&gt;
&lt;br /&gt;
That may look complicated, but look at each section at a time. You will see that it simply shuts all ports except the ones we have allowed - which in this case are ports 80 and 443 (the standard web browser ports) and the SSH port defined earlier.&lt;br /&gt;
&lt;br /&gt;
Activate these new rules:&lt;br /&gt;
&lt;br /&gt;
 iptables-restore &amp;lt; /etc/iptables.test.rules&lt;br /&gt;
&lt;br /&gt;
And see the difference:&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
Now the output tells us that only the ports defined above are open. All the others are closed.&lt;br /&gt;
&lt;br /&gt;
Once you are happy, save the new rules to the master iptables file:&lt;br /&gt;
&lt;br /&gt;
 iptables-save &amp;gt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
To make sure the iptables rules are started on a reboot we'll create a new file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
Add these lines to it:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 /sbin/iptables-restore &amp;lt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
The file needs to be executable so change the permissions:&lt;br /&gt;
&lt;br /&gt;
 chmod +x /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Debian]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=6049</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=6049"/>
		<updated>2008-06-05T21:56:51Z</updated>

		<summary type="html">&lt;p&gt;Geejay: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ consists of a kernel, user-level tools, and container templates.&lt;br /&gt;
&lt;br /&gt;
This guide tells how to install the kernel and the tools on [http://www.debian.org Debian] stable. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container private&lt;br /&gt;
directories (by default &amp;lt;code&amp;gt;/var/lib/vz/private/&amp;lt;CTID&amp;gt;&amp;lt;/code&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind that per-container quota in this context includes not only pure per-container quota but also usual Linux disk quota used in container, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for containers because the root user of container will be able to overcome the 5% disk space barrier in some situations. If the  HN root partition is completely filled, it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems so use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== Repository setup ===&lt;br /&gt;
&lt;br /&gt;
At the moment two different repositories are online at http://download.openvz.org:&lt;br /&gt;
&lt;br /&gt;
; by Ola Lundqvist &amp;lt;opal@debian.org&amp;gt;&lt;br /&gt;
: (OpenVZ kernels only)&lt;br /&gt;
: apt-uri http://download.openvz.org/debian&lt;br /&gt;
&lt;br /&gt;
; by Thorsten Schifferdecker &amp;lt;tsd@debian.systs.org&amp;gt;&lt;br /&gt;
: apt-uri http://download.openvz.org/debian-systs&lt;br /&gt;
: (Mirror of OpenVZ Repository from http://debian.systs.org/)&lt;br /&gt;
&lt;br /&gt;
{{Note|The next steps used the Repository at http://download.openvz.org/debian-systs, the actually OpenVZ Tools for Debian are exist only in unstable, see http://packages.debian.org/vzctl}}&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on Ubuntu system, root task are done with [https://help.ubuntu.com/community/RootSudo sudo]}}&lt;br /&gt;
&lt;br /&gt;
This can be achieved by the following commands, as root or as privileged &amp;quot;sudo&amp;quot; user&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs etch openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is even an '''lenny''' repository with kernel 2.6.24. '''Use it at your own risk!'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo -e &amp;quot;\ndeb http://download.openvz.org/debian-systs lenny openvz&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
# wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add - &amp;amp;&amp;amp; apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the OpenVZ kernel yourself on Debian, see [[Compiling the OpenVZ kernel (the Debian way)]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what kernel you want to install.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with kernel config from http://download.openvz.org'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| i386 and amd64&lt;br /&gt;
|-&lt;br /&gt;
! ovzkernel-2.6.18-enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386 only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''OpenVZ Kernel list built with official Debian kernel config and OpenVZ Settings'''&lt;br /&gt;
! Kernel !! Description !! Hardware !! Debian Architecture&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-686-bigmem&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| i386&lt;br /&gt;
|-&lt;br /&gt;
! fzakernel-2.6.18-amd64&lt;br /&gt;
| uni- and multiprocessor&lt;br /&gt;
| &lt;br /&gt;
| amd64&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;kernel&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the bootloader ===&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically, or execute update-grub; lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/menu.lst&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
  title           Debian GNU/Linux, kernel 2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  root            (hd0,1)&lt;br /&gt;
  kernel          /vmlinuz-2.6.18-ovz-028stab051.1-686 root=/dev/sda5 ro vga=791&lt;br /&gt;
  initrd          /initrd.img-2.6.18-ovz-028stab051.1-686&lt;br /&gt;
  savedefault&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|per default on debian/ubuntu, a 2.6.22 kernel will boot before a 2.6.18, please check manually the grub boot order. See man update-grub for more details}}&lt;br /&gt;
&lt;br /&gt;
=== Rebooting into OpenVZ kernel ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.}}&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose the OpenVZ Linux Kernel on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Installing the user-level tools ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
: A utility to control OpenVZ containers (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
: A utility to manage quotas for containers. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # [sudo] apt-get install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
{{Note|vzctl version from debian-systs, automate changing sysctl options for openvz}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
&lt;br /&gt;
net.ipv4.conf.default.forwarding=1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # [sudo] sysctl -p&lt;br /&gt;
&lt;br /&gt;
{{Note|You can make a symlink from /var/lib/vz to /vz as backward&lt;br /&gt;
compatibility to OpenVZ as installed in other distributions&lt;br /&gt;
(Debian vz root directory is /var/lib/vz to be FHS-compliant.}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] ln -s /var/lib/vz /vz &lt;br /&gt;
&lt;br /&gt;
=== OS templates ===&lt;br /&gt;
&lt;br /&gt;
To install a container, you need OS template(s).&lt;br /&gt;
&lt;br /&gt;
Precreated templates can be found [http://download.openvz.org/contrib/template/precreated/ here].&lt;br /&gt;
&lt;br /&gt;
You can create your own templates, see &lt;br /&gt;
[[Debian template creation]], [[Ubuntu Gutsy template creation] and [[Category:Templates]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Setup your prefered standard OS Template : edit the /etc/vz/vz.conf}}&lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
== Additional User Tools ==&lt;br /&gt;
&lt;br /&gt;
; vzprocps&lt;br /&gt;
:    A set of utilities to provide system information (vzps and vztop)&lt;br /&gt;
&lt;br /&gt;
; [[vzdump]]&lt;br /&gt;
:    A utility to backup and restore container. &lt;br /&gt;
&lt;br /&gt;
  # [sudo] apt-get install vzprocps vzdump&lt;br /&gt;
&lt;br /&gt;
== Use it! ==&lt;br /&gt;
&lt;br /&gt;
After installing the OpenVZ kernel, user tools and a minimal OS template&lt;br /&gt;
to create a first container and do some&lt;br /&gt;
[[basic operations in OpenVZ environment]]. Read the [[download:doc/OpenVZ-Users-Guide.pdf]], browse this wiki.&lt;br /&gt;
&lt;br /&gt;
== SECURE IT ! ==&lt;br /&gt;
&lt;br /&gt;
Now comes a small advice from someone who got his debian 4.0 container hacked by some script kiddies with a ssh brute-force method within a day after deployment. I believed naively that iptables was active on boot of the container as I had used webmin inside the VE to activate iptables on boot. &lt;br /&gt;
&lt;br /&gt;
That is not so! Although webmin shows that iptables (Linux Firewall) is active on boot, it is not. You need to make a startup script for iptables as described further down. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now see what rules are already configured:&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
The output will be similar to this:&lt;br /&gt;
&lt;br /&gt;
 Chain INPUT (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
 Chain FORWARD (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
 Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
 target     prot opt source               destination&lt;br /&gt;
&lt;br /&gt;
This allows anyone access to anything from anywhere.&lt;br /&gt;
[edit]&lt;br /&gt;
New iptables rules&lt;br /&gt;
&lt;br /&gt;
Let's tighten that up a bit by creating a test iptables file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/iptables.test.rules&lt;br /&gt;
&lt;br /&gt;
In this file enter some basic rules:&lt;br /&gt;
&lt;br /&gt;
*filter&lt;br /&gt;
&lt;br /&gt;
Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0&lt;br /&gt;
 -A INPUT -i lo -j ACCEPT&lt;br /&gt;
 -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT&lt;br /&gt;
&lt;br /&gt;
Accepts all established inbound connections&lt;br /&gt;
 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows all outbound traffic&lt;br /&gt;
You could modify this to only allow certain traffic&lt;br /&gt;
 -A OUTPUT -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)&lt;br /&gt;
 -A INPUT -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Allows SSH connections for script kiddies&lt;br /&gt;
THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE&lt;br /&gt;
 -A INPUT -p tcp -m state --state NEW --dport 30000 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Now you should read up on iptables rules and consider whether ssh access &lt;br /&gt;
for everyone is really desired. Most likely you will only allow access from certain IPs.&lt;br /&gt;
&lt;br /&gt;
Allow ping&lt;br /&gt;
 -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
log iptables denied calls (access via 'dmesg' command)&lt;br /&gt;
 -A INPUT -m limit --limit 5/min -j LOG --log-prefix &amp;quot;iptables denied: &amp;quot; --log-level 7&lt;br /&gt;
&lt;br /&gt;
Reject all other inbound - default deny unless explicitly allowed policy&lt;br /&gt;
 -A INPUT -j REJECT&lt;br /&gt;
 -A FORWARD -j REJECT&lt;br /&gt;
&lt;br /&gt;
COMMIT&lt;br /&gt;
&lt;br /&gt;
That may look complicated, but look at each section at a time. You will see that it simply shuts all ports except the ones we have allowed - which in this case are ports 80 and 443 (the standard web browser ports) and the SSH port defined earlier.&lt;br /&gt;
&lt;br /&gt;
Activate these new rules:&lt;br /&gt;
&lt;br /&gt;
 iptables-restore &amp;lt; /etc/iptables.test.rules&lt;br /&gt;
&lt;br /&gt;
And see the difference:&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
Now the output tells us that only the ports defined above are open. All the others are closed.&lt;br /&gt;
&lt;br /&gt;
Once you are happy, save the new rules to the master iptables file:&lt;br /&gt;
&lt;br /&gt;
 iptables-save &amp;gt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
To make sure the iptables rules are started on a reboot we'll create a new file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
Add these lines to it:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 /sbin/iptables-restore &amp;lt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
The file needs to be executable so change the permissions:&lt;br /&gt;
&lt;br /&gt;
 chmod +x /etc/network/if-pre-up.d/iptables&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Debian]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=5964</id>
		<title>Talk:Physical to container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=5964"/>
		<updated>2008-05-26T17:38:48Z</updated>

		<summary type="html">&lt;p&gt;Geejay: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RSync Command ==&lt;br /&gt;
Please check the following command,  Ive used with success:&lt;br /&gt;
 rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp --exclude mnt --exclude sys -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;
== Migration Script ==&lt;br /&gt;
&lt;br /&gt;
I composed a little Script to migrate a Debian Sarge Box to OpenVZ. (Some System specific steps have been removed)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
echo &amp;quot;Stopping VE 300...&amp;quot;&lt;br /&gt;
vzctl stop 300&lt;br /&gt;
echo &amp;quot;Creating base filesystem /dev /proc ...&amp;quot;&lt;br /&gt;
mknod /vz/private/300/dev/ptmx c 5 2&lt;br /&gt;
mkdir /vz/private/300/dev/pts&lt;br /&gt;
rm -f /vz/private/300/dev/null&lt;br /&gt;
mknod /vz/private/300/dev/null c 1 3&lt;br /&gt;
chmod o+rw /vz/private/300/dev/null&lt;br /&gt;
echo &amp;quot;Copy the tty's to VE and Set Permissions&amp;quot;&lt;br /&gt;
cp -r /dev/ttyp* /dev/ptyp* /vz/private/300/dev/&lt;br /&gt;
chmod o+wx /vz/private/300/dev/*typ*&lt;br /&gt;
echo &amp;quot;Creating /dev/random and Set Permissions&amp;quot;&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/random c 1 8&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/urandom c 1 9&lt;br /&gt;
chown root:root /vz/private/300/dev/random /vz/private/300/dev/urandom&lt;br /&gt;
echo &amp;quot;clearing mtab / fstab...&amp;quot;&lt;br /&gt;
echo -n &amp;gt; /vz/private/300/etc/fstab&lt;br /&gt;
rm /vz/private/300/etc/mtab&lt;br /&gt;
ln -s /proc/mounts /vz/private/300/etc/mtab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Dummy ==&lt;br /&gt;
&lt;br /&gt;
Having been completely clueless about Openvz three days ago I first created a dummy container based on the same distribution I wanted to migrate. This helped me greatly to understand what was needed and also allowed to use the dummy as a template for /dev and the conf file. Disregarding the time to setup the host system the actual migration from the physical machine with tar ball took me two hours and the migrated container started up on second attempt after first complaining about disk size. I increased that and it runs. I am very impressed by the ease of it all.&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5963</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=5963"/>
		<updated>2008-05-26T17:29:53Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* Success stories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&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;
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
Hint: Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.&lt;br /&gt;
&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 container 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 container 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 container 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;
If you copied from the dummy container then this step is already accomplished.&lt;br /&gt;
&lt;br /&gt;
=== IP address(es) ===&lt;br /&gt;
Also, you have to supply an IP for a new container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
* Debian Etch i386 with apache2, MySQL, etc. --[[User:geejay|geejay]] 17:29, 26 May 2008 (GMT)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5962</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=5962"/>
		<updated>2008-05-26T17:26:20Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* OSTEMPLATE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&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;
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
Hint: Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.&lt;br /&gt;
&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 container 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 container 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 container 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;
If you copied from the dummy container then this step is already accomplished.&lt;br /&gt;
&lt;br /&gt;
=== IP address(es) ===&lt;br /&gt;
Also, you have to supply an IP for a new container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5961</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=5961"/>
		<updated>2008-05-26T17:24:45Z</updated>

		<summary type="html">&lt;p&gt;Geejay: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&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;
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
Hint: Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.&lt;br /&gt;
&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 container 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 container 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 container 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 container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5960</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=5960"/>
		<updated>2008-05-26T17:20:37Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* Introduction: static /dev */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
To make things easier you may like to first create a second dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify.&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 container 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 container 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 container 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 container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5959</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=5959"/>
		<updated>2008-05-26T17:16:09Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* Preparing to migrate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
To make things easier you may like to first create a second dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify.&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 container 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 container 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 container 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 container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Physical_to_container&amp;diff=5958</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=5958"/>
		<updated>2008-05-26T17:14:15Z</updated>

		<summary type="html">&lt;p&gt;Geejay: /* Preparing to migrate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A rough description of how to migrate existing physical server into a [[container]].&lt;br /&gt;
&lt;br /&gt;
== Prepare a new “empty” container ==&lt;br /&gt;
For OpenVZ this would mean the following (assume you chose CT 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;
To make things easier you may like to first create a second dummy container based on the same distribution you want to migrate. That way you can take that as a template copy and modify stuff from that container to your new migrated container.&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 container 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 container 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 container 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 container:&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 container is a bit different to a real physical server, you have to edit some files inside your new container.&lt;br /&gt;
&lt;br /&gt;
=== /etc/inittab ===&lt;br /&gt;
A container 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 container's root filesystem (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;) is mounted not from the container itself, but rather from the host system. That leaves &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; in container 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 container.&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 container, /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) container:&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 container to work, some nodes should be present in container's &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;. For modern distributions, udev is taking care of it. For a variety of reasons udev doesn't make much sense in a container, 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; — this will not work in case of static &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;tmpfs&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; is static, populate it with needed device nodes.&lt;br /&gt;
&lt;br /&gt;
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by &amp;lt;code&amp;gt;umask&amp;lt;/code&amp;gt; ([[w:umask]]). You can use --mode option for &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; to set the desired permissions.&lt;br /&gt;
&lt;br /&gt;
==== tty device nodes ====&lt;br /&gt;
&lt;br /&gt;
In order for vzctl enter to work, a container 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 --mode 666 /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 --mode 666 /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 --mode 444 /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 container)&lt;br /&gt;
* clock (no clock setting is required/allowed in container)&lt;br /&gt;
* consolefont (container does not have a console)&lt;br /&gt;
* hdparm (container does not have real hard drives)&lt;br /&gt;
* klogd (unless you use iptables to LOG some packets)&lt;br /&gt;
* keymaps (container does not have a real keyboard)&lt;br /&gt;
* kudzu (container does not have real hardware)&lt;br /&gt;
* lm_sensors (container does not have access to hardware sensors)&lt;br /&gt;
* microcodectl (container can not update CPU microcode)&lt;br /&gt;
* netplugd (container 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/{CTID}/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 container ==&lt;br /&gt;
&lt;br /&gt;
Try to start your new container:&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;
===PHP not serving pages / random issues===&lt;br /&gt;
&lt;br /&gt;
Make sure that /tmp and /var/tmp are created if you rsynced over your data and that they have proper permissions&lt;br /&gt;
&lt;br /&gt;
 mkdir tmp&lt;br /&gt;
 chmod 777 tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Can't enter container ===&lt;br /&gt;
&lt;br /&gt;
If you can not enter your container (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 container's startup scripts. On some distros, you need to have the appropriate line in container's /etc/fstab.&lt;br /&gt;
&lt;br /&gt;
In Fedora, try commenting out any '''udev''' entries in /vz/private/{CTID}/etc/rc.sysinit&lt;br /&gt;
 vi /vz/private/{CTID}/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;
{{Note|please add your line to the bottom of this list, and do not forget to sign it using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Debian 3.1 Sarge with MySQL, apache2, PowerDNS --[[User:Stoffell|stoffell]] 08:41, 8 February 2007 (EST)&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;
* Gentoo with Courier, Postfix, MySQL, Apache2 --[[User:bfrackie|bfrackie]] 19:00, 18 March 2007 (EST)&lt;br /&gt;
* AltLinux Master with qmail, MySQL, Apache, etc - to Debian/testing with OpenVZ --[[User:alexkuklin|alexkuklin]] 16:16, 23 March 2007 (EST)&lt;br /&gt;
* Centos 4.4 with apache2, SVN, TRAC, etc. --[[User:bitherder|bitherder]] 23:38, 26 February 2008 (EST) &lt;br /&gt;
* Centos 4.6 with apache2, Tomcat 5.0.x, postgresql, etc on CentOS 5.1 64bit Host --[[User:laslos|laslos]] 17:35, 10 March 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2 etc... on CentOS 4.6 Host --[[User:laslos|laslos]] 19:46, 10 March 2008 (EST)&lt;br /&gt;
* Debian 1:3.3.5-13 with apache2, PHP, etc. --[[User:Spawrks|spawrks]] 23:36, 10 April 2008 (EST)&lt;br /&gt;
* Debian Etch with apache2, MySQL, etc. --[[User:Zhafrance|zhafrance]] 16:29, 20 April 2008 (EST)&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Geejay</name></author>
		
	</entry>
</feed>