Installation and Operation of xen Virtual Machine in centos 5.8

Source: Internet
Author: User

The company's new server ibm3650m4 (12g memory, 900g hard disk, cpuE5-2400), intends to engage in xen virtualization above. I checked many documents and finally succeeded.

1. Check whether the machine's CPU supports virtualization.

CAT/proc/cpuinfo | grep flags: If PAE is displayed in the result, semi-virtualization is supported. If vmx or SVM is displayed, full virtualization is supported.

2. You can install xen in two ways.

2.1 xen virtualization can be added to the graphic interface when the system is installed on new machines.

2.2 install the system using the command line.

3. Use Yum to automatically resolve dependencies. Yum install xen kernel-xen-y

4. Modify the default value to support xen startup.

Vim/boot/grup. conf modify default = 0

5. restart the system reboot.

6. Check the kernel: uname-R.

7. Install the system on xen. I chose NFS. NFS: Host IP: Directory

8 Mount/dev/CDROM/media mount the disc

9 echo "/media 192.168.1.0/24 (RO)">/etc/exports restart/etc/init. d/nfs restart

10 modify the host name to AA. Modify/etc/hosts so that the local host can be resolved to AA (PING)

Check whether showmount-e aa is effective

11 disable firewall and sefenforce

12 mkdir/data/xen/create a directory

13 create a 4G file to install the VM

Dd If =/dev/Zero of =/data/xen/vm01.img BS = 1 m COUNT = 4096

14. Install virtual machines

Virt-install-N vm01-r 256-F/data/xen/vm01.img -- nographics-l NFS: 192.168.1.100:/Media

-N: followed by the Virtual Machine name, configured under/etc/xen

-R: Memory allocated at least 256 m

-F: the disk file created later

-L: The Path to be installed later

-- Nographics: Do not use graphical interfaces

Note: if it is set up in VMware, ensure that the host machine has enough memory (preferably 4G). Otherwise, an error will be reported.

After the installation is complete, you can view the XM list.

15 common xen commands

XM list

XM shutdown vm01 shut down the VM

Switch XM console vm01 to the virtual machine. If you want to switch back, command: Ctrl +]

XM create/etc/xen/vm01 start Virtual Machine

XM reboot vm01 restart

XM destroy vm01 destroy Virtual Machine

Two Methods for copying a large number of virtual machines on xen

1 CP/etc/xen/vm01/etc/xen/vm02 CP/data/xen/vm01.img/data/xen/vm02.img

Modify the configuration file Vim/etc/xen/vm02 in the new VM vm02.

Ensure that the name, Mac, path, and UUID are different from that of the first VM vm01.

2. clone a VM

Virt-clone-O vm01-N vm02 -- force-F/data/xen/vm02.img

-O: model board-N: new Virtual Machine name-F New Virtual Machine storage path

 

Note: The. imgfile of the cloned VM is smaller than that of the VM, but the system size is normal. After testing, the. imgfile is automatically resized to the same size as that of the VM.

When installing virtual machines, you should select full virtualization and default network. to ping the Virtual Machine and host machine, you must change the virtual machine configuration file under/etc/xen/vm01, change the bridge in to bridge = xenbr0.

 

 

 

 

 

 

 

This article from the "Linux O & M beginner" blog, please be sure to retain this source http://ht712.blog.51cto.com/9397612/1555032

Installation and Operation of xen Virtual Machine in centos 5.8

Related Article

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.