DRAFT - still in the works[[Category: HOWTO]][[Category: Templates]]
This guide requires that you already have a CentOS 6 (Having 5 might also work) - If you do not have CentOS 6 installed, do it in KVM or VirtualBox or whatever you wanteven use an already existing CentOS 6 container.
At a CentOS 6 host as root do:
yum install yum-utils yumdownloader centos-release mkdir -p /newroot/var/lib touch /newroot/var/lib/random-seed #without it, the initscript installation script will fail rpm --rebuilddb --root=/newroot rpm -i --root=/newroot --nodeps centos-release-6-5.el6.centos.11.2.x86_64.rpm yum --installroot=/newroot install -y rootfiles openssh-clients openssh-server yum yum-utils man wget sudo tar passwd yum --installroot=/newroot clean all ln -s /proc/mounts /newroot/etc/mtab rm -f /newroot/dev/null mknod -m 600 /newroot/dev/console c 5 1
mkdir -p Create /newroot/var/libetc/fstab that looks like this:touch none /newrootdev/varpts devpts rw,gid=5,mode=620 0 0 none /libdev/random-seed #without it, the initscript installation script will failshm tmpfs defaults 0 0
rpm --rebuilddb --root=Edit /newroot/etc/sysconfig/initChange the line rpm -i --root ACTIVE_CONSOLES=/newroot --nodeps centos-releasedev/tty[1-6-3.el6.centos.9.x86_64.rpm]to yum --installroot ACTIVE_CONSOLES=/newroot install -y openssh-clients openssh-server yum yum-utils man wget sudo tar passwd # if you want a extremely minimal installation only install yum
yum --installroot=/newroot clean all # not sure Change timezone (if that is really needed)
rm /newroot/etc/localtime <br /> ln -s /procusr/share/zoneinfo/Your/mounts Timezone /newroot/etc/mtablocaltime
The only thing missing is to create a tarball of our new root. tar zcf /newrootvz/etctemplate/fstab should look like this: none cache/devcentos-6-x86_64.tar.gz -C /pts devpts rw,gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0newroot .
rm -f You probably want to get rid of /newroot<br /dev/null> mknod rm -m 600 rf /newroot/dev/console c 5 1
#if And you want (not sure about this. If they are there, mingettys will run. On the other hand, if you upgrade your CentOS VPS in OpenVZ they would probably be recreated) rm /newroot/etc/init/start-ttys.conf /newroot/etc/init/tty.conf tar zcf /vz/template/cache/centos-6-x86_64.tar.gz .done!