Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Xen using third-party sources in CentOS

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people don't understand the knowledge points of this article "How to use third-party sources to install Xen in CentOS", so Xiaobian summarizes the following contents for everyone. The contents are detailed, the steps are clear, and they have certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "How to use third-party sources to install Xen in CentOS".

Xen is an open source project developed by the University of Cambridge Computer Lab. A software layer that runs directly on top of the computer hardware to replace the operating system, enabling multiple guest operating systems to run concurrently on the computer hardware.

1. environment

Hardware: HP DL360 G6(E5520,16G,2*146GB) System version: CentOS-6.6-x86_64-minimal.iso

2. System initialization wget http://blog.linuxeye.com/lnmp-full.tar.gztar xzf lnmp-full.tar.gzcd lnmp./ install.sh #All select nochkconfig iptables off #Close iptables3. Install bridge-utilsyum -y install bridge-utils4. Install crc.id.au Install Source yum -y install http://au1.mirror.crc.id.au/repo/el6/x86_64/kernel-xen-release-6-7.noarch.rpm5. install xen virtualization yum -y install xenls -l /boot/xen. gzlrwxrwx 1 root root 12 Dec 1 18: 42/boot/xen.gz-> xen-4.2.5.gzchkconfig xend on #Configure the xend service to boot automatically 6. yum -y install kernel-xen

Note: kernel-xen installation depends on kernel-xen-firmware. Since these two packages are relatively large, it is recommended to download them locally and use yum -y localinstall kernel-xen* to complete the installation.

cat /boot/grub/grub.conf

#As shown below:

7. Configure NIC to bridge mode

Create a new file **/etc/sysconfig/network-scripts/ifcfg-xenbr0** and keep the following contents:

DEVICE=xenbr0TYPE=BridgeONBOOT=yesDELAY=0NM_CONTROLLED=noBOOTPROTO=staticIPADDR=192.168.3.20NETMASK=255.255.255.0GATEWAY=192.168.3.1

Modify **/etc/sysconfig/network-scripts/ifcfg-eth0** to keep the contents as follows:

DEVICE=eth0HWADDR=F4:CE:46:85:64:34TYPE=EthernetUUID=c27373b9-a698-4ac8-9afe-a4dee87f5704ONBOOT=yesBRIDGE=xenbr0NM_CONTROLLED=noservice network restart #Restart network 8. restart the server

Restart the system and enter the Linux kernel of Xen. The test is as follows:

9. Install virtualization management toolset yum -y install libvirt

libvirt provides a hypervisor agnostic API to securely manage guest operating systems running on hosts. libvirt is not a tool per se, it is an API that allows tools to be built to manage guest operating systems. Libvirt itself is built on an abstract concept. It provides a common API for common functionality implemented by supported hypervisors. libvirt started as a management API designed specifically for Xen and was later extended to support multiple virtual machine monitors.

service libvirtd startyum -y install python-virtinst

Contains a Python module that uses libvirt to boot the OS version inside the VM (e.g. commands: virt-install, virt-clone)

10. Configure OS installation sources

Mount CentOS-6.6-x86_64-minimal.iso at 192.168.3.10:81, and copy the file inside to centos6.6 in the root directory of apache website, so that you can access the installation image at http://192.168.3.10:81/centos6.6 on 192.168.3.20 Note: The image file.treeinfo is missing a line, resulting in no kernel found during installation of the system. Keep the middle section as follows:

[images-xen]kernel = images/pxeboot/vmlinuzinitrd = images/pxeboot/initrd.img11. Character interface installation CentOSmkdir -p /data/xenvirt-install -n vm21 -r 2048 --vcpus=2 --nographic --disk path=/data/xen/vm21.img,size=20 \-l http://192.168.3.10:81/centos6.6/--bridge=xenbr0,model=virtio

virt-install command parameters:

-n --name= client virtual machine name-r --ram= memory allocated by client virtual machine-u --uid = client UUID--vcpus=2 client vcpu count-v --hvm full virtualization-p --paravirt paravirtualization-l --location=localdir installation source--vnc using vnc--cdrom= optical drive installation path-s --file-size= using disk image size unit GB-f --file= Files used as disk images--disk= Use different options Use installation media as disks 12. Clone mirror virt-clone -o vm21 -n vm22 -f /data/xen/vm22.img13. Xen administrative command instance ls /etc/xen #xen configuration file directory xm list #Show virtual machine running status xm shutdown linux1 #Close Linux1 VM xm console Linux1 #Connect virtual machine linux1 console, connect to virtual machine above can switch to physical machine xm pause linux1 with key combination ctrl + ] #suspend virtual machine linux1 xm resume linux1 The requested URL/data/xen/linux2.img was not found on this server. #clone mirror xm create linux2 #Start virtual machine linux2 xm console linux2 sed -i 's@HWADDR=@#HWADDR =@g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's@IPADDR=.*$@ IPADDR=192.168.1.112@g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's@HOSTNAME=.*$@ HOSTNAME=linux2@g' /etc/sysconfig/network The above is about the content of this article on "How to use third-party sources to install Xen in CentOS". I believe everyone has a certain understanding. I hope the content shared by Xiaobian will be helpful to everyone. If you want to know more related knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report