This method is used to install the default xen of centos 5.4. During installation, it is best to switch the kernel to the default kernel of centos 5.4. I have tried this process on another kernel before, the installation is normal, but a series of problems occur after startup.
The advantage of using Yum to install software is that Yum automatically handles dependencies between software packages and does not need to install related packages one by one.
Using Yum can easily install the default xen of centos 5.4;
(1) create a local Yum Source:
The purpose of creating the local source is to make the installation faster.
Copy the content in the DVD disk of centos 5.4 or the ISO image (which can be mounted). The command for mounting the ISO image is Mount-o loop *. ISO /***;
Put the directory in the directory of the Apache HTTP Server or create a soft link to the image directory under the HTTP server, for example, create a directory under Apache HTTP Web home directory/opt/apache-httpd-2.2.14/htdocs pointing to a directory that stores the centos5.4 image;
Finally, http: // 10.10.97.6/mirror/centos/is included in the centos 5.4 CD;
To install the Apache HTTP Server, see
Installation and configuration of Apache HTTP Server in Linux
Or directly use the official image http://vault.centos.org/5.4/ OS /x86_64/
(2) modify the yum configuration file:
[Root @ gmnode14 ~] # Vim/Etc/yum. Repos. d/CentOS-Base.repo
--------------------------------------------------------------
[Base]
Name = centos-$ releasever-Base
Baseurl = http: // 10.10.97.6/mirror/centos/
# Or official image http://vault.centos.org/5.4/ OS /x86_64/
# Or use a local directoryBaseurl = file: // opt/mirror/centos/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
# Or
#Gpgkey = http: // 10.10.97.6/mirror/centos/RPM-GPG-KEY-CentOS-5
# Released updates
[Updates]
Name = centos-$ releasever-Updates
Baseurl = http: // 10.10.97.6/mirror/centos/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
# Packages used/produced in the build but not released
[Addons]
Name = centos-$ releasever-Addons
Baseurl = http: // 10.10.97.6/mirror/centos/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
# Additional packages that may be useful
[Extras]
Name = centos-$ releasever-extras
Baseurl = http: // 10.10.97.6/mirror/centos/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = centos-$ releasever-plus
Baseurl = http: // 10.10.97.6/mirror/centos/
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
# Contrib-packages by centos users
[Contrib]
Name = centos-$ releasever-contrib
Baseurl = http: // 10.10.97.6/mirror/centos/
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-5
---------------------------------------------------------------
After yum is set, you can install xen.
If any errors occur during Yum installation, see Common Errors During Yum usage.
(3) install the xen Toolkit
[Root @ gmnode14 ~] # Yum-y install xen *-y indicates that yes is selected for all
......
Installed:
Xen. x86_64 0: 3. 0.3-94. EL5 xen-devel.i386. 0.3-94. EL5 xen-devel.x86_64. 0.3-94. EL5 xen-libs.i386. 0.3-94. EL5 xen-libs.x86_64. 0.3-94. EL5
Dependency installed:
Bridge-utils.x86_64. 1-2 celt051.x86 _ 64. 5.1.3-0. EL5 iscsi-initiator-utils.x86_64. 2.0.871-0.10.el5 kernel-xen.x86_64. 6.18-164. EL5
Kvm-qemu-img.x86_64 0: 83-105.el5 libvirt. x86_64. 6.3-20. EL5 libvirt-python.x86_64. 6.3-20. EL5 log4cpp. x86_64. 0-4.el5
Python-virtinst.noarch. 400.3-5. EL5 qcairo. x86_64. 8.7.1-3. EL5 qffmpeg-libs.x86_64. 4.9-0.15.20080908.el5 qpixman. x86_64. 13.3-4. EL5
Qspice-libs.x86_64 0: 0. 3.0-39. EL5
Complete!
(4) install Virtual Machine Management Software virt-Manager
[Root @ gmnode14 ~] # Yum-y install virt-Manager
.......
Installed:
Virt-manager.x86_64 0: 0. 6.1-8. EL5
Dependency installed:
Gnome-python2-gnomekeyring.x86_64 0: 2. 16.0-3. EL5 gtk-vnc.x86_64 0: 0. 3.8-3. EL5 gtk-vnc-python.x86_64 0: 0. 3.8-3. EL5
Complete!
(5) install the virtual machine to view the software virt-Viewer
[Root @ gmnode14 ~] # Yum-y install virt-Viewer
(6) install the xen kernel (that is, patch the current kernel)
[Root @ gmnode14 ~] # Yum-y install kernel-xen *
......
Installed:
Kernel-xen-devel.x86_64. 6.18-164. EL5
After the patch is installed, check the files in/boot to check whether the installation is successful.
[Root @ gmnode14 ~] # Ll/boot/| grep xen
-RW-r -- 1 Root 65547 config-2.6.18-164.el5xen
-RW ------- 1 Root 2741808 04-20 18:47Initrd-2.6.18-164.el5xen.img just generated
-RW-r -- 1 Root 108127 symvers-2.6.18-164.el5xen.gz
-RW-r -- 1 Root 1194532 2009-09-03 system. map-2.6.18-164.el5xen
-RW-r -- 1 Root 2029734 vmlinuz-2.6.18-164.el5xen
-RW-r -- 1 Root 409051 2009-09-03 xen.gz-2.6.18-164. EL5
-Rwxr-XR-x 1 Root 961616 xen-syms-2.6.18-164.el5
Modify the/etc/grub. conf file and select the new kernel.
Default = 0
Timeout = 5
Splashimage = (hd0, 0)/GRUB/splash.xpm.gz
Hiddenmenu
# This kernel is built by yuanlin
Title centos (2.6.18-164. el5xen)
Root (hd0, 0)
Kernel/xen.gz-2.6.18-164. EL5
Module/vmlinuz-2.6.18-164.el5xen Ro root = label =/rhgb quiet
Module/initrd-2.6.18-164.el5xen.img
Title centos (2.6.34.7)
Root (hd0, 0)
Kernel/vmlinuz-2.6.34.7 Ro root = label =/rhgb quiet
Initrd/initrd-2.6.34.7.img
(7) restart the system
Enter the system and use xen
[Root @ gmnode14 ~] # Uname-R: Check the system kernel, which is the kernel we just selected.
2.6.18-164. el5xen
[Root @ glnode04 yum. Repos. d] # rpm-Q virt-Manager
Virt-manager-0.5.3-8.el5
[Root @ glnode04 yum. Repos. d] # rpm-Q xen
Xen-3.0.3-64.el5
[Root @ glnode04 yum. Repos. d] # rpm-Q xen-libs
Xen-libs-3.0.3-64.el5
[Root @ glnode04 yum. Repos. d] # rpm-Q kernel-xen
Kernel-xen-2.6.18-92.el5
[Root @ glnode04 yum. Repos. d] # rpm-Q Python-embedded Inst
Python-virtinst-0.300.2-8.el5
[Root @ glnode04 yum. Repos. d] # rpm-Q Python
Python-2.4.3-21.el5
[Root @ gmnode14 ~] # Xend
Usage:/usr/sbin/xend {START | stop | restart}
[Root @ gmnode14 ~] # Xend stop
[Root @ gmnode14 ~] # Xend start
[Root @ gmnode14 ~] # Xend status
[Root @ gmnode14 ~] # Cat/Var/log/xen/xend-debug.log.(View log status)
[Root @ gmnode14 ~] # XM List View Virtual Machine nodes
Name id mem (MIB) vcpus state time (s)
Domain-0 0 7625 8 R ----- 30.5
OK, we can see that domain-0 is in the running state, the memory is 7625 MB, the number of CPUs is 8, and it is in the running state;
Domain-0 is actually an xen virtual machine, which is started when we start the system and used to manage other virtual machines;