Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Installation on Debian 9

221 bytes added, 09:25, 28 January 2020
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}}
= '''Volumes and file systems ''' =
It is recommended to use a separate partition for containers (by default '''/var/lib/vz''') and format it to '''compatible ext4'''.
Script=/etc/initramfs-tools/scripts/local-premount/tune
echo '#!/bin/sh' | sudo tee $Script
echo 'if [ "$readonly1" != "yprereqs" ] ; then exit 0 ; fi' | sudo tee -a $Script
echo e2fsck -f $Volume | sudo tee -a $Script
echo tune2fs -O -metadata_csum $Volume | sudo tee -a $Script
sudo rm /etc/initramfs-tools/scripts/local-premount/tune
sudo apt --reinstall install initramfs-tools-core
sudo update-initramfs -u -k all
This recipe is useful for any volume that can't be neither unmounted nor remounted readonly.
You 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
* 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)"
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
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
Alternatively, you can also download Alternatives:* Download precreated template caches from [http://openvz.org/download[Download/template/cache Downloads precreated|Download » Templates Template » Precreated], ] or from one of the [https://mirrors.openvz.org/ mirrors]. Put those tarballs '''as-is (no unpacking needed)''' to the <tt>/vz/template/cache/</tt> directory.* '''[https://downloads.actiu.net/ctctl/ ctctl]''' helper to create Debian (or derivative) container without template (caches it as a local template). This tool manages unprivileged LXC containers too.
= Next steps =
= See also =
* [[Installation on Debian 8]] (oldstable) or Devuan 1.0 (Jessie, stable, SystemV)
[[Category: Installation]]
[[Category: HOWTO]]
[[Category: Debian]]
92
edits