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 Xen virtual machine in CentOS system

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains how to install and use Xen virtual machine in CentOS system. Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn how to install and use Xen virtual machine in CentOS system.

I. Principle explanation

The concept of virtualization: abstracting server physical resources into logical resources, turning a server into several or even hundreds of virtual servers isolated from each other, we are no longer limited by physical boundaries, but turning cpu, memory, disk, i/o and other hardware into "resource pools" that can be dynamically managed, thereby improving resource utilization, simplifying system management, realizing server consolidation, and making it more adaptable to business changes--------

Xen is currently the best virtualization solution on linux, especially suitable for server applications, such as for consolidating multiple servers on a physical server to save operating costs (room space, power consumption), or for security reasons, different applications need to be partitioned to reduce security risks.

1. Noun:

Full virtualization: fully virtualized

Paravirtualization: Paravirtualized

xen running environment: domain-0 and domain-u

Domain-0 is the virtual host machine or host machine, which is the same system as the linux host machine. The host machine started with the linux kernel of xen is responsible for managing and controlling the client machine.

Domain-u is virtual client or vps, and multiple virtual clients can be established on domain-0.

The difference between domain-0 and domain-u is that domain-0 is the virtual machine and domain-u is the operating system on the virtual machine. Those who have used vmware on windows can think of domain-0 as vmware software, domain-u as the operating system running on vmware.

3, xen operation mode:

Xen is executed in multiple layers. It modifies the linux kernel, boots it with the modified kernel, loads the xen hypervisor, and boots the first operating system, called domain-0. A domain in xen refers to a virtual machine.

Domain-0 is loaded first because domain-0 contains control instructions necessary to start other virtual machines, and domain-0 is also an important host system for controlling virtual devices. The most important thing on domain-0 is a resident process of xend, and all other domains are managed by this xend. In terms of naming, virtual machines other than domain-0 are called domain-1, domain-2, etc., and we collectively refer to domain-u.

Domain-0 is important because it directly controls xen's hypervisor and has real linux drivers. Other virtual machines (domain-u) interact with real hardware and domain-0 via the xen monitor. In order for domain-0 to combine with xen, we must modify the core of domain-0 to run smoothly. You need to use the core of domain-0 to boot. Domain-0 is the basis of all virtual machines, so it can be as simple as possible, and other individual services can be placed in different domains without pop fashion. xend manages the startup and interaction between domain-0 and other domains, providing a console interface for domain-0 to log into other domains.

II. Necessary conditions

1. Hardware Description:

Please open virtual technology about cpu in server bios settings; please search carefully because brand and model are different.

2, the system view CPU does not support virtualization

Check CPU support for virtualization:

Intel and amd's semi-virtualization support identification-pae

# cat /proc/cpuinfo | grep flags flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx constant_tsc pni ssse3

intel full virtualization support logo- vmx

# cat /proc/cpuinfo | grep flags flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc up pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm

amd full virtualization support identity-svm

# cat /proc/cpuinfo | grep flags flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy 3dnowprefetch ts fid vid ttp tm stc 100mhzsteps

Third, the initial xen

1. Configure local CD yum

Centos systems can use local sources simply by mounting the disc.

2. Install xen

#yum install xen kernel-xen xen-lib virt-manager python-virtinst -y

3. Role understanding

kernel-xen: Linux kernel that can run xen

xen: The main xen suite, including configuration files, startup scripts, and some libraries

xen-libs: library of functions required by xen

python-virtinst: software that provides terminal installation

virt-manager: for graphical interface management xen

View/etc/grub.conf

Select the kernel with xen and change to using the kernel

#init 6

After reboot, check kernel

#uname -r

2.6.18-274.12.1.e15xen

#xm list

domain-0

IV. Installation of xen (graphical)

1. Open "Application" centos xen installation and use

2. Open System Tools and select Virtual System.

3. Select "localhost" and right-click "New"

4. Click "Forward"

5. Virtual machine naming

6. Choose the system architecture, most of which are determined by the CPU.

7. Select boot mode (iso, pxe)

8, designated location

Specify the hard disk size (allocate entire virtual disk now uses the entire hard disk)

10. Designated network

11. Specify the memory size

12. Virtual machine information

13. Start "Create"

14. Installation background

5. Common error descriptions and solutions

1. Unable to retrieve error occurred when installing client operating system via http or nfs: ...

Most of the reasons are caused by firewalls. If you use http installation mode, you can stop the firewall first, or you can solve the following problems:

Query whether port 80 or netstat tunlp is open by iptables -l command| grep httpd

open port

iptables -i input -s 192.168.0.2/24 -p tcp --dport 80 -j accept service iptables save

An error similar to the following occurs:

post operation failed: xend_post: error from xen daemon: (xend.err 'error creating domain: i need 262144 kib, but dom0_min_mem is 262144 and shrinking to 262144 kib would leave only 244672 kib free. ')

Description of the new virtual host memory settings are too high, and then the memory can be adjusted to a small point.

At this point, I believe that everyone has a deeper understanding of "how to install and use Xen virtual machine in CentOS system," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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

Internet Technology

Wechat

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

12
Report