Installation a lot karnel and virtualization OpenVZ Debian 7
The following tutorial describes how to very simply install and run karnel OVZ virtualization.
The reaction comes to enter the number of commands.
We update the system at the outset.
1 | apt-get update |
1 | apt-get upgrade |
Add the repository OVZ:
1 2 3 4 | cat << EOF > /etc/apt/sources.list.d/openvz-rhel6.list deb http://download.openvz.org/debian wheezy main # deb http://download.openvz.org/debian wheezy-test main EOF |
We import the GPG key
1 2 | get http://ftp.openvz.org/debian/archive.key apt-key add archive.key |
We update our database repositories
1 | apt-get update |
Installation karnel OVZ
1 | apt-get -y install linux-image-openvz-amd64 |
Run the system modules
1 2 3 4 5 6 7 8 | sed -i 's/kernel.sysrq = 0/kernel.sysrq = 1/g' /etc/sysctl.conf sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf echo 'net.ipv6.conf.default.forwarding = 1' >> /etc/sysctl.conf echo 'net.ipv6.conf.all.forwarding = 1' >> /etc/sysctl.conf echo 'net.ipv4.conf.default.proxy_arp = 0' >> /etc/sysctl.conf echo 'net.ipv4.conf.all.rp_filter = 1' >> /etc/sysctl.conf echo 'net.ipv4.conf.default.send_redirects = 1' >> /etc/sysctl.conf echo 'net.ipv4.conf.all.send_redirects = 0' >> /etc/sysctl.conf |
Openvz and install the necessary components
1 | apt-get -y install vzctl vzquota ploop vzstats |
Then charge system images openvz
1 2 3 4 5 | wget -P /vz/template/cache http://download.openvz.org/template/precreated/debian-7.0-x86_64.tar.gz wget -P /vz/template/cache http://download.openvz.org/template/precreated/debian-8.0-x86_64.tar.gz wget -P /vz/template/cache http://download.openvz.org/template/precreated/debian-8.0-x86_64-minimal.tar.gz wget -P /vz/template/cache http://download.openvz.org/template/precreated/centos-6-x86_64-minimal.tar.gz wget -P /vz/template/cache http://download.openvz.org/template/precreated/centos-7-x86_64-minimal.tar.gz |
More available images is available directly on the distribution:
https://download.openvz.org/template/precreated/
We make an update to detect the thick karnel openvz
1 | update-grub |
then make changes to the settings thick with each system start immediately boot from karnel OVZ
1 | sed -i 's/GRUB_DEFAULT=0/GRUB_DEFAULT=2/g' /etc/default/grub |
important:
GRUB_DEFAULT=2
If the system does not boot from karnel OVZ should replace multiple in this line zamast 2 na 3,4,5,6
Depending on the order karnel.
Again, we reload the grub
1 | update-grub |
then reboot the system. Whole should start already karnel OVZ 2.6
If everything went correctly we install rsync move files and make a symbolic link:
1 2 3 4 | apt-get -y install rsync rsync -avr /var/lib/vz/* /vz/ rm -fr /var/lib/vz ln -s /vz /var/lib/vz |