Difference between revisions of "Installation on Debian/old"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(Install the kernel package)
m (add info's about precreated debian at download.openvz.org, add minor hints)
Line 1: Line 1:
= Stable =
+
= Sarge (Stable) =
 +
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!
  
== Edit apt settings ==
 
  
add to your "/etc/apt/sources.list"
+
== edit apt source settings ==
 +
Add to your "/etc/apt/sources.list"
  
 
<pre>
 
<pre>
Line 15: Line 16:
 
</pre>
 
</pre>
  
== Packages at debian.systs.org (dso) ==
 
  
precreated OpenVZ Debian Packages:
+
== precompiled kernel images at debian.systs.org (dso) ==
 +
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.
 +
(most kernel-modules are built-in!)
  
 
kernel(s) for i368 and amd64
 
kernel(s) for i368 and amd64
Line 48: Line 50:
 
</pre>
 
</pre>
  
== Installing the kernels and OpenVZ toolset ==
 
  
Example: install the stable OpenVZ kernel, tools and debian OS Template
+
== installing the kernel-images, toolset and debian-os-template ==
 +
Example: install the stable OpenVZ kernel, tools and Debian OS Template
  
 
  # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian
 
  # aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian
  
Maybe you need to update you "linux-loader" like lilo or grub:
 
  
for the "GRUB":
+
Maybe you need to update you "linux-loader" (can be configured at /etc/kernel-img.conf)
  # /sbin/grub-update
+
 
 +
for the "GRUB":  
 +
 
 +
  # /sbin/grub-update  
 +
 
  
 
Reboot in your new Debian Stable OpenVZ System
 
Reboot in your new Debian Stable OpenVZ System
  
 
  # reboot
 
  # reboot
 +
  
 
That's all :-)
 
That's all :-)
  
 +
Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.
  
=Etch (testing)=
 
  
OpenVZ is now a part of Debian Etch (a.k.a. "testing") repository. This article describes how to install OpenVZ on a Debian Etch system.
 
  
== Installing the utilities and kernel patch ==
+
= Etch (Testing) =
 +
OpenVZ is now a part of Debian Etch (a.k.a. "testing") repository.
 +
 
 +
== install the kernel-image ==
 +
 
 +
=== use precomiled kernel images ===
 +
Can be found at http://download.openvz.org/kernel/debian/etch/
  
To install the kernel-source, OpenVZ kernel patch and utilities, run the following:
 
 
<pre>
 
<pre>
apt-get update
+
List of precompiled kernel-images
apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz vzctl vzquota
+
 
 +
linux-image-2.6.18-openvz-486_02_i386.deb
 +
linux-image-2.6.18-openvz-686_02_i386.deb
 +
linux-image-2.6.18-openvz-amd64_01_amd64.deb
 +
linux-image-2.6.18-openvz-ia64_01_ia64.deb
 +
linux-image-2.6.18-openvz-k7_02_i386.deb
 +
linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb
 +
linux-image-2.6.18-openvz-sparc64_01_sparc.deb     
 
</pre>
 
</pre>
  
== Creating the kernel package ==
+
Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:
  
First you need to unpack the kernel:
+
<pre>
 +
# wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb
 +
# dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb
 +
</pre>
  
 +
 +
=== or build your own kernel-image (debian way) ===
 +
 +
To install the kernel-source and the OpenVZ kernel patch, run:
 
<pre>
 
<pre>
cd /usr/src
+
# apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev
tar xjf linux-source-2.6.18.tar.bz2
 
cd linux-source-2.6.18
 
 
</pre>
 
</pre>
  
Next, you need to get a kernel config. You can use the config of the debian-kernel:
 
  
 +
Unpack the kernel-source:
 
<pre>
 
<pre>
cp /boot/config-2.6.18-3-686 .config
+
# cd /usr/src
 +
# tar xjf linux-source-2.6.18.tar.bz2
 +
# cd linux-source-2.6.18
 
</pre>
 
</pre>
  
Now you can apply openvz kernel patch and compile the kernel:
 
  
 +
You need a kernel config.
 +
You can use the config of the debian-kernel:
 
<pre>
 
<pre>
make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 kernel_image --initrd
+
# cp /boot/config-2.6.18-3-686 .config
 
</pre>
 
</pre>
  
You will have to answer some config-questions. Usually, the provided defaults will suffice.
 
  
== Install the kernel package ==
+
Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/
 +
<pre>
 +
# wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test007-i686.config.ovz -O .config
 +
</pre>
 +
 
 +
 
 +
Now you can apply openvz kernel patch and modify your kernel-config:
 +
<pre>
 +
# ../kernel-patches/all/apply/openvz
 +
# make menuconfig
 +
</pre>
 +
 
 +
 
 +
You need following OpenVZ kernel config settings:
 +
<pre>
 +
</pre>
 +
 
 +
 
 +
Compile your Kernel (as user root, or you need the --fakerootcmd!)
 +
<pre>
 +
# make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 kernel_image --initrd
 +
</pre>
 +
 
  
 
Install the kernel and update initramfs:
 
Install the kernel and update initramfs:
 +
<pre>
 +
# dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb
 +
# update-initramfs -c -k 2.6.18-1-openvz
 +
</pre>
 +
 +
 +
INFO: update-initramfs is done, when make-kpkg is use with --initrd option
 +
 +
INFO: update-grub can be configured by /etc/kernel-img.conf
 +
 +
 +
Update the bootloader (when not done above)
 +
 +
GRUB :
 +
 +
# /usr/sbin/update-grub
 +
 +
INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !
 +
 +
 +
== install the toolset ==
 +
 +
You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)
 +
 +
<pre>
 +
# apt-get install vzctl vzquota
 +
</pre>
 +
 +
 +
== modify needed settings ==
 +
 +
Debian Way:
 +
 +
If you want network access for the virtual server then you need to enable IP forwarding. Set "ip_forward" to yes in /etc/network/option.
 +
 +
# editor /etc/network/options
 +
 +
 +
 +
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.
 +
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).
 +
 +
Example:
  
 
<pre>
 
<pre>
cd ..
+
[...]
dpkg -i linux-image-2.6.18-1-openvz_1_i386.deb
+
# device: %DEV%
update-initramfs -c -k 2.6.18-1-openvz
+
iface %DEV% inet static
update-grub
+
        address 192.168.0.2
 +
        netmask 255.255.255.0
 +
        network 192.168.2.0
 +
        broadcast 192.168.2.255
 +
        gateway 192.168.2.1
 +
 
 +
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1
 +
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0
 +
[...]
 
</pre>
 
</pre>
<small>Remark: the update-initramfs and update-grub are already automatically done when installing the package</small>
 
  
Just reboot into your new openvz-kernel.
+
or use the /etc/network/if-up/ and /etc/network/if-pre-down.d/ directories.
 +
 
 +
INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)
 +
 
 +
INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf
 +
 
 +
 
 +
plain OpenVZ Linux Way:
 +
 
 +
Add settings to "/etc/sysctl.conf"
 +
 
 +
<pre>
 +
# On Hardware Node we generally need
 +
# packet forwarding enabled and proxy arp disabled
 +
net.ipv4.ip_forward = 1
 +
net.ipv4.conf.default.proxy_arp = 0
 +
 
 +
# Enables source route verification
 +
net.ipv4.conf.all.rp_filter = 1
 +
 
 +
# Enables the magic-sysrq key
 +
kernel.sysrq = 1
 +
 
 +
# TCP Explict Congestion Notification
 +
# net.ipv4.tcp_ecn = 0
 +
 
 +
# we do not want all our interfaces to send redirects
 +
net.ipv4.conf.default.send_redirects = 1
 +
net.ipv4.conf.all.send_redirects = 0
 +
</pre>
 +
 
 +
 
 +
<pre>
 +
INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ
 +
(Debian vz root directory is installed FHS-like to /var/lib/vz)
 +
 
 +
# ln -s /var/lib/vz /vz
 +
</pre>
 +
 
 +
 
 +
'''Before you restart you Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''
 +
 
 +
 
 +
# reboot
 +
 
 +
 
 +
 
 +
That's all!
 +
 
 +
Now it's time to create a OS Template or download another precreated OS-Template.
 +
 
 +
 
 +
INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf
 +
 
 +
 
  
 
[[Category: HOWTO]]
 
[[Category: HOWTO]]
 
[[Category: Installation]]
 
[[Category: Installation]]

Revision as of 22:58, 8 January 2007

Sarge (Stable)

The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some task are done on install process!


edit apt source settings

Add to your "/etc/apt/sources.list"

 deb http://debian.systs.org/ stable openvz

and get the new package lists

# apt-get update


precompiled kernel images at debian.systs.org (dso)

The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ. (most kernel-modules are built-in!)

kernel(s) for i368 and amd64

 ovzkernel-2.6.9      
 ovzkernel-2.6.9-smp

 ovzkernel-2.6.16      
 ovzkernel-2.6.16-smp

 ovzkernel-2.6.18      
 ovzkernel-2.6.18-smp

i386 only:

 ovzkernel-2.6.18-enterprise    

OpenVZ tool(s) for i386 and amd64

 vzctl
 vzquota
 vzprocps

template(s) for i368 and amd64 : Debian 3.1 Minimal

 vzctl-ostmpl-debian


installing the kernel-images, toolset and debian-os-template

Example: install the stable OpenVZ kernel, tools and Debian OS Template

# aptitude install ovzkernel-2.6.9 vzctl vzquota vzctl-ostmpl-debian


Maybe you need to update you "linux-loader" (can be configured at /etc/kernel-img.conf)

for the "GRUB":

# /sbin/grub-update 


Reboot in your new Debian Stable OpenVZ System

# reboot


That's all :-)

Now it's time to setup your VE's with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.


Etch (Testing)

OpenVZ is now a part of Debian Etch (a.k.a. "testing") repository.

install the kernel-image

use precomiled kernel images

Can be found at http://download.openvz.org/kernel/debian/etch/

List of precompiled kernel-images

 linux-image-2.6.18-openvz-486_02_i386.deb
 linux-image-2.6.18-openvz-686_02_i386.deb
 linux-image-2.6.18-openvz-amd64_01_amd64.deb
 linux-image-2.6.18-openvz-ia64_01_ia64.deb
 linux-image-2.6.18-openvz-k7_02_i386.deb
 linux-image-2.6.18-openvz-sparc64-smp_01_sparc.deb
 linux-image-2.6.18-openvz-sparc64_01_sparc.deb       

Example: Installing an OpenVZ precompiled Debian Kernel-Image for an i686:

 # wget http://download.openvz.org/kernel/debian/etch/linux-image-2.6.18-openvz-686_02_i386.deb
 # dpkg -i linux-image-2.6.18-openvz-686_02_i386.deb


or build your own kernel-image (debian way)

To install the kernel-source and the OpenVZ kernel patch, run:

 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev


Unpack the kernel-source:

 # cd /usr/src
 # tar xjf linux-source-2.6.18.tar.bz2
 # cd linux-source-2.6.18


You need a kernel config. You can use the config of the debian-kernel:

 # cp /boot/config-2.6.18-3-686 .config


Or get a 2.6.18 kernel config from http://download.openvz.org/kernel/devel/current/configs/

 # wget http://download.openvz.org/kernel/devel/current/configs/kernel-2.6.18-028test007-i686.config.ovz -O .config


Now you can apply openvz kernel patch and modify your kernel-config:

 # ../kernel-patches/all/apply/openvz
 # make menuconfig


You need following OpenVZ kernel config settings:



Compile your Kernel (as user root, or you need the --fakerootcmd!)

 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 kernel_image --initrd


Install the kernel and update initramfs:

 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb
 # update-initramfs -c -k 2.6.18-1-openvz


INFO: update-initramfs is done, when make-kpkg is use with --initrd option
INFO: update-grub can be configured by /etc/kernel-img.conf


Update the bootloader (when not done above)

GRUB :

# /usr/sbin/update-grub
INFO: since the Debian ETCH-release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub !


install the toolset

You need the toolset for manage-ing OpenVZ Virtual Enviromennt (VE)

 # apt-get install vzctl vzquota


modify needed settings

Debian Way:

If you want network access for the virtual server then you need to enable IP forwarding. Set "ip_forward" to yes in /etc/network/option.

# editor /etc/network/options


In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on. You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).

Example:

[...]
# device: %DEV%
iface %DEV% inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.2.0
        broadcast 192.168.2.255
        gateway 192.168.2.1

        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=1
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0
 [...]

or use the /etc/network/if-up/ and /etc/network/if-pre-down.d/ directories.

INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)
INFO: Please add to use the magic-sysrq key, to your /etc/sysctl.conf


plain OpenVZ Linux Way:

Add settings to "/etc/sysctl.conf"

 # On Hardware Node we generally need
 # packet forwarding enabled and proxy arp disabled
 net.ipv4.ip_forward = 1
 net.ipv4.conf.default.proxy_arp = 0

 # Enables source route verification
 net.ipv4.conf.all.rp_filter = 1

 # Enables the magic-sysrq key
 kernel.sysrq = 1

 # TCP Explict Congestion Notification
 # net.ipv4.tcp_ecn = 0

 # we do not want all our interfaces to send redirects
 net.ipv4.conf.default.send_redirects = 1
 net.ipv4.conf.all.send_redirects = 0 


 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ
 (Debian vz root directory is installed FHS-like to /var/lib/vz)

 # ln -s /var/lib/vz /vz


Before you restart you Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.


# reboot


That's all!

Now it's time to create a OS Template or download another precreated OS-Template.


INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf