📜 ⬆️ ⬇️

OpenVZ for Debian Wheezy

Install vzctl from the standard Debian repository and prohibit updating it so that Proxmox vzctl does not pull 100,500 dependencies behind it:
apt-get update apt-get install vzctl apt-mark hold vzctl 

Connect the repository from Proxmox:

 wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add - echo deb http://download.proxmox.com/debian wheezy pve > /etc/apt/sources.list.d/proxmox.list apt-get update && apt-get dist-upgrade 

Find the latest version of the kernel and install it:
 p=$(apt-cache search --names-only pve-kernel | sort | tail -1 | awk '{print $1;}') apt-get install pve-firmware $p 

Kernels with OpenVZ have smaller version numbers than standard ones, so Grub adds them to the middle of the list. Standard is better not to delete:
 sed -i 's,GRUB_DEFAULT=0,GRUB_DEFAULT=2,' /etc/default/grub update-grub 

Simlink is useful to simplify migration from CentOS:
 ln -s /var/lib/vz /vz 

Typical recommended settings for /etc/sysctl.d/openvz.conf :
 net.ipv4.conf.all.rp_filter=1 net.ipv4.icmp_echo_ignore_broadcasts=1 net.ipv4.conf.default.forwarding=1 net.ipv4.conf.default.proxy_arp=0 net.ipv4.ip_forward=1 kernel.sysrq = 1 net.ipv4.conf.default.send_redirects=1 net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.eth0.proxy_arp=1 

In order to provide private services to containers (DNS forwarder, etc.), it is advisable to run the venet0 network interface to OpenVZ and keep it active all the time. To do this, add to / etc / modules :
 vznetdev 

... and add to / etc / network / interfaces :
 allow-hotplug venet0 iface venet0 inet static   address 192.0.2.2   netmask 255.255.255.0 

Add to /etc/vz/vz.conf :
 IPV6="no" NEIGHBOUR_DEVS=all 

Reboot and use.
References:


')

Source: https://habr.com/ru/post/205738/


All Articles