Install Xen on Ubuntu (refer to)

Source: Internet
Author: User
Tags bz2 xen hypervisor

This article is written in Debian on the source of the installation of Xen when the time to write together, originally thought that Ubuntu and Debian very similar, the difference is small, the configuration process can be directly applied without major changes, try to know is not so simple. Ubuntu 9.10 uses Grub 2.0, and proven bugs can cause Xen not to boot normally under Grub 2.0, so a workaround approach is to remove Grub 2.0 and use the old version of Grub. Vpsee doesn't like the latest version of Ubuntu on the server because the Ubuntu update is too fast and the release is too frequent, causing many older versions of the problem to start spot the new version, right, today seems to be the release date of Ubuntu 10.04 LTS. The following operations are recorded using the latest Xen 4.0.0 source code version and Ubuntu 9.10, and here is the process of installing the Xen code under CentOS. If you compile and install Xen 4.0.1 on Ubuntu 10.04, you may experience a xend startup problem. Install the required packages

Start by minimizing the installation of Ubuntu, and then installing the packages required to compile Xen and Linux Xen kernel:

$ sudo apt-get install gcc g++ make patch libssl-dev bzip2 gettext \
zlib1g-dev python libncurses5-dev libjpeg62-dev l Ibx11-dev \
libgcrypt11-dev pkg-config bridge-utils bcc bin86 libpci-dev \
Libsdl-dev Python-dev Libc6-dev Uuid-dev Bison flex fakeroot \ build-essential crash kexec-tools makedumpfile libncurses5  \
Libncurses5-dev IASL gawk

$ sudo apt-get build-dep Linux
installing Xen hypervisor and Tools

To http://www.xen.org/products/xen_source.html Download the latest Xen source code, and then untie, compile, install, standard Linux software source installation actions:

$ tar zxvf xen-4.0.0.tar.gz
$ cd xen-4.0.0/
$ make Xen tools stubdom
$ sudo make install-xen install-tools ins Tall-stubdom

The above make stubdom will automatically download some things from the Internet, so if you use a proxy to the Internet, you need to be in your own root directory. WGETRC plus proxy server so that wget can download through the normal agent:

$ vi. wgetrc
http_proxy = http://proxy.vpsee.com:3128/
use_proxy = On

To add to the automatic startup script:

$ sudo update-rc.d xend defaults
$ sudo update-rc.d xendomains defaults 21 20
Installing the Xen kernel

Download the Xen kernel and patch the kernel:

$ cd
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.8.tar.bz2
$ tar-xjf LINUX-2.6.31.8.TAR.BZ2

$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.31-10.tar.bz2
$ mkdir xenpatch-2.6.31.8
$ cd xenpatch-2.6.31.8
$ TAR-XJF. /XEN-PATCHES-2.6.31-10.TAR.BZ2
$ CD.

$ CD linux-2.6.31.8
$ for i ' LS.. /xenpatch-2.6.31.8/'; Do Patch-p1 <. /xenpatch-2.6.31.8/"$i"; Done

Configure the kernel to directly handcuff the system's existing configuration file and modify it on this basis:

$ cp/boot/config-2.6.31-14-server. config $ make menuconfig Processor type and features---> [*] Enable Xen compatible kernel networking support---> Networking options---> <*> 802.1d Ethernet bridgin  G Device Drivers---> XEN---> [*] privileged Guest (domain 0) backend driver Support Block-device Backend driver Block-device tap backend driver Block-device tap backend Driver 2 Network-device back End driver Pci-device Backend driver SCSI backend driver USB backend driver <*> Block-devic E frontend driver <*> network-device frontend driver SCSI frontend driver USB frontend driver < *> framebuffer-device frontend driver <*> keyboard-device frontend driver [*] Disable serial Port Drive RS <*> Export Xen attributes in Sysfs Xen version compatibility (3.3.0 and later)---> 3.3 .0 and later 

After you configure the kernel parameters, you can save the configuration file and exit the configuration interface to start compiling the Linux kernel:

$ make
$ sudo make install
$ sudo make modules_install
$ sudo update-initramfs-c-K 2.6.31.8
$ sudo depmo D 2.6.31.8

If Xen adds a kernel module, add the/etc/modules file to load automatically at startup:

$ sudo vi/etc/modules ...
NETBK
BLKBK

Ubuntu 9.10 defaults to Grub 2.0, and proven bugs can cause Xen not to start properly, removing GRUB 2.0 for older versions of Grub:

$ sudo apt-get purge grub-pc
$ sudo rm/boot/grub/*
$ sudo apt-get install grub
$ sudo grub-install--rechec K/DEV/SDA
$ sudo update-grub
$ sudo vi/boot/grub/menu.lst

Reboot the system, you should be able to enter the DOM0:

$ sudo reboot
Troubleshooting

If rebooting the system goes into DOM0 but executes the XM command times error:

$ sudo xm list
error:unable to connect to xend:no such file or directory. is Xend running?

Checking Xen logs and discovering ' Permission denied ' issues is also a common problem because Xen tools and the kernel do not match:

$ vi/var/log/xen/xend.log ...
[2010-04-16 11:55:57 2320] INFO (srvdaemon:219) Xend exited with status 1.
[2010-04-16 13:56:04 13207] Info (srvdaemon:331) xend Daemon started
[2010-04-16 13:56:04 13207] INFO (srvdaemon:335) xend changeset:unavailable .
[2010-04-16 13:56:04 13207] ERROR (srvdaemon:347) Exception starting Xend ((), ' Permission denied ')
...

$ vi/var/log/xen/xend-debug.log ...
Xend started at Fri Apr 13:56:04.
Domctl operation failed--need to rebuild the User-space tool set?
Sysctl operation failed--need to rebuild the User-space tool set?
Exception starting Xend: (+, ' Permission denied ') ...

So the solution is to download the corresponding Xen kernel version and Xen tools.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.