Compiling Xen
This document currently assumes you are using Fedora/RHEL/CentOS to do the compilation. For other distributions (ie. Ubuntu/Debian), you'll need to use the respective package management software to get the packages.
Installing packages required for compiling Xen from sources
For more information about installing Xen 4.0 from sources please see Xen4.0 wiki page.
Install required development tools and libraries:
# yum groupinstall "Development Libraries" # yum groupinstall "Development Tools"
At the time of writing these downloads were around 100 MB and 105 MB in size.
Then install some additional packages required for building Xen from sources and running it:
# yum install transfig wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel pciutils-libs pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML qemu-common qemu-img mercurial
At the time of writing these downloads were around 98 MB in size.
You also need to install 32bit version of glibc-devel, it's required as well:
# yum install glibc-devel.i686
Now all the required packages are installed and you can move forward.
Building Xen rpm binaries from src.rpm source package
You can get the xen src.rpm source package from Fedora koji.
For the purposes of this tutorial, we're using Fedora's Xen 4.0.1-6 rpm, which contains some backported bugfixes from Xen 4.0.2.
Download and install the src.rpm source package:
# wget http://pasik.reaktio.net/fedora/xen-4.0.1-6.fc14.src.rpm # rpm -i xen-4.0.1-6.fc14.src.rpm
Then rebuild the source package to generate binary rpms:
# cd /root/rpmbuild/SPECS # rpmbuild -bb xen.spec
After a while when the build process finishes you should see output like:
Wrote: /root/rpmbuild/RPMS/x86_64/xen-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-libs-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-runtime-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-hypervisor-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-doc-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-devel-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-licenses-4.0.1-6.fc13.x86_64.rpm Wrote: /root/rpmbuild/RPMS/x86_64/xen-debuginfo-4.0.1-6.fc13.x86_64.rpm
Install the newly built rpms: (Note: This assumes you have already satisfied the dependencies for installing Xen)
# cd /root/rpmbuild/RPMS/x86_64/ # rpm -Uvh *4.0.1-6*.rpm Preparing... ########################################### [100%] 1:xen-licenses ########################################### [ 13%] 2:xen-libs ########################################### [ 25%] 3:xen-hypervisor ########################################### [ 38%] 4:xen-runtime ########################################### [ 50%] 5:xen ########################################### [ 63%] 6:xen-devel ########################################### [ 75%] 7:xen-doc ########################################### [ 88%] 8:xen-debuginfo ########################################### [100%]