System Environment: ubuntu 11.04 desktop
Step 1: Prepare the source code and patch package
Xen 4.0.1
Linux Kernel 2.6.38.4
Xen-patches-2.6.38-2
Kernel configuration file --. config
Config.txt http://up.2cto.com/2012/0312/20120312020354999.txt
Because the blog attachment format is supported, after Downloading this file, change it to ". config"
Three xen patch files (in the attachment ):
Gcc-4.5.txthttp: // up.2cto.com/2012/0312/20120312020410240.txt
Blk_linux.txthttp: // up.2cto.com/2012/0312/20120312020109867.txt
Xmlrpc.txt http://up.2cto.com/2012/0312/20120312020458664.txt.
Because the blog attachment format is supported, after Downloading this file, change its format to ". Pattern"
Step 2: package required for system installation
1. sudo apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive- fonts-recommended pciutils-dev mercurial build-essential make gcc g ++ libc6-dev zlib1g-dev libncurses5-dev python-dev python-twisted libjpeg62-dev patch libvncserver-dev libsdl-dev libbz2-dev iasl e2fslibs-dev git-core uuid -dev ocaml libx11-dev bison flex libssl-dev gettext libgcrypt11-dev pkg-config fakeroot crash kexec-tools makedumpfile libncurses5
2. sudo apt-get build-dep linux
3. apt-get install gcc-multilib
4. apt-get install xz-utils
Step 3: Compile xen
Use the rootuser to copy the downloaded xen-4.0.1.tar.gz to/usr/src
Copy three xen patch files to/usr/src
Cd/usr/src
Tar zxvf xen-4.0.1.tar.gz
Cd xen-4.0.1
Cat ../blk_linux.pattern | patch-p1
Cat./gcc-4.5.patch1 | patch-p1
Cat ../xmlrpc. Pattern | patch-p1
Make xen
Mke tools
Make stubdom
Make install-xen
Make install-tools PYTHON_PREFIX_ARG =
Make install-stubdom
Step 4: Compile the kernel
Use rootto copy the downloaded linux-2.6.38.4.tar.gzand xen-patches-2.6.38-2.tar.bz2 to/usr/src.
Tar zxvf linux-2.6.38.4.tar.gz
Tar xvf xen-patches-2.6.38-2.tar.bz2
Cd linux-2.6.38.4
Cat ../xen-patches/*. pates | patch-p1
Copy the. config file to linux-2.6.38.4
Make menuconfig
Make
Make install
Make modules_install
Update-initramfs-c-k 2.6.38.4
Depmod 2.6.38.4
Add the kernel module of Xen to the/etc/modules file to enable automatic loading during system startup:
Vi/etc/modules
Netbk
Blkbk
Blktap
Step 5: Modify grub
Grub2 is used in Ubuntu 11.04, and Grub2 is incompatible with Xen, so grub2 is downgraded to grub:
Apt-get purge grub-pc
Rm/boot/grub /*
Apt-get install grub
Grub-install-recheck/dev/sda
Update-grub
Manually add the Start menu and add the following content to/boot/grub/menu. lst:
Title Xen 4.0.1/Linux 2.6.38.4
Kernel/boot/xen-4.0.gz
Module/boot/vmlinuz-2.6.38.4 root = [root-location] ro cnsole = tty0
Module/boot/initrd. img-2.6.38.4
Step 6: restart
If no accident occurs, it will be successfully set up. You can run the following command to test:
Ps-ef | grep xend
Xm list
Author sunjiangang-OK