<?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=Echelon</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=Echelon"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Echelon"/>
	<updated>2026-06-13T23:58:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Download/template/precreated&amp;diff=6821</id>
		<title>Talk:Download/template/precreated</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Download/template/precreated&amp;diff=6821"/>
		<updated>2008-12-24T01:26:25Z</updated>

		<summary type="html">&lt;p&gt;Echelon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Just added a note to the article that the Debian images are still insecure. It would be better to replace the images with corrected ones, but I have no idea who to contact. --[[User:Bluehorn|Bluehorn]] 09:42, 5 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
The Centos 5 minimal x86-64 image appears to be lacking in many ways. Most importantly it doesn't set up /dev properly. I'm going to test out the Centos 5 not-so minimal image. --[[User:cbsmith|cbsmith]] 17:53 22 Sept 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
I have built an i386 Debian Lenny template for download, and has been verified working at this time. http://www.fuzzyconcepts.net/openvz/debian-5.0-i386-fc1.tar.gz  --[[User:Echelon|Echelon]] 20:26 23 Dec 2008 (EST)&lt;/div&gt;</summary>
		<author><name>Echelon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3775</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3775"/>
		<updated>2007-12-17T10:34:26Z</updated>

		<summary type="html">&lt;p&gt;Echelon: /* vzctl */ More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problem I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Echelon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3774</id>
		<title>Ubuntu Gutsy template creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Ubuntu_Gutsy_template_creation&amp;diff=3774"/>
		<updated>2007-12-17T10:33:48Z</updated>

		<summary type="html">&lt;p&gt;Echelon: /* vzctl */ Fixing typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
Template creation is based on debootstrap, and the procedure is similar to [[Debian template creation]], but it differs in some subtle details.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== debootstrap ===&lt;br /&gt;
You have to have a debootstrap working for Gutsy, i.e. you should have&lt;br /&gt;
* debootstrap and its dependencies&lt;br /&gt;
* /usr/lib/debootstrap/scripts/gutsy file&lt;br /&gt;
&lt;br /&gt;
The simplest way to have it all is to work on an Ubunty Gutsy system (be it on a real machine or inside a VE). If you don't have debootstrap installed, this is the command to install it:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install debootstrap&lt;br /&gt;
&lt;br /&gt;
On a Gentoo Linux, debootstrap is also available, this is how you can install it:&lt;br /&gt;
&lt;br /&gt;
 # emerge debootstrap&lt;br /&gt;
&lt;br /&gt;
=== vzctl ===&lt;br /&gt;
&lt;br /&gt;
You need vzctl-3.0.19 or later to work with Ubuntu Gutsy Gibbon. If vzctl-3.0.18 or earlier is used, you will not be able to run your VE. See {{bug|662}} for details.&lt;br /&gt;
&lt;br /&gt;
Note: Older versions of vzctl have worked for me IF you install sysvinit (which will remove upstart). The only problme I had was the network did not start, so I added &amp;quot;/etc/init.d/networking restart&amp;quot; to /etc/re.local.&lt;br /&gt;
&lt;br /&gt;
== Creating template ==&lt;br /&gt;
&lt;br /&gt;
=== Running debootstrap ===&lt;br /&gt;
&lt;br /&gt;
Create a working directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# mkdir gutsy-chroot&lt;br /&gt;
&lt;br /&gt;
Run debootstrap to install a minimal Ubunty Gutsy system into that directory:&lt;br /&gt;
&lt;br /&gt;
 [HW]# debootstrap [--arch ''ARCH''] gutsy gutsy-chroot &lt;br /&gt;
&lt;br /&gt;
If ARCH of VE0 is equal to VE, you can skip the --arch option, but if you need to build an OS template for another ''ARCH'', specify it explicitly:&lt;br /&gt;
* for AMD64/x86_64, use &amp;lt;code&amp;gt;amd64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for IA64, use &amp;lt;code&amp;gt;ia64&amp;lt;/code&amp;gt;&lt;br /&gt;
* for i386 &amp;lt;code&amp;gt;i386&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Preparing/starting a VE ===&lt;br /&gt;
&lt;br /&gt;
Now then you have an installation created by &amp;lt;code&amp;gt;debootstrap&amp;lt;/code&amp;gt;, you can run it as a VE. In the example below VE ID of 777 is used; of course you can use any other non-allocated ID.&lt;br /&gt;
&lt;br /&gt;
{{Note|an alternative way is using chroot instead of running a VE. This is not recommended because of security concerns.}}&lt;br /&gt;
&lt;br /&gt;
==== Moving installation to VE private area ====&lt;br /&gt;
&lt;br /&gt;
You should move the contents of gutsy-chroot directory into new VE private area, like this:&lt;br /&gt;
&lt;br /&gt;
 # mv gutsy-chroot /vz/private/777&lt;br /&gt;
&lt;br /&gt;
==== Setting VE config ====&lt;br /&gt;
An initial config for the [[VE]] is needed:&lt;br /&gt;
 # vzctl set 777 --applyconfig vps.basic --save&lt;br /&gt;
&lt;br /&gt;
==== Setting VE OSTEMPLATE ====&lt;br /&gt;
Also, we need &amp;lt;code&amp;gt;OSTEMPLATE&amp;lt;/code&amp;gt; to be set in VE configuration file, for the [[vzctl]] to work properly.&lt;br /&gt;
&lt;br /&gt;
 # echo &amp;quot;OSTEMPLATE=ubuntu-7.10&amp;quot; &amp;gt;&amp;gt; /etc/vz/conf/777.conf&lt;br /&gt;
&lt;br /&gt;
==== Setting VE IP address ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we need a valid IP address for it:&lt;br /&gt;
 # vzctl set 777 --ipadd x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
{{Note|if you use private IP for the VE, you have to set up NAT as described in [[Using NAT for VE with private IPs]].}}&lt;br /&gt;
&lt;br /&gt;
==== Setting DNS server for the VE ====&lt;br /&gt;
For the [[VE]] to be able to download updates from the Internet, we also need to specify a DNS for it:&lt;br /&gt;
 # vzctl set 777 --nameserver x.x.x.x --save&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt;, specify the same IP that you have in your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Starting VE ====&lt;br /&gt;
Now start the VE:&lt;br /&gt;
 # vzctl start 777&lt;br /&gt;
&lt;br /&gt;
=== Modify the installation ===&lt;br /&gt;
&lt;br /&gt;
You have to do some things in order to modify the installation to better suit the environment it will be run in (i.e. a VE).&lt;br /&gt;
&lt;br /&gt;
First, enter a VE:&lt;br /&gt;
 # vzctl enter 777&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the VE!}}&lt;br /&gt;
&lt;br /&gt;
==== Remove unneeded packages ====&lt;br /&gt;
&lt;br /&gt;
Some packages does not make sense in a VE, or are really optional. Remove those:&lt;br /&gt;
&lt;br /&gt;
 [VE]# dpkg -P ubuntu-minimal wpasupplicant wireless-tools \&lt;br /&gt;
   udev pcmciautils initramfs-tools volumeid console-setup \&lt;br /&gt;
   xkb-data usbutils mii-diag alsa-base alsa-utils ethtool \&lt;br /&gt;
   module-init-tools linux-sound-base console-tools \&lt;br /&gt;
   console-terminus busybox-initramfs libvolume-id0 \&lt;br /&gt;
   ntpdate eject libasound2 pciutils tasksel tasksel-data \&lt;br /&gt;
   laptop-detect&lt;br /&gt;
&lt;br /&gt;
Note that the above list of packages may be too extensive. Say, if you want to use &amp;lt;code&amp;gt;tasksel&amp;lt;/code&amp;gt; tool, do not remove it — but then you have to let laptop-detect stay.&lt;br /&gt;
&lt;br /&gt;
Clean up after udev:&lt;br /&gt;
&lt;br /&gt;
 [VE]# rm -fr /lib/udev&lt;br /&gt;
&lt;br /&gt;
==== Disable getty ====&lt;br /&gt;
On a usual Linux system, getty is running on a virtual terminals, which a VE does not have. So, having getty running doesn't make sense; more to say, it complains it can not open terminal device and this clutters the logs.&lt;br /&gt;
&lt;br /&gt;
So, first of all we stop all getty processes:&lt;br /&gt;
&lt;br /&gt;
 [VE]# initctl stop tty{1,2,3,4,5,6}&lt;br /&gt;
&lt;br /&gt;
Next, we disable running getty. This can be done in two ways:&lt;br /&gt;
&lt;br /&gt;
First way:&lt;br /&gt;
 [VE]# rm /etc/event.d/tty*&lt;br /&gt;
&lt;br /&gt;
Second way:&lt;br /&gt;
 [VE]# dpkg -P system-services&lt;br /&gt;
&lt;br /&gt;
Second way can be dangerous for future versions of system-services, but it's OK for now since the only service they carry is running gettys.&lt;br /&gt;
&lt;br /&gt;
====  Set sane permissions for /root directory ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# chmod 700 /root&lt;br /&gt;
&lt;br /&gt;
==== Disable root login ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# usermod -L root&lt;br /&gt;
&lt;br /&gt;
==== Get new security updates ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get update &amp;amp;&amp;amp; apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;This didn't show anything for me, but might do something in the future.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install some more packages ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# apt-get install ssh quota&lt;br /&gt;
&lt;br /&gt;
Feel free to add packages which you want to have in a default template to this command.&lt;br /&gt;
&lt;br /&gt;
==== Fix SSH host keys ====&lt;br /&gt;
This is only useful if you installed SSH above.  Each individual [[VE]] should have its own pair of SSH host keys.  The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- please DO NOT remove &amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt; pair of tags below,&lt;br /&gt;
     otherwise quotes after -N (-N '') are not visible --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm -f /etc/ssh/ssh_host_*&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''&lt;br /&gt;
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''&lt;br /&gt;
rm -f \$0&lt;br /&gt;
EOF&lt;br /&gt;
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable &amp;lt;code&amp;gt;sync()&amp;lt;/code&amp;gt; for syslog ====&lt;br /&gt;
&lt;br /&gt;
Turn off doing &amp;lt;tt&amp;gt;sync()&amp;lt;/tt&amp;gt; on every write for &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;'s log files, to improve overall I/O performance.&lt;br /&gt;
In Ubuntu this is already done for most log files and levels, so you can omit this step if you know what you are doing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT remove &amp;lt;pre&amp;gt; here, it's useful --&amp;gt;&lt;br /&gt;
 &amp;lt;pre&amp;gt;[VE]# sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/syslog.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fix &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; ====&lt;br /&gt;
Link &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; and friends will work:&lt;br /&gt;
 [VE]# rm -f /etc/mtab&lt;br /&gt;
 [VE]# ln -s /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
After that, it would make sense to disable &amp;lt;code&amp;gt;mtab.sh&amp;lt;/code&amp;gt; script which messes with &amp;lt;code&amp;gt;/etc/mtab&amp;lt;/code&amp;gt;:&lt;br /&gt;
 [VE]# update-rc.d -f mtab.sh remove&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Disable some services ====&lt;br /&gt;
&lt;br /&gt;
In most of the cases you don't want klogd to run -- the only exception is if you configure iptables to log some events -- so you can disable it:&lt;br /&gt;
&lt;br /&gt;
 [VE]# update-rc.d -f klogd remove&lt;br /&gt;
&lt;br /&gt;
==== Hostname ====&lt;br /&gt;
Set proper hostname:&lt;br /&gt;
 [VE]# echo &amp;quot;localhost&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
==== Set /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# echo &amp;quot;127.0.0.1 localhost.localdomain localhost&amp;quot; &amp;gt; /etc/hosts&lt;br /&gt;
&lt;br /&gt;
==== Add ptys to /dev ====&lt;br /&gt;
&lt;br /&gt;
This is needed in case /dev/pts will not me mounted after VE start. In case /dev/ttyp* and /dev/ptyp* files are present, and LEGACY_PTYS support is enabled in the kernel, vzctl will still be able to enter VE.&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /dev &amp;amp;&amp;amp; /sbin/MAKEDEV ptyp&lt;br /&gt;
&lt;br /&gt;
==== Remove nameserver(s) ====&lt;br /&gt;
&lt;br /&gt;
Remove DNS entries:&lt;br /&gt;
 [VE]# &amp;gt; /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
==== Clean packages ====&lt;br /&gt;
After installing packages, you'll have some junk packages laying around in your cache.  Since you don't want your template to have those, this command will wipe them out.&lt;br /&gt;
 [VE]# apt-get clean&lt;br /&gt;
&lt;br /&gt;
==== Cleaning up log files ====&lt;br /&gt;
&lt;br /&gt;
 [VE]# cd /var/log&lt;br /&gt;
 [VE]# &amp;gt; messages; &amp;gt; auth.log; &amp;gt; kern.log; &amp;gt; bootstrap.log&lt;br /&gt;
 [VE]# &amp;gt; dpkg.log; &amp;gt; syslog; &amp;gt; daemon.log; &amp;gt; apt/term.log&lt;br /&gt;
 [VE]# rm -f *.0 *.1&lt;br /&gt;
&lt;br /&gt;
==== Anything else? ====&lt;br /&gt;
&lt;br /&gt;
Think of what else could be done to better suit your needs.&lt;br /&gt;
&lt;br /&gt;
==== Exit from the VE ====&lt;br /&gt;
&lt;br /&gt;
Now everything is done.  Exit from the template and go back to the hardware node.&lt;br /&gt;
&lt;br /&gt;
 [VE]# exit&lt;br /&gt;
&lt;br /&gt;
== Preparing for and packing template cache ==&lt;br /&gt;
&lt;br /&gt;
The following commands are to be run in the host system (i.e. not inside a VE).&lt;br /&gt;
&lt;br /&gt;
We don't need an IP for the VE anymore, and we definitely do not need it in template cache, so remove it:&lt;br /&gt;
 [HW]# vzctl set 777 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
Stop the VE:&lt;br /&gt;
 [HW]# vzctl stop 777&lt;br /&gt;
&lt;br /&gt;
Change dir to the VE private:&lt;br /&gt;
 [HW]# cd /vz/private/777&lt;br /&gt;
&lt;br /&gt;
Now create a cached OS tarball.  In the command below, you'll want to replace &amp;lt;arch&amp;gt; with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''.&lt;br /&gt;
 [HW]# tar czf /vz/template/cache/ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Look at the resulting tarball to see its size is sane:&lt;br /&gt;
 # ls -lh /vz/template/cache&lt;br /&gt;
 -rw-r--r-- 1 root root   53M Nov 15 12:40 ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;
&lt;br /&gt;
== Testing template cache ==&lt;br /&gt;
We can now create a VE based on the just-created template cache.  Be sure to change &amp;lt;tt&amp;gt;i386&amp;lt;/tt&amp;gt; to your architecture just like you did when you named the tarball above.&lt;br /&gt;
 [HW]# vzctl create 123456 --ostemplate ubuntu-7.10-&amp;lt;arch&amp;gt;-minimal&lt;br /&gt;
&lt;br /&gt;
Now make sure that your new VE it works:&lt;br /&gt;
 [HW]# vzctl start 123456&lt;br /&gt;
 [HW]# vzctl exec 123456 ps axf&lt;br /&gt;
&lt;br /&gt;
You should see that a few processes are running.&lt;br /&gt;
&lt;br /&gt;
Other tests that could be done are:&lt;br /&gt;
 [HW]# vzctl enter 123456&lt;br /&gt;
 [VE]# ps axf&lt;br /&gt;
 [VE]# mount&lt;br /&gt;
 [VE]# dpkg -l&lt;br /&gt;
 [VE]# logout&lt;br /&gt;
 [HW]#&lt;br /&gt;
&lt;br /&gt;
Feel free to do more tests.&lt;br /&gt;
&lt;br /&gt;
== Final cleanup ==&lt;br /&gt;
Stop and remove the test VE you just created:&lt;br /&gt;
 [HW]# vzctl stop 123456&lt;br /&gt;
 [HW]# vzctl destroy 123456&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/123456.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
Finally, let's remove the VE we used for OS template cache creation:&lt;br /&gt;
 [HW]# vzctl destroy 777&lt;br /&gt;
 [HW]# rm -f /etc/vz/conf/777.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
== Updating the template cache ==&lt;br /&gt;
&lt;br /&gt;
See [[Updating Ubuntu template]]&lt;/div&gt;</summary>
		<author><name>Echelon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Hosting_providers&amp;diff=3770</id>
		<title>Hosting providers</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Hosting_providers&amp;diff=3770"/>
		<updated>2007-12-17T01:34:40Z</updated>

		<summary type="html">&lt;p&gt;Echelon: /* US Providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ makes for a great hosting platform for VPS hosting (See [[VPS vs Dedicated]] for a comparison of VPS vs Dedicated) The providers below offer VPS services using OpenVZ:&lt;br /&gt;
&lt;br /&gt;
== US Providers ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.silverrack.com/ SilverRack VPS Hosting] - SilverRack provides affordable VPS hosting using the OpenVZ platform.&lt;br /&gt;
* [http://www.buyavps.com/ BuyAVPS] - BuyAVPS provides stable yet affordable VPS hosting with a great support staff.&lt;/div&gt;</summary>
		<author><name>Echelon</name></author>
		
	</entry>
</feed>