个人工具

“UbuntuHelp:XenVirtualMachine/XenOnUbuntuBreezy”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(正在重定向到 UbuntuHelp:XenVirtualMachine
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
 +
#REDIRECT [[UbuntuHelp:XenVirtualMachine]]
 +
This document is obsolete and so was deleted. For installing Xen, go to [[UbuntuHelp:XenVirtualMachine|XenVirtualMachine]]
 +
----
 +
[[category:CategoryCleanup]]
 
{{From|https://help.ubuntu.com/community/XenVirtualMachine/XenOnUbuntuBreezy}}
 
{{From|https://help.ubuntu.com/community/XenVirtualMachine/XenOnUbuntuBreezy}}
 
{{Languages|UbuntuHelp:XenVirtualMachine/XenOnUbuntuBreezy}}
 
{{Languages|UbuntuHelp:XenVirtualMachine/XenOnUbuntuBreezy}}
This HOWTO-style page describes a manual install of Xen 3.0 on Ubuntu 5.10.  Please see [[UbuntuHelp:XenVirtualMachine|XenVirtualMachine]] for an overview of Xen, or [[UbuntuHelp:XenOnUbuntuBinaryInstall|XenOnUbuntuBinaryInstall]] to use the precompiled kernel from Xen Source.
 
This document is updated from the previous half-complete effort using Xen 2.0 (JackWasey)
 
=== Overview ===
 
At the moment, installing [[Xen]] on Breezy Badger requires installing from source.  Making the Xen hypervisor and tools are not strictly necessary; however, we will want to compile the 2.6.12 kernel ourselves in order to stick closely with the kernel Ubuntu expects. This work has been tested on i386 architecture. It is likely that Ubuntu kernel patches and Xen kernel patches will conflict for some configurations and architectures. Please comment this wiki if you have to do anything differently to make it work.
 
The goal is to use the ubuntu-patched kernel as closely as possible, with additional Xen patches.
 
=== Requirements ===
 
These are the recommended packages to build Xen.  Also, Xen does not seem to build with GCC 4.0, so we need an older version.
 
We will need the Ubuntu kernel source in order to make th
 
* grub
 
* bridge-utils
 
* iproute
 
* python2.4-twisted-bin
 
* libcurl3
 
* libcurl3-dev
 
* zlib1g
 
* zlib1g-dev
 
* python2.4-dev
 
* make
 
* gcc-3.4
 
=== Kernel ===
 
We will need to use the testing version of Xen, because it supports the 2.6.12 kernel.
 
* linux-source-2.6.12
 
* kernel-package
 
I succeeded using xen-testing 3.0.1
 
== Downloading Xen ==
 
Go to the [http://www.xensource.com/downloads/ download page] and get the xen-3.0-testing-src.tgz file and unpack it. The sources can be compiled without root privileges, but they are needed to install the xen kernel.
 
== Make Targets ==
 
The Makefile structure of Xen is quite complicated, with various includes. Note that the default build is for Xen developers. For normal use (including drivers for handy things like hard disk controllers and video drivers) the -xen (as opposed to -xen0 or -xenU) build should be used. This can be used as either the privileged (xen0) or unprivileged (xenU) domain. Compiling xen0 or xenU kernels just leaves out large numbers of drivers so that the Xen developers can test more quickly.
 
To specify this, edit the KERNELS target in the toplevel Makefile:
 
<pre><nowiki>
 
#KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
 
KERNELS ?= linux-2.6-xen
 
</nowiki></pre>
 
[[JackWasey]] I used the Breezy default GCC 4.0.2 without any problems.
 
For your information, you can run <code><nowiki>make help</nowiki></code> to see what the Xen builder can build.
 
== Compiling the Easy Stuff ==
 
=== Xen Hypervisor ===
 
Compile the Xen hypervisor by making the "xen" target.  Remember to use GCC version 3.4.
 
<pre><nowiki>
 
# make CC=gcc-3.4 xen
 
</nowiki></pre>
 
Confirm that the build was successful by showing that the make returned successful.
 
<pre><nowiki>
 
# echo $?
 
0
 
</nowiki></pre>
 
=== Xen Tools ===
 
Compile the Xen tools by making the "tools" target.  Remember to use GCC version 3.4.
 
<pre><nowiki>
 
# make CC=gcc-3.4 tools
 
</nowiki></pre>
 
Confirm that the build was successful by showing that the make returned successful.
 
<pre><nowiki>
 
# echo $?
 
0
 
</nowiki></pre>
 
== Compiling the Kernel ==
 
=== Patching ===
 
I run a "make world" to allow the xen scripts to automatically fetch the kernel archive that it wants (seems to be 2.6.12.tar.gz for Xen 3.0.1-testing). If you use a different kernel archive, e.g. ubuntu pre-patched or 2.6.12.xx then the xen patches probably will not apply correctly.
 
<pre><nowiki>
 
sudo apt-get install linux-patch-ubuntu-2.6.12
 
</nowiki></pre>
 
package which contains the ubuntu patches against the 2.6.12 kernel. This puts a patch-2.6.12-*.*.bz2 file in /usr/src/linux-patches/i386/2.6.12/debian/.
 
bunzip2 this file.
 
In the unzipped xen source folder, we are interested in the linux-2.6.12-xen tree.
 
in that kernel tree:
 
Note: the above line is not fully clear, at least not to newbies. Can you be more specific with exactly which folder I should be in when I type the following line?
 
<pre><nowiki>
 
patch -f -p1 < ../patch-2.6.12
 
</nowiki></pre>
 
This gives quite a few patch errors. I think this is because ubuntu patches overlap with the 2.6.12 -> 2.6.12.6 kernel patches. Many are not for i386, or drivers that I use; they may be a problem for you. Please annotate your solutions here.
 
You need to add a declaration for pcibios_disable_irq() in xen-3.0-testing/linux-2.6.12-xen/arch/xen/i386/pci/irq.c:
 
<pre><nowiki>
 
--- irq.c.orig  2006-02-23 17:47:38.000000000 +1100
 
+++ irq.c      2006-02-23 17:48:07.000000000 +1100
 
@@ -55,6 +55,7 @@
 
        int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);
 
};
 
 
+void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
 
int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
 
 
/*
 
</nowiki></pre>
 
You must also correct a patching error against zlib.h. This function is defined twice, and you have to remove one definition. This is the diff I get:
 
<pre><nowiki>
 
--- include/linux/zlib.h        2006-02-20 11:15:43.000000000 +0000
 
+++ include/linux/zlib.h.orig  2006-02-20 09:56:33.000000000 +0000
 
@@ -506,11 +506,6 @@
 
    stream state was inconsistent (such as zalloc or state being NULL).
 
*/
 
 
-/*static inline unsigned long deflateBound(unsigned long s)
 
-{
 
-      return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
 
-} */
 
-
 
static inline unsigned long deflateBound(unsigned long s)
 
{
 
        return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
 
</nowiki></pre>
 
=== Config and Compilation ===
 
With the patches above, it should compile fine if certain kernel features are disabled.
 
I used the instructions in README in the root of the unzipped xen source. This tells you to use:
 
<code><nowiki>make linux-2.6-xen-config</nowiki></code> (from the root of the xen unzip, not the -xen kernel tree)
 
menuconfig is the default, giving the normal ncurses interface for kernel configuration.
 
<code><nowiki>make linux-2.6-xen-build</nowiki></code>is then used to build the -xen kernel, and
 
<code><nowiki>sudo make linux-2.6-xen-install</nowiki></code> puts everything apart from initramfs images in place in /boot and /lib/modules/2.6.12.6-xen/.
 
I grepped the default xen config for the string XEN and appended this to the default ubuntu config.
 
(if you ran make world, xen will already have put the default -xen config in place (.config in the linux-2.6.12-xen tree)).
 
from the unzip root (/usr/local/src/xen/ in my case), not the -xen tree root, I did:
 
<pre><nowiki>
 
mv linux-2.6.12-xen/.config config.xenorig
 
cp /boot/config-2.6.12-10-k7 linux-2.6.12-xen/.config
 
grep XEN config.xenorig >> linux-2.6.12-xen/.config
 
</nowiki></pre>
 
You now have the XEN arch extras at the end of the original ubuntu config.
 
If you try to build now, loads of things will fail. All I did was to remove the config for the items that failed. I didn't document each one, but I'll attach or paste my .config in due course. I also removed a lot of cruft I didn't need, and some of this may be important for ubuntu functions that you use (like a GUI). You might like to start with my .config, and if anything is broken, try to add things. Alternatively, start from the config built as above, and use make-2.6-xen-config then -build over and over again until you have removed offending items.
 
See [[XenOnBreezyKernelConfig]] for my config which compiled and runs ubuntu breezy as dom0.
 
Once the compile completes without errors, <code><nowiki> echo $? </nowiki></code> should give 0, do <pre><nowiki>
 
 
sudo make linux-2.6-xen-install
 
sudo depmod 2.6.12.6-xen
 
cd /boot
 
mkinitramfs -k -o initrd-2.6.12.6-xen 2.6.12.6-xen
 
</nowiki></pre>
 
you may wish to symlink initrd 2.6.12 to 2.6.12.6 for consistency with the xen vmlinuz file.
 
I inserted the following grub stanza in position 0 (before the AUTO CONFIGURE section):
 
<pre><nowiki>
 
title  Xen3.0
 
root    (hd0,0)
 
kernel /xen.gz
 
module /vmlinuz-2.6.12-xen root=/dev/mapper/Ubuntu-root ro console=tty0
 
module /initrd-2.6.12-xen.img
 
boot
 
</nowiki></pre>
 
then rebooted...
 
<pre><nowiki>
 
# uname -r
 
2.6.12.6-xen
 
</nowiki></pre>
 
== Missing Packages ==
 
Depending on your install and packages added to Breezy, you may need to add packages to complete the '''./install.sh''' step successfully. I found these are required for 5.10.
 
* '''latex'''
 
* '''fig2dev'''
 
=== XmTest test framework ===
 
A requirement to build the test framework using autoconf, please read the '''README''':
 
* ./autogen && ./configure
 
I received this error when using autogen, it did not stop the build but is noted here:
 
* configure.ac: 61: automake requires `AM_PROG_LEX', not `AC_PROG_LEX'
 
Reference for more information:
 
*[http://wiki.xensource.com/xenwiki/XmTest XmTest Test Framework]
 
==== Missing Packages ====
 
The test suite on the 3.0.1 unstable tree required the following missing packages:
 
* '''flex'''
 
* '''bison'''
 
* '''gettext'''
 
* '''g++'''
 
== Additional Information ==
 
Below are some links to other pages from which I derived this method.
 
* [http://www.xensource.com/xen/documentation/ The Xensource Documentation]
 
* The [http://www.xensource.com/files/xen_user_manual.pdf Xen User's Manual], from that page
 
* XenVirtualMachine/XenOnUbuntuHoary, which explains how to do the same with Ubuntu 5.04.
 
* [http://wiki.xensource.com/xenwiki/InstallationNotes Installation notes]
 
----
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年4月23日 (三) 12:07的最新版本

This document is obsolete and so was deleted. For installing Xen, go to XenVirtualMachine