Editing Ubuntu Gutsy template creation
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
[[Category: Templates]] | [[Category: Templates]] | ||
[[Category: Ubuntu]] | [[Category: Ubuntu]] | ||
+ | |||
This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ. | This article summarizes the experience of creating Ubunty Gutsy Gibbon (a.k.a. 7.10) template for OpenVZ. | ||
Line 97: | Line 98: | ||
{{Warning|Do not run the commands below on the hardware node, they are only to be run within the container!}} | {{Warning|Do not run the commands below on the hardware node, they are only to be run within the container!}} | ||
+ | |||
==== Remove unneeded packages ==== | ==== Remove unneeded packages ==== | ||
Line 118: | Line 120: | ||
==== Disable getty ==== | ==== Disable getty ==== | ||
− | On a usual Linux system, | + | On a usual Linux system, getty is running on a virtual terminals, which a container 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. |
− | So, first of all we stop all | + | So, first of all we stop all getty processes: |
[container]# initctl stop tty{1,2,3,4,5,6} | [container]# initctl stop tty{1,2,3,4,5,6} | ||
− | Next, we disable running | + | Next, we disable running getty. This can be done in two ways: |
First way: | First way: | ||
Line 132: | Line 134: | ||
[container]# dpkg -P system-services | [container]# dpkg -P system-services | ||
− | Second way can be dangerous for future versions of | + | 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. |
==== Set sane permissions for /root directory ==== | ==== Set sane permissions for /root directory ==== | ||
Line 141: | Line 143: | ||
[container]# usermod -L root | [container]# usermod -L root | ||
+ | |||
==== "fake-modprobe" needed for IPv6 addresses ==== | ==== "fake-modprobe" needed for IPv6 addresses ==== | ||
Line 175: | Line 178: | ||
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys | chmod a+x /etc/rc2.d/S15ssh_gen_host_keys | ||
</pre> | </pre> | ||
+ | |||
==== Disable <code>sync()</code> for syslog ==== | ==== Disable <code>sync()</code> for syslog ==== | ||
Line 191: | Line 195: | ||
After that, it would make sense to disable <code>mtab.sh</code> script which messes with <code>/etc/mtab</code>: | After that, it would make sense to disable <code>mtab.sh</code> script which messes with <code>/etc/mtab</code>: | ||
[container]# update-rc.d -f mtab.sh remove | [container]# update-rc.d -f mtab.sh remove | ||
+ | |||
+ | |||
==== Disable some services ==== | ==== Disable some services ==== | ||
Line 252: | Line 258: | ||
Now create a cached OS tarball. In the command below, you'll want to replace <arch> with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''. | Now create a cached OS tarball. In the command below, you'll want to replace <arch> with your architecture (i386, amd64, ia64, etc). '''Note the space and the dot at the end of the command'''. | ||
− | [HW]# tar | + | [HW]# tar czf /vz/template/cache/ubuntu-7.10-<arch>-minimal.tar.gz . |
Look at the resulting tarball to see its size is sane: | Look at the resulting tarball to see its size is sane: |