<?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=Baranek</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=Baranek"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Baranek"/>
	<updated>2026-06-10T00:59:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6608</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6608"/>
		<updated>2008-10-29T16:01:37Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.conf'''.&lt;br /&gt;
# Copy '''/vz/template/centos/4/i386/config/minimal.list''' to ''' /vz/template/centos/5/i386/config/minimal.list'''. &lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln -s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod -m 644 /dev/random c 1 8 &lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz ./'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6561</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6561"/>
		<updated>2008-10-27T15:40:02Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.conf'''.&lt;br /&gt;
# Copy '''/vz/template/centos/4/i386/config/minimal.list''' to ''' /vz/template/centos/5/i386/config/minimal.list'''. &lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln -s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz ./'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6560</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6560"/>
		<updated>2008-10-27T14:49:44Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.0.conf'''.&lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln -s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz ./'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6559</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6559"/>
		<updated>2008-10-27T12:10:24Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.0.conf'''.&lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln -s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz /vz/private/50/'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6558</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6558"/>
		<updated>2008-10-27T10:27:09Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.0.conf'''.&lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln –s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz /vz/private/50/'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6557</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6557"/>
		<updated>2008-10-27T10:12:53Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.0.conf'''.&lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf –'''  to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln –s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6556</id>
		<title>Creating a CentOS 5.0 Template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Creating_a_CentOS_5.0_Template&amp;diff=6556"/>
		<updated>2008-10-27T09:03:25Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
{{wikify}}&lt;br /&gt;
&lt;br /&gt;
# Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a minimal distro or the default distro or even something custom.&lt;br /&gt;
## It's generally quicker to bootstrap a CentOS system on another yum/rpm-based, or Debian based system by following the instructions in [http://faiwiki.informatik.uni-koeln.de/index.php/FAI_multi-distribution#bootstrapping_the_base_images__for_other_distributions]&lt;br /&gt;
# Once the OS has been installed, you need to '''tar''' the contents of the OS.&lt;br /&gt;
## First, create a file called '''/tmp/exclude''' and add the following lines to it:&lt;br /&gt;
#:  .bash_history&lt;br /&gt;
#:  lost+found&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;
## Now, tar the OS file up by typing: '''tar –czvf /tmp/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz –X /tmp/exclude /''' where &amp;lt;'''ARCH'''&amp;gt; represents the system architecture ('''i386''' or &lt;br /&gt;
#: '''x86_64''') and &amp;lt;'''DISTRO'''&amp;gt; represents the distribution (default, minimal, etc.).&lt;br /&gt;
## Now transfer the file over to the OpenVZ server into '''/vz/template/cache''' folder.&lt;br /&gt;
# On the OpenVZ server create a “dummy” container by creating a folder called '''/vz/private/50''' &lt;br /&gt;
#: and copying the '''/etc/vz/conf/ve-vps.basic.conf-sample''' to '''/etc/vz/conf/50.conf'''.&lt;br /&gt;
#: '''NOTE''': 50 is the CTID for the container. You can choose any unused CTID on the OpenVZ server.&lt;br /&gt;
# Now create a new folder called '''/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/config''' again where &lt;br /&gt;
#: &amp;lt;'''ARCH'''&amp;gt; represents the system architecture.&lt;br /&gt;
# Create a file in the folder called rpm and add the following line:&lt;br /&gt;
#:  43&lt;br /&gt;
# Create a file called '''yum.conf''' in the folder and add the following lines:&lt;br /&gt;
#:  [main]&lt;br /&gt;
#:  &lt;br /&gt;
#:  cachedir=/vz/template/centos/5.0/&amp;lt;ARCH&amp;gt;/yum-cache/&lt;br /&gt;
#:  &lt;br /&gt;
#:  reposdir=/dev/null&lt;br /&gt;
#:  &lt;br /&gt;
#:  installonlypkgs=&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-base]&lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Base&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/os/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  [centos5-updates-released]&lt;br /&gt;
#:  &lt;br /&gt;
#:  name=CentOS 5 - &amp;lt;ARCH&amp;gt; - Released Updates&lt;br /&gt;
#:  &lt;br /&gt;
#:  baseurl=http://mirror.centos.org/centos/5/updates/&amp;lt;ARCH&amp;gt;/&lt;br /&gt;
#:  &lt;br /&gt;
#:  enabled=1&lt;br /&gt;
#:  &lt;br /&gt;
#:  gpgcheck=1&lt;br /&gt;
# Copy '''/etc/vz/dists/centos-4.conf''' to '''/etc/vz/dists/centos-5.0.conf'''.&lt;br /&gt;
# Change to the '''/vz/private/50''' folder and then run the command '''gunzip –dc /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;-image.tar.gz | tar –xvf''' – to unpack the base image to the folder.&lt;br /&gt;
# Make sure you are in the '''/vz/private/50''' folder.&lt;br /&gt;
# Edit '''etc/shadow''' and remove the replace the '''root''' password with !! instead of the hashed value.&lt;br /&gt;
# Edit the '''etc/inittab''' file and comment out the lines that respawn '''/sbin/mingetty''' on '''tty1''' through '''tty6'''. Just put a # at the beginning of the line.&lt;br /&gt;
# Remove the '''etc/mtab''' file and then create a symbolic link by typing '''ln –s /proc/mounts etc/mtab'''.&lt;br /&gt;
# Remove all of the lines from '''etc/fstab''' except for the line that mounts '''/dev/pts'''.&lt;br /&gt;
# Edit '''etc/rc.d/rc.sysinit''' and comment out the line that starts '''/sbin/start_udev''' by placing a # at the beginning of the line.&lt;br /&gt;
# Now create device nodes by typing:&lt;br /&gt;
#:  mknod dev/ptmx c 5 2&lt;br /&gt;
#:  mkdir dev/pts&lt;br /&gt;
#:  /sbin/MAKEDEV –d /vz/private/50/dev ttyp ptyp&lt;br /&gt;
#:  mknod dev/null c 1 3&lt;br /&gt;
#:  mknod dev/urandom c 1 9&lt;br /&gt;
# Create the '''var/lock/rpm''' folder.&lt;br /&gt;
# If you wish to disable IPv6, do the following:&lt;br /&gt;
## Edit '''etc/sysconfig/network''' and set '''NETWORKING_IPV6''' to '''no'''.&lt;br /&gt;
## Add the following lines to '''etc/modprobe.d/blacklist''':&lt;br /&gt;
#:  blacklist ipv6&lt;br /&gt;
#:  blacklist net-pf-10&lt;br /&gt;
# Disable any physical NICs by modifying the '''etc/sysconfig/network-scripts/ifcfg-ethX''' files (where '''X''' is the interface number starting from '''0''') and setting '''ONBOOT''' to '''no'''.&lt;br /&gt;
# Now you’re ready to start the template. Type '''vzctl start 50''' and wait for it to start.&lt;br /&gt;
# You can install additional packages into the container by typing '''vzyum 50 install &amp;lt;package&amp;gt;''' at the prompt where &amp;lt;'''package'''&amp;gt; represents the name of the software package you wish to install.&lt;br /&gt;
# Finally, you should turn off unnecessary services.&lt;br /&gt;
## Enter the container by typing '''vzctl enter 50'''.&lt;br /&gt;
## View the services that are set to run at startup by typing '''chkconfig --list | grep 5:on'''.&lt;br /&gt;
## Disable any unwanted service by typing '''chkconfig --levels 2345 &amp;lt;service&amp;gt;''' off where &amp;lt;'''service'''&amp;gt; represents the service to disable.&lt;br /&gt;
#: Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and  microcode_ctl.&lt;br /&gt;
# Exit the container by typing '''exit''' at the prompt.&lt;br /&gt;
# Stop the container by typing '''vzctl stop 50'''.&lt;br /&gt;
# Finally, package up the new template by typing '''tar –czvf /vz/template/cache/centos-5.0-&amp;lt;ARCH&amp;gt;-&amp;lt;DISTRO&amp;gt;.tar.gz'''.&lt;br /&gt;
# The template is ready for use.&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Centos_Upgrade_4.x_to_5.x&amp;diff=6240</id>
		<title>Centos Upgrade 4.x to 5.x</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Centos_Upgrade_4.x_to_5.x&amp;diff=6240"/>
		<updated>2008-07-23T13:19:30Z</updated>

		<summary type="html">&lt;p&gt;Baranek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Templates]]&lt;br /&gt;
&lt;br /&gt;
To create a CentOS 5 minimal template from centos-4-i386-minimal,&lt;br /&gt;
follow these steps:&lt;br /&gt;
&lt;br /&gt;
1 - Create a container using centos-4-i386-minimal and set a valid nameserver &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd container_IP --hostname temp&lt;br /&gt;
vzctl set CTID --nameserver NAMESERVER_IP --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
2 - Enter in container&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl enter CTID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
3 - Install centos-5-release packages&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/centos-release-notes-5.0.0-2.i386.rpm&lt;br /&gt;
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/centos-release-5-0.0.el5.centos.2.i386.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: centos-release-5 depends on notes-package, start with that one.&lt;br /&gt;
&lt;br /&gt;
4 - Backup your /dev/, since initscripts need udev and will remove vzdev you'll net the backup&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar -cf dev.tar ./dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
5 - Install initscripts package (forced and with no deps)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/initscripts-8.45.14.EL-1.el5.centos.1.i386.rpm --force --nodeps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6 - Exit from container&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
7 - In /etc/vz/conf/CSID.conf replace&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OSTEMPLATE=&amp;quot;centos-4-i386-minimal&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OSTEMPLATE=&amp;quot;centos-5-i386-minimal&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
8 - Coppy existing template from&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/vz/template/centos/4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/vz/template/centos/5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
9 - In /vz/template/centos/4/i386/config/yum.conf change mirrors to CentOS 5&lt;br /&gt;
&lt;br /&gt;
10 - Upgrade container packages using vzyum (32bit only)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzyum CTID upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: on 64-bit yum db-version might complain. Do &amp;quot;rm /vz/root/VZNUM/var/lib/rpm/__*&amp;quot; to delete conflicting DB.&lt;br /&gt;
&lt;br /&gt;
11 - Stop your VE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop CTID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
12 - Replace the new /dev/ with the old one&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/CTID&lt;br /&gt;
rm -rf dev&lt;br /&gt;
tar -xvf dev.tar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
13 - Leave the container private dir (or it will not stard)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
14 - Start the container&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start CTID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
15 - Remove container IP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set --ipdel container_IP&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
16 - Stop container&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop CTID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
17 - Create the template&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/CTID&lt;br /&gt;
tar -zcf /vz/template/cache/centos-5.0-i386-minimal.tar.gz .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Baranek</name></author>
		
	</entry>
</feed>