<?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=Djcapelis</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=Djcapelis"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Djcapelis"/>
	<updated>2026-05-14T17:37:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Template:Warning&amp;diff=2799</id>
		<title>Template:Warning</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Template:Warning&amp;diff=2799"/>
		<updated>2007-02-24T23:49:20Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This template is used to visually mark out some important note in the text.&amp;lt;/noinclude&amp;gt;&amp;lt;p style=&amp;quot;border: 1px solid #ff7f7f; padding: 10px; margin: 20px; background: #ffbfbf;&amp;quot;&amp;gt;'''Warning''': {{{1}}}&amp;lt;/p&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Put the following code to your page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Warning|Some text.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result will look like this:&lt;br /&gt;
{{Warning|Some text.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Template:Out]]&lt;br /&gt;
* [[Template:Note]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Template:Note&amp;diff=2798</id>
		<title>Template:Note</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Template:Note&amp;diff=2798"/>
		<updated>2007-02-24T23:48:58Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This template is used to visually mark out some important note in the text.&amp;lt;/noinclude&amp;gt;&amp;lt;p style=&amp;quot;border: 1px solid #7dae96; padding: 10px; margin: 20px; background: #f7f9fa;&amp;quot;&amp;gt;'''Note''': {{{1}}}&amp;lt;/p&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Put the following code to your page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Note|Some text.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result will look like this:&lt;br /&gt;
{{Note|Some text.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Template:Out]]&lt;br /&gt;
* [[Template:Warning]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Template:Out&amp;diff=2797</id>
		<title>Template:Out</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Template:Out&amp;diff=2797"/>
		<updated>2007-02-24T23:48:37Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This template is used to visually mark out some important text. The name is short for “stand out” or “mark out”.&amp;lt;/noinclude&amp;gt;&amp;lt;p style=&amp;quot;border: none; border-left: 2px solid #7dae96; padding: 10px; margin: 20px; background: #f7f9fa;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/p&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Put the following code to your page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Out|Some text.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result will look like this:&lt;br /&gt;
{{Out|Some text.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Template:Note]]&lt;br /&gt;
* [[Template:Warning]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2796</id>
		<title>Gentoo template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2796"/>
		<updated>2007-02-24T23:47:23Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ VE from Gentoo Linux. The method is basically the same as described in [[Slackware template creation]] article.&lt;br /&gt;
&lt;br /&gt;
===Download stage3===&lt;br /&gt;
&lt;br /&gt;
We shall make the template from stage3 file. OpenVZ OS template should be an archive of root of the working system, but without the kernel and some files. You can download stage3 from the nearest mirror here: http://www.gentoo.org/main/en/mirrors.xml.&lt;br /&gt;
&lt;br /&gt;
===Create directory for the new VE and unarchive stage3 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777&lt;br /&gt;
tar -xjf /root/stage3-i686-2006.0.tar.bz2 -C /vz/private/777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create VE config===&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;
===Edit config===&lt;br /&gt;
&lt;br /&gt;
Add to the /etc/vz/conf/777.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DISTRIBUTION=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Make /etc/mtab a symlink to /proc/mounts===&lt;br /&gt;
The VE root filesystem is mounted by the host system, not the guest -- and therefore root fs will not appear in /etc/mtab. It will lead to df command non-working. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /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;
After replacing /etc/mtab with a symlink to /proc/mounts, you will always have up-to-date information of what is mounted in /etc/mtab.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/fstab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;proc /proc proc defaults 0 0&amp;quot; &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need only &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; to be mounted at the boot time.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/inittab===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/inittab&amp;lt;/code&amp;gt;, putting a hashmark (#) before the lines containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;c?:1235:respawn:/sbin/agetty 38400 tty? linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from starting &amp;lt;code&amp;gt;getty&amp;lt;/code&amp;gt; and login on ttys that does not exist in VEs.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/shadow===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/shadow&amp;lt;/code&amp;gt;, change root's password in the first line to an exclamation mark (!): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;root:!:10071:0:::::&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;code&amp;gt;vzctl set VEID --userpasswd root:password&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/init.d/checkroot===&lt;br /&gt;
&lt;br /&gt;
The checkroot script should not be enabled on boot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/runlevels/boot/checkroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edit /sbin/rc===&lt;br /&gt;
&lt;br /&gt;
Comment line number 141 in /vz/private/777/sbin/rc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;try mount -n ${mntcmd:--t sysfs sysfs /sys}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from attepting to mount &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To ensure these changes aren't automatically overwritten on update, add the following to /vz/private/777/etc/make.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;CONFIG_PROTECT = /sbin/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Set up udev===&lt;br /&gt;
&lt;br /&gt;
Delete /lib/udev-state/devices.tar.bz2 and create some device nodes needed to enter a VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/lib&lt;br /&gt;
rm udev-state/devices.tar.bz2&lt;br /&gt;
mknod udev/devices/ttyp0 c 3 0&lt;br /&gt;
mknod udev/devices/ptyp0 c 2 0&lt;br /&gt;
mknod udev/devices/ptmx c 5 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set RC_DEVICES=&amp;quot;static&amp;quot; in /vz/private/777/etc/conf.d/rc&lt;br /&gt;
&lt;br /&gt;
You have to leave the directory you are in for the next step to be ok, otherwise you will get this error message : &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota : (error) Quota on syscall for 777: Device or resource busy &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota on failed [3] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
vzctl enter 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-status -a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All services in boot and default runlevels must be started. If everything all right, stop it&lt;br /&gt;
&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;
===Make distfiles and portage tree of the host system available in a VE===&lt;br /&gt;
&lt;br /&gt;
{{Warning|This step is optional and will result in shared files between VEs!  These steps can save space on disk but trade isolation and security... consider your options carefully!}}&lt;br /&gt;
&lt;br /&gt;
To install software into a VE with portage you should mount /usr/portage into VE with &amp;quot;bind&amp;quot; option. Do this after VE starts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/root/777/usr/portage&lt;br /&gt;
mount -o bind /usr/portage /vz/root/777/usr/portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your /usr/portage/distfiles placed on the other partition do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount -n -o bind /usr/portage/distfiles /vz/root/777/usr/portage/distfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, to install package into a VE you just need enter there by &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt; and run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge package_name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while you have all the needed files in the &amp;lt;code&amp;gt;/usr/portage/distfiles&amp;lt;/code&amp;gt; of host system.&lt;br /&gt;
&lt;br /&gt;
For security reasons hold this directories mounted only while you are installing software into a VE.&lt;br /&gt;
&lt;br /&gt;
{{Note|you have to &amp;lt;code&amp;gt;umount /vz/root/777/usr/portage/distfiles&amp;lt;/code&amp;gt; before trying to stop your VE.}}&lt;br /&gt;
&lt;br /&gt;
===Create the cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/&lt;br /&gt;
tar czf /vz/template/cache/gentoo.tar.gz *&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test the new cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 800 --ostemplate gentoo --ipadd 192.168.0.10 --hostname testvps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working Gentoo template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Template:Warning&amp;diff=2795</id>
		<title>Template:Warning</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Template:Warning&amp;diff=2795"/>
		<updated>2007-02-24T23:46:27Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: New page: &amp;lt;noinclude&amp;gt;This template is used to visually mark out some important note in the text.&amp;lt;/noinclude&amp;gt;&amp;lt;p style=&amp;quot;border: 1px solid #ff7f7f; padding: 10px; margin: 20px; background: #ffbfbf;&amp;quot;&amp;gt;''...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This template is used to visually mark out some important note in the text.&amp;lt;/noinclude&amp;gt;&amp;lt;p style=&amp;quot;border: 1px solid #ff7f7f; padding: 10px; margin: 20px; background: #ffbfbf;&amp;quot;&amp;gt;'''Warning''': {{{1}}}&amp;lt;/p&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Put the following code to your page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Warning|Some text.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result will look like this:&lt;br /&gt;
{{Warning|Some text.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Template:Out]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2794</id>
		<title>Gentoo template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2794"/>
		<updated>2007-02-24T23:35:50Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: /* Edit /sbin/rc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ VE from Gentoo Linux. The method is basically the same as described in [[Slackware template creation]] article.&lt;br /&gt;
&lt;br /&gt;
===Download stage3===&lt;br /&gt;
&lt;br /&gt;
We shall make the template from stage3 file. OpenVZ OS template should be an archive of root of the working system, but without the kernel and some files. You can download stage3 from the nearest mirror here: http://www.gentoo.org/main/en/mirrors.xml.&lt;br /&gt;
&lt;br /&gt;
===Create directory for the new VE and unarchive stage3 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777&lt;br /&gt;
tar -xjf /root/stage3-i686-2006.0.tar.bz2 -C /vz/private/777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create VE config===&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;
===Edit config===&lt;br /&gt;
&lt;br /&gt;
Add to the /etc/vz/conf/777.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DISTRIBUTION=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Make /etc/mtab a symlink to /proc/mounts===&lt;br /&gt;
The VE root filesystem is mounted by the host system, not the guest -- and therefore root fs will not appear in /etc/mtab. It will lead to df command non-working. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /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;
After replacing /etc/mtab with a symlink to /proc/mounts, you will always have up-to-date information of what is mounted in /etc/mtab.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/fstab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;proc /proc proc defaults 0 0&amp;quot; &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need only &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; to be mounted at the boot time.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/inittab===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/inittab&amp;lt;/code&amp;gt;, putting a hashmark (#) before the lines containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;c?:1235:respawn:/sbin/agetty 38400 tty? linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from starting &amp;lt;code&amp;gt;getty&amp;lt;/code&amp;gt; and login on ttys that does not exist in VEs.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/shadow===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/shadow&amp;lt;/code&amp;gt;, change root's password in the first line to an exclamation mark (!): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;root:!:10071:0:::::&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;code&amp;gt;vzctl set VEID --userpasswd root:password&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/init.d/checkroot===&lt;br /&gt;
&lt;br /&gt;
The checkroot script should not be enabled on boot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/runlevels/boot/checkroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edit /sbin/rc===&lt;br /&gt;
&lt;br /&gt;
Comment line number 141 in /vz/private/777/sbin/rc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;try mount -n ${mntcmd:--t sysfs sysfs /sys}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from attepting to mount &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To ensure these changes aren't automatically overwritten on update, add the following to /vz/private/777/etc/make.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;CONFIG_PROTECT = /sbin/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Set up udev===&lt;br /&gt;
&lt;br /&gt;
Delete /lib/udev-state/devices.tar.bz2 and create some device nodes needed to enter a VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/lib&lt;br /&gt;
rm udev-state/devices.tar.bz2&lt;br /&gt;
mknod udev/devices/ttyp0 c 3 0&lt;br /&gt;
mknod udev/devices/ptyp0 c 2 0&lt;br /&gt;
mknod udev/devices/ptmx c 5 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set RC_DEVICES=&amp;quot;static&amp;quot; in /vz/private/777/etc/conf.d/rc&lt;br /&gt;
&lt;br /&gt;
You have to leave the directory you are in for the next step to be ok, otherwise you will get this error message : &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota : (error) Quota on syscall for 777: Device or resource busy &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota on failed [3] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
vzctl enter 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-status -a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All services in boot and default runlevels must be started. If everything all right, stop it&lt;br /&gt;
&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;
===Make distfiles and portage tree of the host system available in a VE===&lt;br /&gt;
&lt;br /&gt;
{{Note|This step is optional and will result in shared files between VEs!  These steps can save space on disk but trade isolation and security... consider your options carefully!}}&lt;br /&gt;
&lt;br /&gt;
To install software into a VE with portage you should mount /usr/portage into VE with &amp;quot;bind&amp;quot; option. Do this after VE starts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/root/777/usr/portage&lt;br /&gt;
mount -o bind /usr/portage /vz/root/777/usr/portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your /usr/portage/distfiles placed on the other partition do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount -n -o bind /usr/portage/distfiles /vz/root/777/usr/portage/distfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, to install package into a VE you just need enter there by &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt; and run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge package_name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while you have all the needed files in the &amp;lt;code&amp;gt;/usr/portage/distfiles&amp;lt;/code&amp;gt; of host system.&lt;br /&gt;
&lt;br /&gt;
For security reasons hold this directories mounted only while you are installing software into a VE.&lt;br /&gt;
&lt;br /&gt;
{{Note|you have to &amp;lt;code&amp;gt;umount /vz/root/777/usr/portage/distfiles&amp;lt;/code&amp;gt; before trying to stop your VE.}}&lt;br /&gt;
&lt;br /&gt;
===Create the cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/&lt;br /&gt;
tar czf /vz/template/cache/gentoo.tar.gz *&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test the new cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 800 --ostemplate gentoo --ipadd 192.168.0.10 --hostname testvps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working Gentoo template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2793</id>
		<title>Gentoo template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2793"/>
		<updated>2007-02-24T23:29:19Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: /* Make distfiles and portage tree of the host system available in a VE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ VE from Gentoo Linux. The method is basically the same as described in [[Slackware template creation]] article.&lt;br /&gt;
&lt;br /&gt;
===Download stage3===&lt;br /&gt;
&lt;br /&gt;
We shall make the template from stage3 file. OpenVZ OS template should be an archive of root of the working system, but without the kernel and some files. You can download stage3 from the nearest mirror here: http://www.gentoo.org/main/en/mirrors.xml.&lt;br /&gt;
&lt;br /&gt;
===Create directory for the new VE and unarchive stage3 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777&lt;br /&gt;
tar -xjf /root/stage3-i686-2006.0.tar.bz2 -C /vz/private/777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create VE config===&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;
===Edit config===&lt;br /&gt;
&lt;br /&gt;
Add to the /etc/vz/conf/777.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DISTRIBUTION=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Make /etc/mtab a symlink to /proc/mounts===&lt;br /&gt;
The VE root filesystem is mounted by the host system, not the guest -- and therefore root fs will not appear in /etc/mtab. It will lead to df command non-working. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /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;
After replacing /etc/mtab with a symlink to /proc/mounts, you will always have up-to-date information of what is mounted in /etc/mtab.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/fstab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;proc /proc proc defaults 0 0&amp;quot; &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need only &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; to be mounted at the boot time.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/inittab===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/inittab&amp;lt;/code&amp;gt;, putting a hashmark (#) before the lines containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;c?:1235:respawn:/sbin/agetty 38400 tty? linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from starting &amp;lt;code&amp;gt;getty&amp;lt;/code&amp;gt; and login on ttys that does not exist in VEs.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/shadow===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/shadow&amp;lt;/code&amp;gt;, change root's password in the first line to an exclamation mark (!): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;root:!:10071:0:::::&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;code&amp;gt;vzctl set VEID --userpasswd root:password&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/init.d/checkroot===&lt;br /&gt;
&lt;br /&gt;
The checkroot script should not be enabled on boot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/runlevels/boot/checkroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edit /sbin/rc===&lt;br /&gt;
&lt;br /&gt;
Comment line number 141 in /vz/private/777/sbin/rc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;try mount -n ${mntcmd:--t sysfs sysfs /sys}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from attepting to mount &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Set up udev===&lt;br /&gt;
&lt;br /&gt;
Delete /lib/udev-state/devices.tar.bz2 and create some device nodes needed to enter a VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/lib&lt;br /&gt;
rm udev-state/devices.tar.bz2&lt;br /&gt;
mknod udev/devices/ttyp0 c 3 0&lt;br /&gt;
mknod udev/devices/ptyp0 c 2 0&lt;br /&gt;
mknod udev/devices/ptmx c 5 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set RC_DEVICES=&amp;quot;static&amp;quot; in /vz/private/777/etc/conf.d/rc&lt;br /&gt;
&lt;br /&gt;
You have to leave the directory you are in for the next step to be ok, otherwise you will get this error message : &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota : (error) Quota on syscall for 777: Device or resource busy &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota on failed [3] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
vzctl enter 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-status -a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All services in boot and default runlevels must be started. If everything all right, stop it&lt;br /&gt;
&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;
===Make distfiles and portage tree of the host system available in a VE===&lt;br /&gt;
&lt;br /&gt;
{{Note|This step is optional and will result in shared files between VEs!  These steps can save space on disk but trade isolation and security... consider your options carefully!}}&lt;br /&gt;
&lt;br /&gt;
To install software into a VE with portage you should mount /usr/portage into VE with &amp;quot;bind&amp;quot; option. Do this after VE starts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/root/777/usr/portage&lt;br /&gt;
mount -o bind /usr/portage /vz/root/777/usr/portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your /usr/portage/distfiles placed on the other partition do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount -n -o bind /usr/portage/distfiles /vz/root/777/usr/portage/distfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, to install package into a VE you just need enter there by &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt; and run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge package_name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while you have all the needed files in the &amp;lt;code&amp;gt;/usr/portage/distfiles&amp;lt;/code&amp;gt; of host system.&lt;br /&gt;
&lt;br /&gt;
For security reasons hold this directories mounted only while you are installing software into a VE.&lt;br /&gt;
&lt;br /&gt;
{{Note|you have to &amp;lt;code&amp;gt;umount /vz/root/777/usr/portage/distfiles&amp;lt;/code&amp;gt; before trying to stop your VE.}}&lt;br /&gt;
&lt;br /&gt;
===Create the cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/&lt;br /&gt;
tar czf /vz/template/cache/gentoo.tar.gz *&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test the new cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 800 --ostemplate gentoo --ipadd 192.168.0.10 --hostname testvps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working Gentoo template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2792</id>
		<title>Gentoo template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Gentoo_template_creation&amp;diff=2792"/>
		<updated>2007-02-24T23:23:01Z</updated>

		<summary type="html">&lt;p&gt;Djcapelis: /* Edit /etc/init.d/checkroot */ This will do the same thing without completely screwing up your machine when you update baselayout...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about making a template cache for OpenVZ VE from Gentoo Linux. The method is basically the same as described in [[Slackware template creation]] article.&lt;br /&gt;
&lt;br /&gt;
===Download stage3===&lt;br /&gt;
&lt;br /&gt;
We shall make the template from stage3 file. OpenVZ OS template should be an archive of root of the working system, but without the kernel and some files. You can download stage3 from the nearest mirror here: http://www.gentoo.org/main/en/mirrors.xml.&lt;br /&gt;
&lt;br /&gt;
===Create directory for the new VE and unarchive stage3 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/private/777&lt;br /&gt;
tar -xjf /root/stage3-i686-2006.0.tar.bz2 -C /vz/private/777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create VE config===&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;
===Edit config===&lt;br /&gt;
&lt;br /&gt;
Add to the /etc/vz/conf/777.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DISTRIBUTION=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;gentoo&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Make /etc/mtab a symlink to /proc/mounts===&lt;br /&gt;
The VE root filesystem is mounted by the host system, not the guest -- and therefore root fs will not appear in /etc/mtab. It will lead to df command non-working. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /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;
After replacing /etc/mtab with a symlink to /proc/mounts, you will always have up-to-date information of what is mounted in /etc/mtab.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/fstab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;proc /proc proc defaults 0 0&amp;quot; &amp;gt; /vz/private/777/etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need only &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; to be mounted at the boot time.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/inittab===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/inittab&amp;lt;/code&amp;gt;, putting a hashmark (#) before the lines containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;c?:1235:respawn:/sbin/agetty 38400 tty? linux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from starting &amp;lt;code&amp;gt;getty&amp;lt;/code&amp;gt; and login on ttys that does not exist in VEs.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/shadow===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/vz/private/777/etc/shadow&amp;lt;/code&amp;gt;, change root's password in the first line to an exclamation mark (!): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;root:!:10071:0:::::&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will disable the root login until the password changed with &amp;lt;code&amp;gt;vzctl set VEID --userpasswd root:password&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Edit /etc/init.d/checkroot===&lt;br /&gt;
&lt;br /&gt;
The checkroot script should not be enabled on boot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /vz/private/777/etc/runlevels/boot/checkroot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Edit /sbin/rc===&lt;br /&gt;
&lt;br /&gt;
Comment line number 141 in /vz/private/777/sbin/rc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;try mount -n ${mntcmd:--t sysfs sysfs /sys}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This prevents from attepting to mount &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Set up udev===&lt;br /&gt;
&lt;br /&gt;
Delete /lib/udev-state/devices.tar.bz2 and create some device nodes needed to enter a VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/lib&lt;br /&gt;
rm udev-state/devices.tar.bz2&lt;br /&gt;
mknod udev/devices/ttyp0 c 3 0&lt;br /&gt;
mknod udev/devices/ptyp0 c 2 0&lt;br /&gt;
mknod udev/devices/ptmx c 5 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set RC_DEVICES=&amp;quot;static&amp;quot; in /vz/private/777/etc/conf.d/rc&lt;br /&gt;
&lt;br /&gt;
You have to leave the directory you are in for the next step to be ok, otherwise you will get this error message : &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota : (error) Quota on syscall for 777: Device or resource busy &amp;lt;br&amp;gt;&lt;br /&gt;
vzquota on failed [3] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 777&lt;br /&gt;
vzctl enter 777&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-status -a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All services in boot and default runlevels must be started. If everything all right, stop it&lt;br /&gt;
&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;
===Make distfiles and portage tree of the host system available in a VE===&lt;br /&gt;
&lt;br /&gt;
To install software into a VE with portage you should mount /usr/portage into VE with &amp;quot;bind&amp;quot; option. Do this after VE starts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /vz/root/777/usr/portage&lt;br /&gt;
mount -o bind /usr/portage /vz/root/777/usr/portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your /usr/portage/distfiles placed on the other partition do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount -n -o bind /usr/portage/distfiles /vz/root/777/usr/portage/distfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, to install package into a VE you just need enter there by &amp;lt;code&amp;gt;vzctl enter&amp;lt;/code&amp;gt; and run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge package_name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
while you have all the needed files in the &amp;lt;code&amp;gt;/usr/portage/distfiles&amp;lt;/code&amp;gt; of host system.&lt;br /&gt;
&lt;br /&gt;
For security reasons hold this directories mounted only while you are installing software into a VE.&lt;br /&gt;
&lt;br /&gt;
{{Note|you have to &amp;lt;code&amp;gt;umount /vz/root/777/usr/portage/distfiles&amp;lt;/code&amp;gt; before trying to stop your VE.}}&lt;br /&gt;
&lt;br /&gt;
===Create the cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /vz/private/777/&lt;br /&gt;
tar czf /vz/template/cache/gentoo.tar.gz *&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test the new cache file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl create 800 --ostemplate gentoo --ipadd 192.168.0.10 --hostname testvps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If created successfully, try to start it: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vzctl start 800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it started, and you can ssh in, congratulations, you've got a working Gentoo template!&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Djcapelis</name></author>
		
	</entry>
</feed>