Install and configure the XEN Virtual Machine Under CentOS5

Source: Internet
Author: User
Tags dmesg

Install and configure the XEN Virtual Machine Under centos 5: The original installation media is centos 5, the software package is not updated, and all files are installed with the DVD. The initial installation is minimal installation. The software package management adopts the yum method and the yum library has been made locally. By default, this document uses the root user permission for installation and configuration. For more information about the meaning of command parameters, see-help. Modify the parameters to suit your needs, including parameters such as name, network, and file. 1. install xen # yum-y install xen * to install the services required by XEN # yum-y install kernel-xen * to install the relevant kernel of XEN 2. Check whether the startup options are started using the xen kernel 1. Check whether the xen Kernel File is correctly installed: file located in/boot # ls-lh/boottotal 9.5M-rw-r -- 1 root 61 K Mar 16 config-2.6.18-8.el5-rw-r -- r -- 1 root 60 K Mar 16 config-2.6.18-8.el5xendrwxr-xr-x 2 root 1.0 K Aug 15 grub-rw ------- 1 root 1.5 M Aug 13 initrd-2.6.18-8.el5.img-rw ------- 1 root 1. 5 M Aug 15 initrd-2.6.18-8.el5xen.imgdrwx ------ 2 root 12 K Aug 13 lost + found-rw-r -- 1 root 79 K Apr 1 message-rw-r -- r -- 1 root 82 K Mar 16 symvers-2.6.18-8.el5.gz-rw-r -- r -- 1 root 83 K Mar 16 symvers-2.6.18-8.el5xen.gz-rw-r -- r -- 1 root 865 K Mar 16 System. map-2.6.18-8.el5-rw-r -- r -- 1 root 848 K Mar 16 System. map-2.6.18-8.el5xen-r W-r -- 1 root 1.7 M Mar 16 vmlinuz-2.6.18-8.el5-rw-r -- r -- 1 root 2.0 M Mar 16 vmlinuz-2.6.18-8.el5xen-rw-r -- r -- 1 root 269 K Mar 16 xen.gz- 2.6.18-8. el5-rwxr-xr-x 1 root 595 K Mar 16 xen-syms-2.6.18-8.el5 2. Check grub configuration # cat/boot/grub. conf # grub. conf generated by anaconda # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a/boot partition. this means that # all kernel and initrd paths are relative to/boot/, eg. # root (hd0, 0) # kernel/vmlinuz-version ro root =/dev/sda3 # initrd/initrd-version.img # boot =/dev/sdadefault = 1 timeout = 5 splashimage = (hd0, 0) /grub/splash.xpm.gz hiddenmenutitle CentOS (2.6.18-8. el5xen) root (hd0, 0) kernel/xen.gz-2.6.18-8. el5module/vmlinuz-2.6.18-8.el5xen ro root = LABEL =/module/initrd-2.6. 18-8.el5xen.imgtitle CentOS (2.6.18-8. el5) root (hd0, 0) kernel/vmlinuz-2.6.18-8.el5 ro root = LABEL =/initrd/initrd-2.6.18-8.el5.img modify where default = 1 is default = 0, enable xen kernel 3. restart the computer 4. log on to the system after restart, and check whether XEN runs normally 4.1 # xm listName ID Mem (MiB) VCPUs State Time (s) domain-0 0 3919 4 r ----- 16.9 The above result indicates that xen starts the normal 4.2 Check log: # ls-lh/var/log/xentotal 8.0K-rwxr-xr-x 1 root 36 Aug 15 xend-debug.log-rw-r -- r -- 1 root ro Ot 1.8 K Aug 15 xend. log # cat/var/log/xen/xend-debug.logNothing to flush. Nothing to flush. It means everything works and our XEN service in CentOS5 has started successfully. So far, our CentOS5 host machine is ready for installation. 3. Install the XEN Linux Client System-CentOS 5.x 1. create the image file 1.1 using dd to create # dd if =/dev/zero of = centos5.img bs = 2 k seek = 4096 k count = 1 create the main disk of the Client # dd if =/dev/zero of = swap. img bs = 2 k seek = 512 k count = 1 create a client swap Disk 2. Create a configuration file 2.1 required Installation tool since the previous installation was based on minimal installation, in this case, you need to add a software virt-manager for installing the client system. Now install: # yum-y install virt-manager. Note that this software package is a graphical Management Program under gnome, therefore, you need to install a large number of dependent packages ...... I forgot the package name. The delay was 2 hours ...... 2.2 start to install the Client # virt-install-n centos5-r 512 -- vcpus = 2 -- file = centos5.img -- file = swap. img -- nographics-lhttp: // 192.168.0.11/yum/ba... in this case, if the machine CPU supports VT technology, you will be asked if you need to enable VT support. Generally, no is selected. If yes is supported, you will be asked to enter the optical drive or a CD. Wocould you like a fully initialized alized guest (yes or no )? This will allow you to run unmodified operating systems. noStarting install... 2.3 start the installation program of the client. Due to remote and text installation, some ssh clients may be in disorder. Please try. The installation of the operating system on this part is the same as that on the general network, we will not describe it in detail here. We recommend that you use swap to swap partitions. The primary partition has one boot and one root partition. Add 2.4 to the installation source (the simplest method). Enable the httpd service on a server with CentOS5 installed, copy the entire CentOS5 DVD disk to/var/www/html/yum/base. After installing the client, a centos5 file is generated under/etc/xen. refer to the configuration file centos5: name = "centos5" memory = "768" disk = ['Tap: ai/opt/xen/centos5/centos5.img, xvda, W', 'Tap: ai/opt/xen/centos5/swap. img, xvdb, W',] vif = ['bridge = xenbr0',] bootloader = "/usr/bin/pygrub" vcpus = 2on_reboot = 'restart' on _ cras H = 'restart' 4. Prerequisites for installing XEN Windows client: the CPU of the host computer supports intel VT or AMD-v of amd, and the corresponding options are enabled in BIOS. 1. Check if support for VT: # xm info | grep xen_capxen_caps: xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p # xm dmesg | grep-I vmxon (XEN) VMXON is done (XEN) VMXON is done: if the above field is displayed, the computer supports VT. Otherwise, it is likely that it is not supported or the BIOS is disabled. You can also use xm dmesg or cpuinfo to query the data. 2. Enable vnc # yum-y install vnc * # vi/etc/xen/xend-config.sxp for graphical Remote Installation to edit the following content (Please modify as needed) :( vnc-listen '2017. 168.0.xxx ') (vncpasswd 'Password') the modification can also be modified in the file of the corresponding client. 3. Restarting the computer actually does not require restarting the computer. You only need to restart the xend service, but it is difficult to restart the service successfully, so simply restart: 4. Install windows and prepare the disk image file, run # virt-install-n mini-r 768 -- vcpus = 2 -- file = mini. img -- vnc-v-c/opt/yum/pwinxp. the following prompt should appear in iso: Starting install... unable to connect to graphical console; DISPLAY is not set. please connect to localhost: 5900 Domain installation still in progress. you can reconnect to the console to complete the installati On process .!! Note that this method is suitable for host machines to enable the xwin graphics system and operate on the host machine. 4.1 check the vnc listener # netstat-anp | grep 5900tcp 0 0 192.168.0.xxx: 5900 0.0.0.0: * The preceding result of LISTEN 2748/qemu-dm indicates that vnc is enabled (xwin is not required for remote host ). The listening port may change. The default value is 590X. 4.2 we recommend that you use the realvnc Client to connect to the vnc client! Ultravnc will be flushed after connection, which is almost impossible to operate. The password is the password set in step 2 or in the configuration file. 4.3 during windows installation, if the screen is stopped on the following screen or restarted continuously: the screen is mainly stopped on starting windows... this problem is generally caused by ACPI on the blue interface of. Please press F7 when prompted to press F2 or F6 after the boot disc starts, disable ACPI, or use the following configuration file mini. hvm is forced to close directly: import OS, rearch = OS. uname () [4] if re. search ('64', arch): arch_libdir = 'lib64' else: arch_libdir = 'lib' kernel = "/usr/lib/xen/boot/hvmloader" name = "mini" builder = "hvm" memory = "768" shadow_memory = 8 disk = ['File: /opt/xen/mini. img, hda, W', 'file:/opt/yum /Pwinxp. iso, hdc: cdrom, R',] vif = ['Type = ioemu, bridge = xenbr0',] device_model = "/usr/lib/xen/bin/qemu-dm" kernel = "/usr/lib/xen/boot/hvmloader" vnc = 1 vnclisten = "192.168.0.xxx" vncdisplay = 1 vncpasswd = 'Password' vncunused = 1 apic = 0 acpi = 0pae = 1 boot = "dc" vcpus = 2 serial = "pty" # enable serial restart leon_reboot = 'restart' on _ crash = 'restart' please note that we didn't use the separate cdrom = "/opt/yum/en2003entsp2 for cdrom. the following error occurs when using iso: the error is cdro. M startup error. Error Code 0002: quickly start the vnc client to view the startup information (modify the configuration file). Note that the installation will restart after the configuration file is modified for the first time, modify the boot sequence to boot = "c" before restarting. In the future, you can remove or modify the cdrom option in the disk, or add or delete disk information. 5. other instructions can also be used to install linux systems with xwin. Enabling vnc is only required for installation. We recommend that you disable it in general! After Windows is installed, install remote control software such as vnc or radmin on the client and disable the vnc option in the configuration file to ensure the security of the host.

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.