Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

How to use OpenVZ as a XEN guest OS (for x86 platform)

522 bytes removed, 07:38, 17 November 2010
m
Reverted edits by 59.99.12.127 (Talk) to last revision by Kir
=== Building from sources ===
==== Download/unpack ====
Download the package containing sources of Xen-3.1 and unpack it:
<pre>
# wget http://bits.xensource.com/oss-xen/release/3.1.0/src.tgz/xen-3.1.0-src.tgz
# gunzip tar xvzf xen-3.1.0-src.tgz# tar -xvf xen-3.1.0-src.tar
</pre>
 
==== Build ====
 
Change directory to ./xen-3.1.0-src:
<pre>
Building process will do the following:
* build hypervizor xen.gz
* download linux kernel sources 2.6.16 source from kernel.org, patch them with a set of xen patches * from sources obtained build the vmlinuz-2.6.16.33-xen XenLinux kernel that will be able to boot both in Dom0 and DomU
* build and install xm tool
==== Install ====
After building is complete run ./install.sh script:
<pre>
# ./install.sh
</pre>
As a result vmlinuz-2.6.16.33-xen, xen.gz will be placed to /boot, xm tool will be placed to /usr/sbin. Now it is time to create initrd for vmlinuz-2.6.16.33-xen. Check that /lib/modules contain recently created directory 2.6.16.3318-xen. If it is, type:
<pre>
# mkinitrd -f -v /boot/initrd-2.6.16.33-xen.img 2.6.16.3318-xen
</pre>
After initrd-2.6.16.3318-xen.img is succesfully created , update corresponding strings in /etc/grub.conf:
<pre>
title Xen Linux (2.6.16.33-xen)
root (hd0,1)
kernel /boot/xen.gz dom0_mem=1048576-128M module /boot/vmlinuz-2.6.16.33-xen ro root=LABEL=/ console=ttyS0,115200 console=tty silencelevel=8 module /boot/initrd-2.6.16.33-xen.img
</pre>
Xen 3.0 doesn't support TLS. To make xen work correct , disable TLS on your machine bu renaming /lib/tls to /lib/tls.disabled:
<pre>
# mv /lib/tls /lib/tls.disabled
</pre>
Check that kernel command line options are correct (after ro ...) and reboot the machine. In grub loader menu select "Xen Linux (2.6.16.33-xen)". In case of success - machine boots into Xen's Dom0 that is running vmlinuz-2.6.16.33-xen XenLinux. Now it is time to prepare OpenVZ XenLinux kernel for DomU.
== Installing OpenVZ XenLinux kernel ==
=== Install from rpm ===
Change directory to openvz and download Download rpm package with OpenVZ XenLinux kernel for x86:<pre># cd# cd openvz# wget from http://download.openvz.org/download/kernel/branches/rhel5-2.6.18/028stab034.1/ovzkernel-PAE-2.6.18-8.el5.xen.028stab034.i686.rpm</pre>
Install downloaded rpm:
<pre>
# rpm -ihv ovzkernel-PAExen-2.6.18-8.el5.xen.028stab033.i686*.rpm
</pre>
If something goes wrong during installation the prebuilt kernel - you can build the OpenVZ XenLinux kernel from sources as described below.
=== install Install from sources === Download OpenVZ kernel source rpm from http://openvz.org/download/kernel/rhel5/.
Download rpm with OpenVZ kernel sources:
<pre>
# wget http://download.openvz.org/kernel/branches/rhel5-2.6.18/028stab034.1/ovzkernel-2.6.18-8.el5.028stab034.1.src.rpm
</pre>
Unpack downloaded rpm package:
<pre>
# rpm2cpio ovzkernel-2.6.18-8.el5.028stab034.1*.src.rpm > ovzkernel-2.6.18-8.el5.028stab034.1.src.cpio# | cpio -i < ovzkernel-2.6.18-8.el5.028stab034.1.src.cpioid
</pre>
Check that ./kernel-ovz.spec contains the following strings: