Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Debootstrap from foreign version or distribution

1,545 bytes added, 09:02, 5 May 2010
First
[[Category: HOWTO]]
[[Category: Templates]]
[[Category: Ubuntu]]
[[Category: Debian]]

This procedure (for Debian, Ubuntu, and derivatives) is useful when need to create a template, and your host hasn't suite's script (in /usr/share/debootstrap/scripts). This situation can de caused because your host and your next template are from different distributions, or because your host is an older version than the next template you want to create (fo example, creating Ubuntu 10.04 template in an Ubuntu 8.04 host).

To do this you need a computer to install a clean system or a virtual one with [http://www.qemu.org/ Qemu] or similar.

'''Step 1: install a system with the distribution & version you want for template'''

'''Step 2: debootstrap'''
cd /tmp
sudo apt-get install debootstrap
mkdir newsystem
# The parameter ''--variant=minbase'' is optional. You may want it to make a minimal template.
sudo debootstrap --variant=minbase $(lsb_release -cs) newsystem

'''Step 3: package for moving'''
cd newsystem
sudo tar czf /tmp/debootstrap_$(lsb_release -is | tr "[:upper:]" "[:lower:]")-$(lsb_release -rs)-$(uname -m)''_minbase''.tar.gz .
cd ..
sudo rm -R newsystem
Now you have a package like "debootstrap_ubuntu-10.04-i686.tar.gz" to copy to the OpenVZ host/server.

'''Unpacking for a new templaye''' (example for 777 container)
sudo mkdir -p /vz/private/777
cd /vz/private/777
sudo tar xf /tmp/debootstrap_ubuntu-10.04-i686.tar.gz

'''Next''' steps are the usual for [http://wiki.openvz.org/Category:Templates creating a template].
92
edits