Changes

Jump to: navigation, search

Creating a CentOS 5.0 Template

17,978 bytes removed, 18:52, 25 April 2008
Update formating
{{wikify}}
<ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Install # Install a system (virtual or physical) with the default CentOS installation that you wish to package. This could be a system (virtual minimal distro or physical) with the default <span class=SpellE>CentOS</span> installationdistro or even something custom. that # Once the OS has been installed, you wish need to package.<span style='mso-spacerun:yes'> </span>This could be 'tar''' the contents of the OS.## First, create a minimal <span class=SpellE>distro<file called '''/span> or the default <span class=SpellE>distro<tmp/span> or even something custom.</span></li> <li class=MsoNormal style=exclude'''mso-listand add the following lines to it:l0 level1 lfo1;tab-stops#:list .5in'><spanbash_history style='font-size#:10.0pt;font-family lost+found#:Tahoma'>Once the OS has been /dev/* installed, you need to <b style='mso-bidi-font-weight#:normal'>tar< /b> the contents of the OS.<mnt/*#: /span><tmp/li>*#: <ol style='margin-top/proc/*#:0in' start=1 type=a> /sys/* <li class=MsoNormal style='mso-list#:l0 level2 lfo1;tab-stops /usr/src/*## Now, tar the OS file up by typing:list 1.0in'><span style='font-size:10'tar –czvf /tmp/centos-5.0pt;font0-family:Tahoma'<ARCH>First, create a file called -<b style='msoDISTRO>-bidi-font-weightimage.tar.gz / –X #:normal'>/<span class=SpellE>tmp</span>tmp/exclude ''' where </b'''ARCH'''>and add represents the following lines to it:</span></li>system architecture ('''i386''' or </ol></ol> <p class=MsoNormal style='margin-left:.75in;text-indent#:-.25in'><spanstyle='font-size:10.0pt;font-family:"Courier New"'>&nbsp;x86_64''') and </span></p> <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><spanstyle='font-size:10.0pt;font-family:"Courier New"DISTRO'''>represents the distribution (default, minimal, etc.<span class=SpellE>bash_history</span></span></p> <p class=MsoNormal style='margin-left:1.25in;text-indent:-).25in'><spanclass=SpellE><span style=## Now transfer the file over to the OpenVZ server into ''font-size:10.0pt;font-family:"Courier New"'>lost+found</span><vz/template/span><spanstyle=cache'''font-size:10folder.0pt;font-family:"Courier New"# On the OpenVZ server create a “dummy” container by creating a folder called '''></span><vz/private/p>50'''  <p class=MsoNormal style=#: and copying the '''margin/etc/vz/conf/ve-left:1vps.basic.25in;textconf-indent:-.25insample''' to '><spanstyle='font-size:10.0pt;font-family:"Courier New"'>/devetc/*<vz/span><conf/p> <p class=MsoNormal style=50.conf'''margin-left:1.25in;text-indent#:-.25in'><spanstyle='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>mnt</span>/*</span></p> <p class=MsoNormal style=NOTE'''margin-left:150 is the CTID for the container.25in;text-indent:-.25inYou can choose any unused CTID on the OpenVZ server.# Now create a new folder called '><spanstyle='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>tmp<vz/span>template/*<centos/5.0/span><ARCH>/p>config''' again where #: <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in'><spanstyle='font-size:10.0pt;font-family:"Courier New"ARCH'''>/proc/*</span></p>represents the system architecture.# Create a file in the folder called rpm and add the following line:<p class=MsoNormal style='margin-left#:1.25in;text-indent:- 43# Create a file called '''yum.25inconf''><spanstyle='font-sizein the folder and add the following lines:10.0pt;font-family#:"Courier New"'>/sys [main]#: #: cachedir=/vz/template/centos/5.0/*<ARCH>/span><yum-cache/p>#: <p class#: reposdir=MsoNormal style/dev/null#: #: installonlypkgs='margin-left#:1.25in;text-indent #: [centos5-.25in'><spanbase]style#: name='fontCentOS 5 -size<ARCH> - Base#: #:10.0pt;font-family baseurl=http:"Courier New"'>/<span class=SpellE>usr/src<mirror.centos.org/span>centos/*<5/span><os/p<ARCH>/#: <p class#: enabled=MsoNormal style1#: #: gpgcheck='margin-left1#:.75in;text-indent #: [centos5-.25in'><spanstyle='fontupdates-sizereleased]#: #:10.0pt;font name=CentOS 5 -family:Tahoma'>&nbsp;</span></pARCH>- Released Updates#: <ol style#: baseurl='margin-tophttp:0in' start=2 type=1//mirror.centos.org/centos/5/updates/<ARCH>/#: <ol style='margin-top#:0in' start enabled=2 type1#: #: gpgcheck=a>1 <li class=MsoNormal style=# Copy 'mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font/etc/vz/dists/centos-size:104.0pt;font-family:Tahomaconf''' to '>Now, <b style='mso-bidi-font-weight: normal'>tar </b>the OS file up by typing:<etc/span><vz/li> <dists/ol></ol> <p class=MsoNormal style='margincentos-left:5.75in;text-indent:-0.25inconf'><span''.style=# Change to the ''font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><vz/private/p> <p class=MsoNormal style=50''' folder and then run the command 'margin-left:1.0in'><span style='fontgunzip –dc /vz/template/cache/centos-size:105.0pt;font0-family:"Courier New"'>tar –<span class=SpellEARCH>czvf-</spanDISTRO>/tmp/centos-5.0-&lt;ARCH&gt;-&lt;DISTRO&gt;-<span class=SpellE>image.tar.gz</span>/ –X<span style=| tar –xvf''' – to unpack the base image to the folder.# Make sure you are in the ''mso-spacerun:yes'> </span>vz/<span class=SpellE>tmp<private/span>/exclude</span></p> <p class=MsoNormal style=50'''margin-left:folder.75in;text-indent:-.25in'><spanstyle=# Edit 'font-size:10.0pt;font-family:"Courier New"'><span style='mso-tab-count:2etc/shadow''> </span></span></p> <p class=MsoNormal style='margin-left:1.0inand remove the replace the '><span style='font-size:10.0pt;font-family:Tahoma'>where <b style=root''mso-bidi-font-weight:normal'>&lt;ARCH&gt;</b>password with !! instead of the hashed value.represents # Edit the system architecture (<b style='mso-bidi-font-weight:normal'>i386<'etc/b>or <b style=inittab''mso-bidi-font-weight:normal'>x86_64</b>) file and <b style=comment out the lines that respawn ''mso-bidi-font-weight:normal'>&lt;DISTRO&gt;</b> represents the distribution (<b style=sbin/mingetty''' on '''mso-bidi-font-weight:normaltty1''' through '''tty6'>default</b>, <b style='mso-bidi-font-weight:normal'>minimal</b>, etc.)Just put a # at the beginning of the line.</span></p> <ol style=# Remove the ''margin-top:0in' start=2 type=1> <ol style=etc/mtab''margin-top:0in' start=3 type=file and then create a> <li class=MsoNormal style=symbolic link by typing '''ln –s /proc/mounts etc/mtab'mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>Now transfer the file over to # Remove all of the <span class=SpellE>OpenVZ<lines from '''etc/span> server into <b style=fstab''' except for the line that mounts ''mso-bidi-font-weight: normal'>/<span class=SpellE>vz<dev/span>/templatepts'''.# Edit '''etc/cache <rc.d/b>folderrc.<sysinit''' and comment out the line that starts '''/span><sbin/li> </ol> <li class=MsoNormal style=start_udev'''mso-list:l0 level1 lfo1;tab-stops:list by placing a # at the beginning of the line.5in'><span style='font-size# Now create device nodes by typing:10.0pt;font-family#:Tahoma'>On the <span class=SpellE>OpenVZ< mknod dev/span>ptmx c 5 2 server create a “dummy” container by creating a folder called <b#: mkdir dev/pts style='mso-bidi-font-weight#:normal'> /sbin/MAKEDEV –d /vz/private/50</b> and copying the <bdev ttyp ptyp style='mso-bidi-font-weight#:normal'> mknod dev/<span class=SpellE>etcnull c 1 3#: mknod dev/vzurandom c 1 9# Create the '''var/conflock/ve-vpsrpm''' folder.basic.conf-sample</span></b> to <b style=# If you wish to disable IPv6, do the following:## Edit ''mso-bidi-font-weight:normal'>/etc/vzsysconfig/conf/50.conf</b>.</span></li></ol> <p class=MsoNormal style=network''' and set '''margin-left:.25inNETWORKING_IPV6'><span style='font-size:10.0pt;font-family:Tahoma'>&nbsp;</span></p> <p class=MsoNormal style=to ''margin-left:.5in'><b style=no'mso-bidi-font-weight:normal'><span style='font-size:8.0pt;font-family:Tahoma;color:red'>NOTE:<## Add the following lines to '''etc/span><modprobe.d/b></p> <p class=MsoNormal style=blacklist'margin-left:.5in'><b style='mso-bidi-font-weight:normal'><span style='font#: blacklist ipv6#: blacklist net-size:8.0pt;fontpf-family:Tahoma;color:red10# Disable any physical NICs by modifying the '''>50<etc/span><sysconfig/b><spanstyle=network-scripts/ifcfg-ethX''' files (where '''X''font-size:8.0pt;font-family:Tahoma;color:red'> is the CTID for thecontainer. You can choose any unused CTID onthe OpenVZ server.</span></p> <p class=MsoNormal style=interface number starting from '''0''margin-left:.5in'><span style=) and setting 'font-size:8.0pt;font-family:Tahoma'>&nbsp;</span></p> <ol style='margin-top:0inONBOOT'' start=4 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5into '><span style='font-size:10.0pt;font-family:Tahoma'>Now create a new folder called <b style=no''mso-bidi-font-weight:normal'>/vz/template/centos/5.0/&lt;ARCH&gt;/<span class=SpellE>config</span></b> again where <b style=# Now you’re ready to start the template. Type '''vzctl start 50''mso-bidi-font-weight: normal'>&lt;ARCH&gt;</b> represents the system architectureand wait for it to start.</span></li> <li class=MsoNormal style=# You can install additional packages into the container by typing 'mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahomavzyum 50 install <package>'''>Create a file in at the folder called prompt where <b style='mso-bidi-font-weight:normal''package'''>rpm</b> and add represents the name of thesoftware package you wish to install. following line:</span></li># Finally, you should turn off unnecessary services.</ol> <p class=MsoNormal style=## Enter the container by typing ''margin-left:.5in'><span style=vzctl enter 50'font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <p class=MsoNormal style='margin-left:.5in## View the services that are set to run at startup by typing ''><span style='fontchkconfig -size-list | grep 5:10on'''.0pt;font-family:"Courier New"'>43</span></p> <p class=MsoNormal style=## Disable any unwanted service by typing 'margin-left:.5in'><span style='fontchkconfig -size:10.0pt;font-family:"Courier New"'>&nbsp;levels 2345 </spanservice>''' off where </p> <ol style='margin-top:0in' start=6 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5inservice'''><spanrepresents the service to disable. style='font-size#:10Services that you can (and should) turn off without harm are acpid, apmd, kudzu, and microcode_ctl.0pt;font-family:Tahoma# Exit the container by typing '''exit'>Create a file called <span class=SpellE><b style='mso-bidi-font-weight:normal'>yumat the prompt.conf</b></span> in # Stop the folder and add the following lines:</span></li></ol> <p class=MsoNormal style=container by typing '''vzctl stop 50'margin-left:.25in'><span style='font-size:10.0pt;font-family:Tahoma# Finally, package up the new template by typing '>&nbsp;<''tar –czvf /vz/template/span><cache/p> <p class=MsoNormal style='margincentos-left:5.5in'0-<ARCH>-<span style=DISTRO>.tar.gz'font-size:10.0pt;font-family:"Courier New"'>[main]</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>cachedir</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=/vz/template/centos/5.0/&lt;ARCH&gt;/yum-cache/</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>reposdir</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=/dev/null</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>installonlypkgs</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=''</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>[centos5-base]</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - &lt;ARCH&gt;- Base</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/os/&lt;ARCH&gt;/</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>enabled=1</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=1</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>[centos5-updates-released]</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>name=<span class=SpellE>CentOS</span> 5 - &lt;ARCH&gt;- Released Updates</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>baseurl</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=http://mirror.centos.org/centos/5/updates/&lt;ARCH&gt;/</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>enabled=1</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>gpgcheck</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'>=1</span></p> <ol style='margin-top:0in' start=7 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Copy <b style='mso-bidi-font-weight: normal'>/etc/vz/dists/centos-4.conf</b> to <b style='mso-bidi-font-weight: normal'>/etc/vz/dists/centos-5.0.conf</b>.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Change to the <b style='mso-bidi-font-weight:normal'>/vz/private/50</b> folder and then run the command </span><span class=SpellE><span style='font-size:10.0pt; font-family:"Courier New"'>gunzip</span></span><span style='font-size: 10.0pt;font-family:"Courier New"'> –dc /vz/template/cache/centos-5.0-&lt;ARCH&gt;-&lt;DISTRO&gt;-<span class=SpellE>image.tar.gz</span> | tar –<span class=SpellE>xvf</span> –<b style='mso-bidi-font-weight:normal'> </b></span><span style='font-size: 10.0pt;font-family:Tahoma'>to unpack the base image to the folder.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Make sure you are in the <b style='mso-bidi-font-weight:normal'>/vz/private/50</b> folder.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: normal'>etc/shadow</b> and remove the replace the <b style='mso-bidi-font-weight: normal'>root</b> password with <b style='mso-bidi-font-weight:normal'>!!</b> instead of the hashed value.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Edit the <b style='mso-bidi-font-weight: normal'>etc/<span class=SpellE>inittab</span></b> file and comment out the lines that <span class=SpellE>respawn</span> <b style='mso-bidi-font-weight: normal'>/<span class=SpellE>sbin/mingetty</span></b> on <b style='mso-bidi-font-weight:normal'>tty1</b> through <b style='mso-bidi-font-weight: normal'>tty6</b>.<span style='mso-spacerun:yes'> </span>Just put a <b style='mso-bidi-font-weight:normal'>#</b> at the beginning of the line.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Remove the <b style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>mtab</span></b> file and then create a symbolic link by typing </span><span class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>ln</span></span><span style='font-size:10.0pt;font-family:"Courier New"'> –s /proc/mounts etc/<span class=SpellE>mtab</span></span><span style='font-size:10.0pt;font-family: Tahoma'>.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Remove all of the lines from <b style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>fstab</span></b> except for the line that mounts <b style='mso-bidi-font-weight:normal'>/dev/pts</b>.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: normal'>etc/<span class=SpellE>rc.d/rc.sysinit</span></b> and comment out the line that starts <b style='mso-bidi-font-weight:normal'>/<span class=SpellE>sbin/start_udev</span></b> by placing a <b style='mso-bidi-font-weight: normal'>#</b> at the beginning of the line.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Now create device nodes by typing:</span></li></ol> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>ptmx</span>c 5 2</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>mkdir</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'> dev/pts</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>/<span class=SpellE>sbin</span>/MAKEDEV –d/vz/private/50/dev <span class=SpellE>ttyp</span> <span class=SpellE>ptyp</span></span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'> dev/null c 1 3</span></p> <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><spanstyle='font-size:10.0pt;font-family:"Courier New"'>mknod</span></span><spanstyle='font-size:10.0pt;font-family:"Courier New"'> dev/<span class=SpellE>urandom</span>c 1 9</span></p> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <ol style='margin-top:0in' start=16 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Create the <span class=SpellE><b style='mso-bidi-font-weight:normal'>var</b></span><b style='mso-bidi-font-weight: normal'>/lock/rpm</b> folder.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>If you wish to disable IPv6, do the following:</span></li> <ol style='margin-top:0in' start=1 type=a> <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>Edit <b style='mso-bidi-font-weight: normal'>etc/<span class=SpellE>sysconfig</span>/network</b> and set <b style='mso-bidi-font-weight:normal'>NETWORKING_IPV6</b> to <b style='mso-bidi-font-weight:normal'>no</b>.</span></li> <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>Add the following lines to <b style='mso-bidi-font-weight:normal'>etc/<span class=SpellE>modprobe.d</span>/blacklist</b>:</span></li> </ol></ol> <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Courier New"'>blacklist ipv6</span></p> <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Courier New"'>blacklist net-pf-10</span></p> <p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p> <ol style='margin-top:0in' start=18 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Disable any physical <span class=SpellE>NICs</span> by modifying the <span class=SpellE><b style='mso-bidi-font-weight:normal'>etc/sysconfig/network-scripts/ifcfg-ethX</b></span> files (where <b style='mso-bidi-font-weight:normal'>X</b> is the interface number starting from <b style='mso-bidi-font-weight:normal'>0</b>) and setting <b style='mso-bidi-font-weight:normal'>ONBOOT</b> to <b style='mso-bidi-font-weight:normal'>no</b>.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Now you’re ready to start the template.<span style='mso-spacerun:yes'> </span>Type </span><span class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span style='font-size:10.0pt;font-family:"Courier New"'> start 50</span><span style='font-size:10.0pt;font-family:Tahoma'> and wait for it to start.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>You can install additional packages into the container by typing</span><span style='font-size:10.0pt; font-family:"Courier New"'> <span class=SpellE>vzyum</span> 50 install &lt;package&gt;</span><span style='font-size:10.0pt;font-family:Tahoma'> at the prompt where <b style='mso-bidi-font-weight:normal'>&lt;package&gt;</b> represents the name of the software package you wish to install.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Finally, you should turn off unnecessary services.</span></li> <ol style='margin-top:0in' start=1 type=a> <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>Enter the container by typing </span><span class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>vzctl</span></span><span style='font-size:10.0pt;font-family:"Courier New"'> enter 50</span><span style='font-size:10.0pt;font-family:Tahoma'>.</span></li> <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>View the services that are set to run at startup by typing </span><span class=SpellE><span style='font-size:10.0pt;font-family:"Courier New"'>chkconfig</span></span><span style='font-size:10.0pt;font-family:"Courier New"'> --list | <span class=SpellE>grep</span> 5:on</span><span style='font-size:10.0pt; font-family:Tahoma'>.</span></li> <li class=MsoNormal style='mso-list:l0 level2 lfo1;tab-stops:list 1.0in'><span style='font-size:10.0pt;font-family:Tahoma'>Disable any unwanted service by typing </span><span class=SpellE><span style='font-size:10.0pt; font-family:"Courier New"'>chkconfig</span></span><span style='font-size: 10.0pt;font-family:"Courier New"'> --levels 2345 &lt;service&gt; off</span><span style='font-size:10.0pt;font-family:Tahoma'> where <b style='mso-bidi-font-weight: normal'>&lt;service&gt;</b> represents the service to disable.</span></li> </ol></ol> <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Tahoma'>Services that you can (and should) turn off without harmare <span class=SpellE><b style='mso-bidi-font-weight:normal'>acpid</b></span>,<span class=SpellE><b style='mso-bidi-font-weight:normal'>apmd</b></span>, <bstyle='mso-bidi-font-weight:normal'>kudzu</b>, and <span class=SpellE><bstyle='mso-bidi-font-weight:normal'>microcode_ctl</b></span>.</span></p> <ol style='margin-top:0in' start=22 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Exit the container by typing </span><span style='font-size:10.0pt;font-family:"Courier New"'>exit</span><span style='font-size:10.0pt;font-family:Tahoma'> at the prompt.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Stop the container by typing <span class=SpellE>vzctl</span> stop 50.</span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'>Finally, package up the new template by typing </span><span style='font-size:10.0pt;font-family:"Courier New"'>tar –<span class=SpellE>czvf</span> /vz/template/cache/centos-5.0-&lt;ARCH&gt;-&lt;DISTRO&gt;.<span class=SpellE>tar.gz</span> .</span><span style='font-size:10.0pt; font-family:Tahoma'></span></li> <li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;font-family:Tahoma'># The template is ready for use.</span></li></ol>

Navigation menu