| 1 | ################################ |
|---|
| 2 | __ __ _____ ___ |
|---|
| 3 | \ \/ /___ _ __ |___ / / _ \ |
|---|
| 4 | \ // _ \ '_ \ |_ \| | | | |
|---|
| 5 | / \ __/ | | | ___) | |_| | |
|---|
| 6 | /_/\_\___|_| |_| |____(_)___/ |
|---|
| 7 | |
|---|
| 8 | ################################ |
|---|
| 9 | |
|---|
| 10 | http://www.xensource.com/xen/about.html |
|---|
| 11 | |
|---|
| 12 | What is Xen? |
|---|
| 13 | ============ |
|---|
| 14 | |
|---|
| 15 | Xen is a Virtual Machine Monitor (VMM) originally developed by the |
|---|
| 16 | Systems Research Group of the University of Cambridge Computer |
|---|
| 17 | Laboratory, as part of the UK-EPSRC funded XenoServers project. Xen |
|---|
| 18 | is freely-distributable Open Source software, released under the GNU |
|---|
| 19 | GPL. Since its initial public release, Xen has grown a large |
|---|
| 20 | development community, spearheaded by XenSource Inc, a company created |
|---|
| 21 | by the original Xen development team to build enterprise products |
|---|
| 22 | around Xen. |
|---|
| 23 | |
|---|
| 24 | The 3.0 release offers excellent performance, hardware support and |
|---|
| 25 | enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and |
|---|
| 26 | live relocation of VMs. This install tree contains source for a Linux |
|---|
| 27 | 2.6 guest; ports to Linux 2.4, NetBSD, FreeBSD and Solaris are |
|---|
| 28 | available from the community. |
|---|
| 29 | |
|---|
| 30 | This file contains some quick-start instructions to install Xen on |
|---|
| 31 | your system. For full documentation, see the Xen User Manual. If this |
|---|
| 32 | is a pre-built release then you can find the manual at: |
|---|
| 33 | dist/install/usr/share/doc/xen/pdf/user.pdf |
|---|
| 34 | If you have a source release, then 'make -C docs' will build the |
|---|
| 35 | manual at docs/pdf/user.pdf. |
|---|
| 36 | |
|---|
| 37 | Quick-Start Guide - Pre-Built Binary Release |
|---|
| 38 | ============================================ |
|---|
| 39 | |
|---|
| 40 | [NB. Unless noted otherwise, all the following steps should be |
|---|
| 41 | performed with root privileges.] |
|---|
| 42 | |
|---|
| 43 | 1. Install the binary distribution onto your filesystem: |
|---|
| 44 | |
|---|
| 45 | # sh ./install.sh |
|---|
| 46 | |
|---|
| 47 | Among other things, this will install Xen and Xen-ready Linux |
|---|
| 48 | kernel files in /boot, kernel modules and Python packages in /lib, |
|---|
| 49 | and various control tools in standard 'bin' directories. |
|---|
| 50 | |
|---|
| 51 | 2. Configure your bootloader to boot Xen and an initial Linux virtual |
|---|
| 52 | machine. Note that Xen currently only works with GRUB and pxelinux |
|---|
| 53 | derived boot loaders: less common alternatives such as LILO are |
|---|
| 54 | *not* supported. You can most likely find your GRUB menu file at |
|---|
| 55 | /boot/grub/menu.lst: edit this file to include an entry like the |
|---|
| 56 | following: |
|---|
| 57 | |
|---|
| 58 | title Xen 3.0 / XenLinux 2.6 |
|---|
| 59 | kernel /boot/xen-3.0.gz console=vga |
|---|
| 60 | module /boot/vmlinuz-2.6-xen root=<root-dev> ro console=tty0 |
|---|
| 61 | module /boot/initrd-2.6-xen.img |
|---|
| 62 | |
|---|
| 63 | NB: Not all kernel configs need an initial ram disk (initrd), but |
|---|
| 64 | if you do specify one you'll need to use the 'module' grub directive |
|---|
| 65 | rather than 'initrd'. |
|---|
| 66 | |
|---|
| 67 | The linux command line takes all the usual options, such as |
|---|
| 68 | root=<root-dev> to specify your usual root partition (e.g., |
|---|
| 69 | /dev/hda1). |
|---|
| 70 | |
|---|
| 71 | The Xen command line takes a number of optional arguments described |
|---|
| 72 | in the manual. The most common is 'dom0_mem=xxxM' which sets the |
|---|
| 73 | amount of memory to allocate for use by your initial virtual |
|---|
| 74 | machine (known as domain 0). Note that Xen itself reserves about |
|---|
| 75 | 32MB memory for internal use, which is not available for allocation |
|---|
| 76 | to virtual machines. |
|---|
| 77 | |
|---|
| 78 | 3. Reboot your system and select the "Xen 3.0 / XenLinux 2.6" menu |
|---|
| 79 | option. After booting Xen, Linux will start and your initialisation |
|---|
| 80 | scripts should execute in the usual way. |
|---|
| 81 | |
|---|
| 82 | Quick-Start Guide - Source Release |
|---|
| 83 | ================================== |
|---|
| 84 | |
|---|
| 85 | First, there are a number of prerequisites for building a Xen source |
|---|
| 86 | release. Make sure you have all the following installed, either by |
|---|
| 87 | visiting the project webpage or installing a pre-built package |
|---|
| 88 | provided by your Linux distributor: |
|---|
| 89 | * GCC v3.4 or later |
|---|
| 90 | * GNU Make |
|---|
| 91 | * GNU Binutils |
|---|
| 92 | * Development install of zlib (e.g., zlib-dev) |
|---|
| 93 | * Development install of Python v2.3 or later (e.g., python-dev) |
|---|
| 94 | * Development install of curses (e.g., libncurses-dev) |
|---|
| 95 | * Development install of openssl (e.g., openssl-dev) |
|---|
| 96 | * Development install of x11 (e.g. xorg-x11-dev) |
|---|
| 97 | * bridge-utils package (/sbin/brctl) |
|---|
| 98 | * iproute package (/sbin/ip) |
|---|
| 99 | * hotplug or udev |
|---|
| 100 | |
|---|
| 101 | [NB. Unless noted otherwise, all the following steps should be |
|---|
| 102 | performed with root privileges.] |
|---|
| 103 | |
|---|
| 104 | 1. Download and untar the source tarball file. This will be a |
|---|
| 105 | file named xen-unstable-src.tgz, or xen-$version-src.tgz. |
|---|
| 106 | You can also pull the current version from the SCMS |
|---|
| 107 | that is being used (Bitkeeper, scheduled to change shortly). |
|---|
| 108 | |
|---|
| 109 | # tar xzf xen-unstable-src.tgz |
|---|
| 110 | |
|---|
| 111 | Assuming you are using the unstable tree, this will |
|---|
| 112 | untar into xen-unstable. The rest of the instructions |
|---|
| 113 | use the unstable tree as an example, substitute the |
|---|
| 114 | version for unstable. |
|---|
| 115 | |
|---|
| 116 | 2. cd to xen-unstable (or whatever you sensibly rename it to). |
|---|
| 117 | The Linux, netbsd and freebsd kernel source trees are in |
|---|
| 118 | the $os-$version-xen-sparse directories. |
|---|
| 119 | |
|---|
| 120 | On Linux: |
|---|
| 121 | |
|---|
| 122 | 3. For the very first build, or if you want to destroy existing |
|---|
| 123 | .configs and build trees, perform the following steps: |
|---|
| 124 | |
|---|
| 125 | # make world |
|---|
| 126 | # make install |
|---|
| 127 | |
|---|
| 128 | This will create and install onto the local machine. It will build |
|---|
| 129 | the xen binary (xen.gz), and a linux kernel and modules that can be |
|---|
| 130 | used in both dom0 and an unprivileged guest kernel (vmlinuz-2.6.x-xen), |
|---|
| 131 | the tools and the documentation. |
|---|
| 132 | |
|---|
| 133 | You can override the destination for make install by setting DESTDIR |
|---|
| 134 | to some value. |
|---|
| 135 | |
|---|
| 136 | The make command line defaults to building the kernel vmlinuz-2.6.x-xen. |
|---|
| 137 | You can override this default by specifying KERNELS=kernelname. For |
|---|
| 138 | example, you can make two kernels - linux-2.6-xen0 |
|---|
| 139 | and linux-2.6-xenU - which are smaller builds containing only selected |
|---|
| 140 | modules, intended primarily for developers that don't like to wait |
|---|
| 141 | for a full -xen kernel to build. The -xenU kernel is particularly small, |
|---|
| 142 | as it does not contain any physical device drivers, and hence is |
|---|
| 143 | only useful for guest domains. |
|---|
| 144 | |
|---|
| 145 | To make these two kernels, simply specify |
|---|
| 146 | |
|---|
| 147 | KERNELS="linux-2.6-xen0 linux-2.6-xenU" |
|---|
| 148 | |
|---|
| 149 | in the make command line. |
|---|
| 150 | |
|---|
| 151 | If you want to build an x86_32 PAE capable xen and kernel to work |
|---|
| 152 | on machines with >= 4GB of memory, use XEN_TARGET_X86_PAE=y on the |
|---|
| 153 | make command line. |
|---|
| 154 | |
|---|
| 155 | 4. To rebuild an existing tree without modifying the config: |
|---|
| 156 | # make dist |
|---|
| 157 | |
|---|
| 158 | This will build and install xen, kernels, tools, and |
|---|
| 159 | docs into the local dist/ directory. |
|---|
| 160 | |
|---|
| 161 | You can override the destination for make install by setting DISTDIR |
|---|
| 162 | to some value. |
|---|
| 163 | |
|---|
| 164 | make install and make dist differ in that make install does the |
|---|
| 165 | right things for your local machine (installing the appropriate |
|---|
| 166 | version of hotplug or udev scripts, for example), but make dist |
|---|
| 167 | includes all versions of those scripts, so that you can copy the dist |
|---|
| 168 | directory to another machine and install from that distribution. |
|---|
| 169 | |
|---|
| 170 | 5. To rebuild a kernel with a modified config: |
|---|
| 171 | |
|---|
| 172 | # make linux-2.6-xen-config CONFIGMODE=menuconfig (or xconfig) |
|---|
| 173 | # make linux-2.6-xen-build |
|---|
| 174 | # make linux-2.6-xen-install |
|---|
| 175 | |
|---|
| 176 | Depending on your config, you may need to use 'mkinitrd' to create |
|---|
| 177 | an initial ram disk, just like a native system e.g. |
|---|
| 178 | # depmod 2.6.16-xen |
|---|
| 179 | # mkinitrd -v -f --with=aacraid --with=sd_mod --with=scsi_mod initrd-2.6.16-xen.img 2.6.16-xen |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | Python Runtime Libraries |
|---|
| 183 | ======================== |
|---|
| 184 | |
|---|
| 185 | Xend (the Xen daemon) has the following runtime dependencies: |
|---|
| 186 | |
|---|
| 187 | * Python 2.3 or later. |
|---|
| 188 | In many distros, the XML-aspects to the standard library |
|---|
| 189 | (xml.dom.minidom etc) are broken out into a separate python-xml package. |
|---|
| 190 | This is also required. |
|---|
| 191 | |
|---|
| 192 | URL: http://www.python.org/ |
|---|
| 193 | Debian: python, python-xml |
|---|
| 194 | |
|---|
| 195 | * For optional SSL support, pyOpenSSL: |
|---|
| 196 | URL: http://pyopenssl.sourceforge.net/ |
|---|
| 197 | Debian: python-pyopenssl |
|---|
| 198 | |
|---|
| 199 | * For optional PAM support, PyPAM: |
|---|
| 200 | URL: http://www.pangalactic.org/PyPAM/ |
|---|
| 201 | Debian: python-pam |
|---|
| 202 | |
|---|
| 203 | * For optional XenAPI support in XM, PyXML: |
|---|
| 204 | URL: http://pyxml.sourceforge.net |
|---|
| 205 | YUM: PyXML |
|---|