92
edits
Changes
→Download OS templates: ctcreate to ctctl
This document briefly describes the steps needed is a guide to install OpenVZ 6 (legacy) on your Debian 9 "Stretch" (amd64 or i386) machine.
{{Note|The best and latest Debian version for OpenVZ 6 is [[Installation on Debian 8|Devuan 1.0]], but Debian 9 makes really easy the coexistence of OVZ and unprivileged LXC containers.}}{{Out|Current commercial version of OpenVZ ([[Virtuozzo]] 7) is not installable on Devuan or Debian GNU/Linux because is developed as an independent GNU/Linux distribution}}
== Requirements ='''Volumes and file systems''' =
== Filesystem and defaults Ext4 ==Debian 9 installer (and tools by default) formats Ext4 with new features, and concrete "metadata_csum" is incompatible with OpenVZ6 kernel. Then it's necessary to boot without requiring the mount of volumes with "metadata_csum". Ordered alternatives:# After a fresh Debian 9 install, remove metadata_csum feature from filesystems.# Upgrade from Debian 8 to Debian 9 (metadata_csum not inherited)# Root volume (/ and others) as Ext3 and deploy /var/lib/vz in a later created Ext4 volume, without metadata_csum.# Use Ext3
== Partitions and btrfs ==You might want btrfs to use per-directory (subvolume) quotas for other simfs/dir containers, such as LXC. Only vzquota doesn't work on a btrfs volume; for OVZ containers it's better to mount /var/lib/vz file system ==to an Ext4 volume.
=== How to format a volume to be a compatible btrfs ===* Example for /dev/sda1 sudo mkfs -t btrfs -O ^mixed-bg,^extref,^skinny-metadata,^no-holes /dev/sda1You must not format btrfs with Debian installer because features cannot be disabled after. = '''Change Systemd to SystemV''' = {{Note|Warning! This operation can make some desktop software to stop working, such as desktop environments.}}
sudo apt install sysvinit-core sysvinit-utils
sudo reboot
sudo apt --auto-remove remove systemd
echo -e 'Package: *systemd*\nPin: release *\nPin-Priority: -1\n' | sudo tee /etc/apt/preferences.d/avoid-systemd
* Other More recipes at [http://without-systemd.org/wiki/index.php/Debian_Stretch without-systemd.org]
== '''Register OVZ updated repository =''' =
RepoFile=/etc/apt/sources.list.d/openvz.list
{{Note|For more info about Debian repositories, see http://download.openvz.org/debian.}}
== '''Install packages =''' =
KPackage="linux-image-openvz-$(dpkg --print-architecture)"
sudo apt --allow-unauthenticated --install-recommends install $KPackage vzdump ploop initramfs-toolsdirmngr
if [ ! -d /vz ] ; then sudo ln -s /var/lib/vz/ /vz ; fi
VE_STOP_MODE=stop
== '''Reboot into OpenVZ kernel ''' == {{Note|At boot manager, in "Advanced options for Debian GNU/Linux", you will find kernels named "2.6.32-openvz". Select the first listed.}}
sudo reboot
sudo ps ax | grep -v 'grep' | grep 'vzmond'
== Set OpenVZ as default to boot ==
Because of GRUB2 default criteria, default kernel to boot can still be the one from Debian's repository (non OVZ). If Probably you don't want to change this behaviour, ; once you've booted fine into OpenVZ kernel, you can remove other unuseful kernels:
Packages="$(apt list --installed 'linux-image-*' 2>/dev/null | grep -e '^linux-image-' | grep -ve 'openvz' | cut -f 1 -d '/')"
sudo apt --autoremove remove $Packages
This step is optional, vzctl is able to download templates on demand.
An OS template is a GNU distribution for Linux distribution , installed into a container
and then packed into a gzipped tarball. Using such a cache, a new container
can be created in a minute.
sudo vztmpl-dl --gpg-check debian-8.0-x86_64-minimal
OpenVZ is now set up on your machine. Follow on to [[basic operations in OpenVZ environment]] document.
[[Category: Installation]]
[[Category: HOWTO]]
[[Category: Debian]]