<?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=Scythe</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=Scythe"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Scythe"/>
	<updated>2026-05-02T20:57:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1514</id>
		<title>Talk:Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1514"/>
		<updated>2006-06-07T09:27:30Z</updated>

		<summary type="html">&lt;p&gt;Scythe: Some formatting in my last reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== klogd ==&lt;br /&gt;
I have added a note that klogd is needed sometimes. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== VE IP ==&lt;br /&gt;
Actually, since you do not run anything inside the temporary VE (777) which requires an IP address, you can omit the step of setting VE's OSTEMPLATE, an IP address and a hostname. This was done for Debian specifically because you have to run &amp;lt;tt&amp;gt;apt update&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;apt upgrade&amp;lt;/tt&amp;gt; commands, which requires network to be working. So you can edit that out to simplify things. I have not done it yet because you might have other reasons to leave it. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
: I have actually removed these settings from the text, since it looks like they are not needed, and you forgot to run &amp;lt;tt&amp;gt;vzctl set --ipdel&amp;lt;/tt&amp;gt; so OS template cache ends up with the IP address which is wrong. So I followed the easy path and instead of adding the procedure of removing VE IP I just removed the adding of it! Also note that setting OSTEMPLATE is actually needed for &amp;lt;tt&amp;gt;vzctl set --ipadd&amp;lt;/tt&amp;gt; to work. --[[User:Kir|Kir]] 16:15, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Typo + IPtables ==&lt;br /&gt;
I corrected a typo.&lt;br /&gt;
Also, I forgot to mention that IPtables needs modules from the running kernel in the VE to work, so&lt;br /&gt;
before cache creation or after VE creation the /lib/modules should be created with the needed iptables modules. --[[User:Scythe|Scythe]] 22:54, 6 June 2006 (CET)&lt;br /&gt;
: There is actually no need for iptables modules to be available inside VE for iptables to work, so you got it wrong. I have reverted your last change. No kernel modules are loaded inside VE at all -- so you do not need modutils as well. Also, can you please specify the summary then you are making a change? Otherwise it's not clear from the history page what have changed. It makes sense to select an option &amp;quot;Prompt me when entering a blank edit summary&amp;quot; in your preferences-&amp;gt;editing. --[[User:Kir|Kir]] 05:05, 7 June 2006 (EDT)&lt;br /&gt;
:: You are right, I accidentally mixed the openvz.org &amp;quot;official&amp;quot; template cache's root filesystem with my host's own, so I mislooked the /lib/modules directory... I also corrected the typo again (a missing &amp;quot;)&amp;quot; in the &amp;quot;Moving a Sl. installation into a VE&amp;quot; part) which You have included again when reverting my erroneous notice about iptables modules. --[[User:Scythe|Scythe]] 11:26, 7 June 2006 (CET)&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1513</id>
		<title>Talk:Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1513"/>
		<updated>2006-06-07T09:26:46Z</updated>

		<summary type="html">&lt;p&gt;Scythe: Reply to Kir&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== klogd ==&lt;br /&gt;
I have added a note that klogd is needed sometimes. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== VE IP ==&lt;br /&gt;
Actually, since you do not run anything inside the temporary VE (777) which requires an IP address, you can omit the step of setting VE's OSTEMPLATE, an IP address and a hostname. This was done for Debian specifically because you have to run &amp;lt;tt&amp;gt;apt update&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;apt upgrade&amp;lt;/tt&amp;gt; commands, which requires network to be working. So you can edit that out to simplify things. I have not done it yet because you might have other reasons to leave it. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
: I have actually removed these settings from the text, since it looks like they are not needed, and you forgot to run &amp;lt;tt&amp;gt;vzctl set --ipdel&amp;lt;/tt&amp;gt; so OS template cache ends up with the IP address which is wrong. So I followed the easy path and instead of adding the procedure of removing VE IP I just removed the adding of it! Also note that setting OSTEMPLATE is actually needed for &amp;lt;tt&amp;gt;vzctl set --ipadd&amp;lt;/tt&amp;gt; to work. --[[User:Kir|Kir]] 16:15, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Typo + IPtables ==&lt;br /&gt;
I corrected a typo.&lt;br /&gt;
Also, I forgot to mention that IPtables needs modules from the running kernel in the VE to work, so&lt;br /&gt;
before cache creation or after VE creation the /lib/modules should be created with the needed iptables modules. --[[User:Scythe|Scythe]] 22:54, 6 June 2006 (CET)&lt;br /&gt;
: There is actually no need for iptables modules to be available inside VE for iptables to work, so you got it wrong. I have reverted your last change. No kernel modules are loaded inside VE at all -- so you do not need modutils as well. Also, can you please specify the summary then you are making a change? Otherwise it's not clear from the history page what have changed. It makes sense to select an option &amp;quot;Prompt me when entering a blank edit summary&amp;quot; in your preferences-&amp;gt;editing. --[[User:Kir|Kir]] 05:05, 7 June 2006 (EDT)&lt;br /&gt;
:: You are right, I accidentally mixed the openvz.org &amp;quot;official&amp;quot; template cache's root filesystem with my host's own, so I mislooked the /lib/modules directory...&lt;br /&gt;
I also corrected the typo again (a missing &amp;quot;)&amp;quot; in the &amp;quot;Moving a Sl. installation into a VE&amp;quot; part) which You have included again when reverting my erroneous notice about iptables modules. --[[User:Scythe|Scythe]] 11:26, 7 June 2006 (CET)&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1512</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1512"/>
		<updated>2006-06-07T09:20:33Z</updated>

		<summary type="html">&lt;p&gt;Scythe: Corrected typo: missing &amp;quot;)&amp;quot; in Movings Sl. installation into a VE part&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ '''List of additional packages'''&lt;br /&gt;
! Package !! Directory of installation media to take the package from&lt;br /&gt;
|-&lt;br /&gt;
| groff-1.19.1-i486-3.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| man-1.5p-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| quota-3.12-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| iptables-1.3.3-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| openssh-4.2p1-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| tcpip-0.17-i486-35.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| whois-4.6.16-i486-1.tgz || slackware/n&lt;br /&gt;
|}&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]].&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt;) or manually remove the hard drive containing the Slackware installation and copy the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into &amp;lt;tt&amp;gt;/vz/private&amp;lt;/tt&amp;gt; with a new VEID, ''for example'' 777.&lt;br /&gt;
Uncompress the tgz file into this directory and remove the tgz.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating VE config ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the configuration file for the [[VE]], 777.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mounts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/shadow ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/shadow&amp;lt;/tt&amp;gt;, change root's password in the first line to an exclamation mark (&amp;lt;tt&amp;gt;!&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;tt&amp;gt;vzctl set VEID --userpasswd root:xxx&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.S&amp;lt;/tt&amp;gt;, putting a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) as the first character of the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.syslog&amp;lt;/tt&amp;gt; file, put a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt; (which is usually not needed) from starting at boot time.&lt;br /&gt;
&lt;br /&gt;
{{Note|if you are going to use iptables rules inside your Slackware VEs which will do logging (i.e. the ones with the &amp;lt;tt&amp;gt;LOG&amp;lt;/tt&amp;gt; target), you should not disable &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everything all right (and this article is correct) your new Slackware [[VE]] will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh to it, then stop it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1509</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1509"/>
		<updated>2006-06-06T20:58:33Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ '''List of additional packages'''&lt;br /&gt;
! Package !! Directory of installation media to take the package from&lt;br /&gt;
|-&lt;br /&gt;
| groff-1.19.1-i486-3.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| man-1.5p-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| quota-3.12-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| iptables-1.3.3-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| openssh-4.2p1-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| tcpip-0.17-i486-35.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| whois-4.6.16-i486-1.tgz || slackware/n&lt;br /&gt;
|}&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]].&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt;) or manually remove the hard drive containing the Slackware installation and copy the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into &amp;lt;tt&amp;gt;/vz/private&amp;lt;/tt&amp;gt; with a new VEID, ''for example'' 777.&lt;br /&gt;
Uncompress the tgz file into this directory and remove the tgz.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating VE config ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the configuration file for the [[VE]], 777.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mounts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/shadow ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/shadow&amp;lt;/tt&amp;gt;, change root's password in the first line to an exclamation mark (&amp;lt;tt&amp;gt;!&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;tt&amp;gt;vzctl set VEID --userpasswd root:xxx&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.S&amp;lt;/tt&amp;gt;, putting a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) as the first character of the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.syslog&amp;lt;/tt&amp;gt; file, put a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt; (which is usually not needed) from starting at boot time.&lt;br /&gt;
&lt;br /&gt;
{{Note|if you are going to use iptables rules inside your Slackware VEs which will do logging (i.e. the ones with the &amp;lt;tt&amp;gt;LOG&amp;lt;/tt&amp;gt; target), you should not disable &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everything all right (and this article is correct) your new Slackware [[VE]] will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh to it, then stop it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
== Notice: IPtables ==&lt;br /&gt;
If you need to use IPtables &amp;lt;u&amp;gt;inside&amp;lt;/u&amp;gt; the VE, you will have to copy the IPtables modules of your running kernel into the VE (/lib/modules directory).&lt;br /&gt;
This can be automatized, but every VE needs to be updated when the kernel changes.&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1508</id>
		<title>Talk:Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Slackware_template_creation&amp;diff=1508"/>
		<updated>2006-06-06T20:54:52Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== klogd ==&lt;br /&gt;
I have added a note that klogd is needed sometimes. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== VE IP ==&lt;br /&gt;
Actually, since you do not run anything inside the temporary VE (777) which requires an IP address, you can omit the step of setting VE's OSTEMPLATE, an IP address and a hostname. This was done for Debian specifically because you have to run &amp;lt;tt&amp;gt;apt update&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;apt upgrade&amp;lt;/tt&amp;gt; commands, which requires network to be working. So you can edit that out to simplify things. I have not done it yet because you might have other reasons to leave it. --[[User:Kir|Kir]] 15:43, 6 June 2006 (EDT)&lt;br /&gt;
: I have actually removed these settings from the text, since it looks like they are not needed, and you forgot to run &amp;lt;tt&amp;gt;vzctl set --ipdel&amp;lt;/tt&amp;gt; so OS template cache ends up with the IP address which is wrong. So I followed the easy path and instead of adding the procedure of removing VE IP I just removed the adding of it! Also note that setting OSTEMPLATE is actually needed for &amp;lt;tt&amp;gt;vzctl set --ipadd&amp;lt;/tt&amp;gt; to work. --[[User:Kir|Kir]] 16:15, 6 June 2006 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Typo + IPtables ==&lt;br /&gt;
I corrected a typo.&lt;br /&gt;
Also, I forgot to mention that IPtables needs modules from the running kernel in the VE to work, so&lt;br /&gt;
before cache creation or after VE creation the /lib/modules should be created with the needed iptables modules. --[[User:Scythe|Scythe]] 22:54, 6 June 2006 (CET)&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1507</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1507"/>
		<updated>2006-06-06T20:48:13Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ '''List of additional packages'''&lt;br /&gt;
! Package !! Directory of installation media to take the package from&lt;br /&gt;
|-&lt;br /&gt;
| groff-1.19.1-i486-3.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| man-1.5p-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| quota-3.12-i486-1.tgz || slackware/ap&lt;br /&gt;
|-&lt;br /&gt;
| iptables-1.3.3-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| openssh-4.2p1-i486-1.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| tcpip-0.17-i486-35.tgz || slackware/n&lt;br /&gt;
|-&lt;br /&gt;
| whois-4.6.16-i486-1.tgz || slackware/n&lt;br /&gt;
|}&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]].&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt;) or manually remove the hard drive containing the Slackware installation and copy the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into &amp;lt;tt&amp;gt;/vz/private&amp;lt;/tt&amp;gt; with a new VEID, ''for example'' 777.&lt;br /&gt;
Uncompress the tgz file into this directory and remove the tgz.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating VE config ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the configuration file for the [[VE]], 777.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mounts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/shadow ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/shadow&amp;lt;/tt&amp;gt;, change root's password in the first line to an exclamation mark (&amp;lt;tt&amp;gt;!&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;tt&amp;gt;vzctl set VEID --userpasswd root:xxx&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.S&amp;lt;/tt&amp;gt;, putting a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) as the first character of the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;tt&amp;gt;/vz/private/777/etc/rc.d/rc.syslog&amp;lt;/tt&amp;gt; file, put a hashmark (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt; (which is usually not needed) from starting at boot time.&lt;br /&gt;
&lt;br /&gt;
{{Note|if you are going to use iptables rules inside your Slackware VEs which will do logging (i.e. the ones with the &amp;lt;tt&amp;gt;LOG&amp;lt;/tt&amp;gt; target), you should not disable &amp;lt;tt&amp;gt;klogd&amp;lt;/tt&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everything all right (and this article is correct) your new Slackware [[VE]] will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh to it, then stop it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1490</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1490"/>
		<updated>2006-06-06T19:16:06Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
* groff-1.19.1-i486-3.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* man-1.5p-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* quota-3.12-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* iptables-1.3.3-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* openssh-4.2p1-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* tcpip-0.17-i486-35.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* whois-4.6.16-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]]&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt; or manually remove the hard drive containing the Slackware installation and copying the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into /vz/private with a new VPSID, for &amp;lt;b&amp;gt;example&amp;lt;/b&amp;gt; 777.&lt;br /&gt;
Uncompress the tgz file into this directory and delete it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a new .conf file ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the config file for the Slackware [[VE]], 777.conf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set it's OSTEMPLATE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;OSTEMPLATE=slackware-10.2-i486-minimal&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/vz-scripts/777.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And an IP address and a Hostname&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
vzctl set 777 --hostname myslacky --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mouns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/shadow ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/shadow, change root's password in the first line to an exclamation mark (!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password chaned with &amp;quot;vzctl set VPSID --userpasswd root:xxx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.S, put a hashmark (#) before the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.syslog, put a hashmark (#) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent klogd (which is not needed) from starting at boottime.&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everythingall right (and I didn't make a mistake here) your new slackware will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh in it, then stop it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1489</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1489"/>
		<updated>2006-06-06T19:14:57Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
* groff-1.19.1-i486-3.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* man-1.5p-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* quota-3.12-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* iptables-1.3.3-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* openssh-4.2p1-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* tcpip-0.17-i486-35.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* whois-4.6.16-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]]&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt; or manually remove the hard drive containing the Slackware installation and copying the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into /vz/private with a new VPSID, for &amp;lt;b&amp;gt;example&amp;lt;/b&amp;gt; 777.&lt;br /&gt;
Uncompress the tgz file into this directory and delete it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a new .conf file ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the config file for the Slackware [[VE]], 777.conf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set it's OSTEMPLATE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;OSTEMPLATE=slackware-10.2-i486-minimal&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/vz-scripts/777.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And an IP address and a Hostname&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
vzctl set 777 --hostname myslacky --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mouns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/shadow ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/shadow, change root's password in the first line to an exclamation mark (!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password chaned with &amp;quot;vzctl set VPSID --userpasswd root:xxx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.S, put a hashmark (#) before the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.syslog, put a hashmark (#) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent klogd (which is not needed) from starting at boottime.&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everythingall right (and I didn't make a mistake here) your new slackware will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh in it, then stop it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1488</id>
		<title>Slackware template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1488"/>
		<updated>2006-06-06T19:08:25Z</updated>

		<summary type="html">&lt;p&gt;Scythe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ [[VE]] from Slackware linux.&lt;br /&gt;
(This method was used for creating the minimal cache from Slackware 10.2)&lt;br /&gt;
The method is basically the same as described in article [[Debian template creation]].&lt;br /&gt;
&lt;br /&gt;
== Getting a Slackware root filesystem ==&lt;br /&gt;
&lt;br /&gt;
=== Downloading and installing Slackware ===&lt;br /&gt;
&lt;br /&gt;
First you need to download Slackware linux from [http://www.slackware.org/getslack/ http://www.slackware.org/getslack/]. Then you have to [http://www.slackware.org/install/ install] it to some hardware you can spare while the cache creation process is going on. For [[VE]] creation it is recommended not to install any unnecessary software into the box you are making the cache from.&lt;br /&gt;
This means for a minimal Slackware 10.2 cache I have chosen only series A (&amp;lt;tt&amp;gt;Base Linux System&amp;lt;/tt&amp;gt;) at the package series selection screen of Slackware Setup. Then '''expert''' prompting mode on the next screen. On the Series A package selection screen I chose the following packages:&lt;br /&gt;
&lt;br /&gt;
* kernel-ide &amp;lt;i&amp;gt;- This is requied to boot the OS to be able to get it's root filesystem&amp;lt;/i&amp;gt;&lt;br /&gt;
* aaa_base&lt;br /&gt;
* aaa_elflibs&lt;br /&gt;
* bash&lt;br /&gt;
* bin&lt;br /&gt;
* bzip2&lt;br /&gt;
* coreutils&lt;br /&gt;
* cxxlibs&lt;br /&gt;
* dcron&lt;br /&gt;
* devs&lt;br /&gt;
* e2fsprogs &amp;lt;i&amp;gt;- This is not really needed for a VE, but let him install it&amp;lt;/i&amp;gt;&lt;br /&gt;
* elvis&lt;br /&gt;
* etc&lt;br /&gt;
* gawk&lt;br /&gt;
* glibc-solibs&lt;br /&gt;
* grep&lt;br /&gt;
* gzip&lt;br /&gt;
* kernel-modules &amp;lt;i&amp;gt;- This is needed for the first boot only as kernel-ide&amp;lt;/i&amp;gt;&lt;br /&gt;
* less&lt;br /&gt;
* lilo &amp;lt;i&amp;gt;- For first boot only too&amp;lt;/i&amp;gt;&lt;br /&gt;
* logrotate&lt;br /&gt;
* module-init-tools&lt;br /&gt;
* openssl-solibs&lt;br /&gt;
* pkgtools&lt;br /&gt;
* procps&lt;br /&gt;
* sed&lt;br /&gt;
* shadow&lt;br /&gt;
* sysklogd&lt;br /&gt;
* sysvinit&lt;br /&gt;
* tar&lt;br /&gt;
* udev&lt;br /&gt;
* util-linux&lt;br /&gt;
&lt;br /&gt;
After selecting these packages just install the kernel and lilo, you are ready to run Slackware!&lt;br /&gt;
&lt;br /&gt;
=== Configuring Slackware for acting as a VE ===&lt;br /&gt;
&lt;br /&gt;
Now that you have a running minimal Slackware installation, You can begin to prepare it to be&lt;br /&gt;
a template for a [[VE]]. First you need some additional packages, 7 exactly:&lt;br /&gt;
&lt;br /&gt;
* groff-1.19.1-i486-3.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* man-1.5p-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* quota-3.12-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/ap directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* iptables-1.3.3-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* openssh-4.2p1-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* tcpip-0.17-i486-35.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
* whois-4.6.16-i486-1.tgz &amp;lt;i&amp;gt;from the slackware/n directory of installation media&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can install these packages issuing the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# installpkg &amp;lt;packagename&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these steps, you are ready to move your Slackware installation into a [[VE]]&lt;br /&gt;
&lt;br /&gt;
=== Moving a Slackware installation into a VE ===&lt;br /&gt;
&lt;br /&gt;
I did it by compressing the whole filesystem into a tgz file and copying it to the host running OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Compressing it is easy:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# tar czf /slackware.tgz /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But to copy it, you need to setup a network device on the slackware system (use &amp;lt;tt&amp;gt;ifconfig&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ftp&amp;lt;/tt&amp;gt; or manually remove the hard drive containing the Slackware installation and copying the tgz file from there.&lt;br /&gt;
&lt;br /&gt;
After you got the tgz file on the host, make a new directory into /vz/private with a new VPSID, for example 777.&lt;br /&gt;
Uncompress the tgz file into this directory and delete it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv slackware.tgz /vz/private/777&lt;br /&gt;
cd /vz/private/777&lt;br /&gt;
gunzip -dc slackware.tgz |tar -xvf -&lt;br /&gt;
rm /vz/private/777/slackware.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparing the new VE ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a new .conf file ===&lt;br /&gt;
&lt;br /&gt;
Now you need to create the config file for the Slackware [[VE]], 777.conf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set it's OSTEMPLATE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;OSTEMPLATE=slackware-10.2-i486-minimal&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/vz-scripts/777.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And an IP address and a Hostname&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
vzctl set 777 --hostname myslacky --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting the filesystem ready to run in a VE ===&lt;br /&gt;
&lt;br /&gt;
Now you need to make some minor alterations under the /vz/private/777 directory.&lt;br /&gt;
&lt;br /&gt;
==== Delete the directory /lost+found, clean /boot, /tmp, and /var/mail and make /proc ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lost+found&lt;br /&gt;
rm /vz/private/777/boot/*&lt;br /&gt;
rm /vz/private/777/tmp/*&lt;br /&gt;
rm /vz/private/777/var/mail/*&lt;br /&gt;
mkdir /vz/private/777/proc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete the kernel modules from /lib/modules ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -r /vz/private/777/lib/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Make a home directory for root, readable only by him ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777/root&lt;br /&gt;
chmod 0700 /vz/private/777/root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Delete all keys from /vz/private/777/etc/ssh ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/ssh/*key*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will ensure that a unique ssh key is generated for every single [[VE]] at the first boot.&lt;br /&gt;
Edit ssh_config and sshd_config here if you want.&lt;br /&gt;
&lt;br /&gt;
==== Delete the file /etc/mtab and make it a symlink to /proc/mounts. ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/mtab&lt;br /&gt;
ln -s /vz/private/777/etc/mtab /proc/mouns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Clean the /etc/fstab file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Edit /vz/private/777/etc/inittab ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/inittab, put a hashmark (#) before the lines containing ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
c?:1235:respawn:/sbin/agetty 38400 tty? linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will prevent linux gettys to spawn.&lt;br /&gt;
&lt;br /&gt;
==== Edit /vz/private/777/etc/shadow====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/shadow, change root's password in the first line to an exclamation mark (!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#root:!:13305:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will disable the root login until the password chaned with &amp;quot;vzctl set VPSID --userpasswd root:xxx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Edit /vz/private/777/etc/rc.d/rc.S ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.S, put a hashmark (#) before the line containing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/bin/rm -f /etc/mtab*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should be line 162. This will forbid Slackware to delete our symlink at every reboot.&lt;br /&gt;
&lt;br /&gt;
==== Edit /vz/private/777/etc/rc.d/rc.syslog ====&lt;br /&gt;
&lt;br /&gt;
Edit /vz/private/777/etc/rc.d/rc.syslog, put a hashmark (#) before the lines containing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 1&lt;br /&gt;
echo &amp;quot;/usr/bin/klogd -c 3 -x&amp;quot;&lt;br /&gt;
/usr/bin/klogd -c 3 -x&lt;br /&gt;
killall klogd 2&amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These should be lines 11, 12, 15 and 21. This will prevent klogd (which is not needed) from starting at boottime.&lt;br /&gt;
&lt;br /&gt;
== Testing the new VE and making a cache file ==&lt;br /&gt;
&lt;br /&gt;
=== Testing the new VE ===&lt;br /&gt;
&lt;br /&gt;
To test the new [[VE]], simply start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you did everythingall right (and I didn't make a mistake here) your new slackware will boot.&lt;br /&gt;
&lt;br /&gt;
If the VE booted, and you can enter/ssh in it, then stop it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl stop 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Making a cache file ===&lt;br /&gt;
&lt;br /&gt;
Now make a .tar.gz out of the [[VE]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar czf /vz/template/cache/slackware-10.2-i486-minimal.tar.gz /vz/private/777/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the new cache file ==&lt;br /&gt;
&lt;br /&gt;
To test the the new cache file, issue:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 555 --ostemplate slackware-10.2-i486-minimal --ipadd x.x.x.x --hostname testy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 555&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working slackware template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Scythe</name></author>
		
	</entry>
</feed>