<?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=Erickinolik</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=Erickinolik"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Erickinolik"/>
	<updated>2026-06-13T23:27:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1772</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=1772"/>
		<updated>2006-06-21T04:43:38Z</updated>

		<summary type="html">&lt;p&gt;Erickinolik: had the ln options backwards&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 --exclude /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 /proc/mounts /vz/private/777/etc/mtab&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>Erickinolik</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Slackware_template_creation&amp;diff=1771</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=1771"/>
		<updated>2006-06-21T04:41:50Z</updated>

		<summary type="html">&lt;p&gt;Erickinolik: /* Moving a Slackware installation into a VE */&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 --exclude /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>Erickinolik</name></author>
		
	</entry>
</feed>