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 and use the Xen virtual machine in CentOS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to install and use the Xen virtual machine in CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install and use the Xen virtual machine in CentOS".

1. Environment

Hardware: HP DL360 G6 (E5520pr 16G dint 2g 146GB)

System version: CentOS-6.6-x86_64-minimal.iso

two。 System initialization

The code is as follows:

Wget / / blog.linuxeye.com/lnmp-full.tar.gz

Tar xzf lnmp-full.tar.gz

Cd lnmp

. / install.sh # all choose no

Chkconfig iptables off # turn off iptables

3. Install bridge-utils

The code is as follows:

Yum-y install bridge-utils

4. Install the crc.id.au installation source

The code is as follows:

Yum-y install http://au1.mirror.crc.id.au/repo/el6/x86_64/kernel-xen-release-6-7.noarch.rpm

5. Install xen Virtualization

The code is as follows:

Yum-y install xen

Ls-l / boot/xen.gz

Lrwxrwxrwx 1 root root 12 Dec 1 18:42 / boot/xen.gz-> xen-4.2.5.gz

6. Install the xen kernel

The code is as follows:

Yum-y install kernel-xen

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

The code is as follows:

Cat / boot/grub/grub.conf # is shown below, and the next time it starts with the xen kernel

Chkconfig xend on # found that the xend server was not configured to boot after rebooting the system.

7. Configure the network card for bridging mode

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

The code is as follows:

DEVICE=xenbr0

TYPE=Bridge

ONBOOT=yes

DELAY=0

NM_CONTROLLED=no

BOOTPROTO=static

IPADDR=192.168.3.20

NETMASK=255.255.255.0

GATEWAY=192.168.3.1

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

The code is as follows:

DEVICE=eth0

HWADDR=F4:CE:46:85:64:34

TYPE=Ethernet

UUID=c27373b9-a698-4ac8-9afe-a4dee87f5704

ONBOOT=yes

BRIDGE=xenbr0

NM_CONTROLLED=no

Service network restart # restart the network

8. Restart the server

Restart the system and enter the Linux of the Xen kernel, and test the figure as follows:

9. Install the Virtualization Management tool set

The code is as follows:

Yum-y install libvirt

Libvirt provides a hypervisor-agnostic API to securely manage guest operating systems running on hosts. Libvirt itself is not a tool, it is an API that can build tools to manage guest operating systems. Libvirt itself is built on an abstract concept. It provides a common API for common functions implemented by supported hypervisors. Libvirt was originally a management API designed specifically for Xen and was later extended to support multiple hypervisors.

The code is as follows:

Service libvirtd start

Yum-y install python-virtinst

Contains a Python module that uses libvirt to start and install the operating system version inside the virtual machine (such as commands: virt-install, virt-clone)

10. Configure the operating system installation source

Mount CentOS-6.6-x86_64-minimal.iso on 192.168.3.10 apache 81 and copy the files inside to centos6.6 under the root directory of the apache website, so that the installation image can be accessed through http://192.168.3.10:81/centos6.6 on 192.168.3.20

Note: the image file .treeinfo is missing a line, so that kernel cannot be found when installing the system. Keep the middle segment as follows:

The code is as follows:

[images-xen]

Kernel = images/pxeboot/vmlinuz

Initrd = images/pxeboot/initrd.img

11. Character interface installation CentOS

The code is as follows:

Mkdir-p / data/xen

Virt-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-memory allocated by the ram= client virtual machine

-u-- uuid= client UUID

-- number of vcpu of vcpus=2 client

-v-- hvm full virtualization

-p-- paravirt paravirtualization

-l-- location=localdir installation source

-- vnc uses vnc

-c-the installation path of cdrom= optical drive

-s-- file-size= uses disk image size in GB

-f-- the file used by file= as a disk image

-- disk= uses different options as disk to use installation media

twelve。 Clone Mirror

The code is as follows:

Virt-clone-o vm21-n vm22-f / data/xen/vm22.img

Thank you for your reading, the above is the content of "how to install and use the Xen virtual machine in CentOS". After the study of this article, I believe you have a deeper understanding of how to install and use the Xen virtual machine in CentOS. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Servers

Wechat

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

12
Report