search
HomeOperation and MaintenanceLinux Operation and MaintenanceWhat is the use of linux virtualization?

In Linux, virtualization can expand the capacity of hardware and simplify the reconfiguration process of software. Advantages of Linux virtualization: 1. Super resource allocation; 2. Reduce capital costs and operation and maintenance costs; 3. Minimize or eliminate downtime; 4. Improve the efficiency, effectiveness, agility and responsiveness of the IT department; 5. Speed ​​up the deployment of applications and resources; 6. Improve business continuity and disaster recovery capabilities; 7. Simplify data center management; 8. Reduce port conflicts.

What is the use of linux virtualization?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is Linux virtualization

Virtualization (Virtualization) is a resource management technology that combines various physical resources of the computer (CPU, memory, disk space , network adapter, etc.), it is abstracted, converted and presented, and can be divided and combined into one or more computer configuration environments, and can be re-divided and re-assembled to maximize the rational use of physical resources.

Virtualization technology is a technology that abstracts and converts physical computer resources into virtual computer resources for use by programs. The computer resources referred to here include computing control resources provided by the CPU, data storage resources provided by the hard disk, network transmission resources provided by the network card, etc.

Virtualization technology can expand the capacity of hardware and simplify the reconfiguration process of software. CPU virtualization technology can simulate multiple CPUs in parallel with a single CPU, allowing one platform to run multiple operating systems at the same time, and applications can run in independent spaces without affecting each other, thereby significantly improving computer work efficiency - Baidu Encyclopedia. Virtualization mainly refers to a special technology that provides users with an abstract, unified, simulated computing environment (called a virtual machine) by hiding the actual physical characteristics of a specific computing platform - IBM definition.

Advantages of Virtualization

(1) The resources are over-sized, such as 128G of physical memory, and 200G of memory can be allocated to the virtual machine. It is generally used in test environments and generally in production environments. Not recommended.

(2) Reduce capital costs and operation and maintenance costs

(3) Minimize or eliminate downtime

(4) Improve the efficiency, effectiveness and agility of the IT department stability and responsiveness

(5) Accelerate the deployment of applications and resources

(6) Improve business continuity and disaster recovery capabilities

(7) Simplify data center management

(8) Availability of true Software-Defined Data Center

(9) Reduce port conflicts

Common virtualization vendors and products

##OracleOracle VM VirtualBoxCitrixXen

Install the virtualization server platform (KVM)

1. Main software package

qemu-kvm https ://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b provides low-level simulation support for kvm

libvirt-daemon https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15blibvirtd daemon, manages virtual machines

libvirt-client https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b client software, providing client management commands

libvirt-daemon-driver gemu https://www.php.cn/link /93ac0c50dd620dc7b88e5fe05c70e15blibvirtd Connect gemu driver

virt-manager https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15bGraphic management tool

2. Preparation work

1) Prepare a device (the blogger here prepares a Centos7 server)

2) Turn off SELinux and firewall (may cause communication within the virtual machine to be impossible)

yum -y install kvm bridge-utils virt-v2v libgesttfs-tools libcanberra-gtk2 qemu-kvm.x86_64 qemu-kvm-tools.86_64 libvirt.x86_64 libvirt-cim.x86_64 libvirt-client.x86_64 lsbvirt-java.noarch libvirt-python.x86_64 libiscsidbus-devel virt-clone tunctl virt-manager python-virtinst virt-vieeer virt-top dejavu-lgc-sans-fonts nfs-utils epel-release

3. Start the libvirtd server

libvirtd provides services for managing virtual machines Interface, providing DNS, DHCP and other functions

1) Command

systemctl restart libvirtd
systemctl restart libvirtd

2) Example

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b systemctl restart libvirtd

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b systemctl restart libvirtd

4. Open the management tool

1) Command

virt-manager

2) Instance

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virt-manager

5. Click the icon to create a new virtual machine

What is the use of linux virtualization?

6. Choose how to install the operating system

Here select "Local install media (ISO image or CDROM)", click "ForWard"

What is the use of linux virtualization?

Note:

1) Local install media (ISO image or CDROM)

Local installation media (ISO image or CDROM)

2) Network Install(HTTPFTPor NFS)

Network Installation (HTTP, FTP or NFS)

3 ) Network Boot (PXE)

Network Boot (PXE)

4) Import existing disk image

Import existing disk image

7. Find the installation media

Select "Use ISO image", click "Browse..." select the ISO image location and click "ForWard"

What is the use of linux virtualization?

Note:

1) Use CDROM or DVD

Use CD or DVD

2) Use ISO image

Use ISO image

3)Automatically detect operating system based on install media

自动检测操作系统上的基础安装介质

8、设置内存大小和CPU数量,设置完毕后点击“ForWard”

What is the use of linux virtualization?

9、创建虚拟磁盘

勾选“Enable storage for this virtual machine”,创建并设置磁盘容量,点击“ForWard”

What is the use of linux virtualization?

注:

1)Enable storage for this virtual machine

为虚拟机启用存储

2)Create a disk image for the virtual machine

为虚拟机创建磁盘映像

3)Select or create custom storage

选择或创建自定义存储

10、准备开始安装,设置好虚拟机名称,点击“Finish”

What is the use of linux virtualization?

注:

1)Name:虚拟机名称

2)OS:系统名称

3)Install:安装操作系统方式

4)Memory:内存大小

5)CPUs:处理器数量

6)Storage:存储容量与位置

7)Customize configuration before install:安装前自定义配置

8)Network selection:网络设置

四、操作虚拟机

1、使用virsh命令工具

 virsh命令工具提供管理各虚拟机的命令接口,支持交互模式,包括查看、创建、停止、关闭等功能。

1)常用格式

virsh 控制指令 虚拟机名称 参数

2)命令

virsh

3)实例

[root@wangwu~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15bvirsh https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b启动virsh命令工具

欢迎使用virsh,虚拟化的交互式终端

输入:'help'来获得命令的帮助信息

'quit'退出

virsh https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b

2、查看虚拟化信息

查看KVM节点(服务器)信息

1)命令

virsh nodeinfo

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh nodeinfo https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b查看KVM节点(服务器)信息

CPU 型号: x86_64

CPU: 1

CPU 频率: 2600 MHz

CPU socket: 1

每个 socket 的内核数: 1

每个内核的线程数: 1

NUMA 单元: 1

内存大小: 1,048,576 KiB

列出虚拟机状态

1)命令

virsh list --all

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh list --all https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b列出所有虚拟机的状态

Id Name  State

6 centos7.0 shut off

查看指定虚拟机的信息

1)命令

virsh dominfo 虚拟机名称

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh dominfo centos7.0        https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b查看centos7.0虚拟机的信息

Id: 6

名称: centos7.0

UUID: 78fa5915-c060-4731-b4c5-bd4aaaea8fee

OS 类型: hvm

状态: running

CPU: 1

CPU 时间: 28.7s

最大内存: 1048576 KiB

使用的内存: 1048576 KiB

持久: 是

自动启动: 禁用

管理的保存: 否

安全性模式: none

安全性 DOI: 0

3、虚拟机开关机操作

启动|重启|关闭 指定的虚拟机

1)命令

virsh start 虚拟机名称
virsh reboot 虚拟机名称
virsh shutdown 虚拟机名称

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh start centos7.0  https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b启动centos7.0虚拟机

Domain centos7.0 started

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh list https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b验证

Id Name    State

6  centos7.0  running
[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh shutdown centos7.0  https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b关闭centos7.0虚拟机

Domain centos7.0 is being shutdown

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh list --all  https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b验证

Id Name    State

- centos7.0  shut off

强制关闭指定的虚拟机

1)命令

virsh destroy 虚拟机名称

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh destroy centos7.0 https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b强制关闭centos7.0虚拟机

Domain centos7.0 destroyed

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh list --all  https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b验证

Id Name    State

- centos7.0  shut off

将指定的虚拟机设为|取消开机自动运行

1)命令

virsh autostart 虚拟机名称
virsh autostart --disable 虚拟机名称

2)实例

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh autostart centos7.0 https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b 设置centos7.0虚拟机自启动           

 Domain centos7.0 marked as autostarted

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh dominfo centos7.0 https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b验证

Id:

Name: centos7.0

... ... ...

Autostart: enable

... ... ...
[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh autostart --disable centos7.0 https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b 取消centos7.0虚拟机自启动  

Domain centos7.0 unmarked as autostarted

[root@wangwu ~]https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b virsh dominfo centos7.0 https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b验证

Id:

Name: centos7.0     

... ... ...

Autostart: disable

... ... ...

相关推荐:《Linux视频教程

Series

##Common PC/Server Version

VMware

VMware Workstation, vSphere

Microsoft

VirtualPC, Hyper-V

RedHat

KVM, RHEV

The above is the detailed content of What is the use of linux virtualization?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is Maintenance Mode in Linux? ExplainedWhat is Maintenance Mode in Linux? ExplainedApr 22, 2025 am 12:06 AM

MaintenanceModeinLinuxisaspecialbootenvironmentforcriticalsystemmaintenancetasks.Itallowsadministratorstoperformtaskslikeresettingpasswords,repairingfilesystems,andrecoveringfrombootfailuresinaminimalenvironment.ToenterMaintenanceMode,interrupttheboo

Linux: A Deep Dive into Its Fundamental PartsLinux: A Deep Dive into Its Fundamental PartsApr 21, 2025 am 12:03 AM

The core components of Linux include kernel, file system, shell, user and kernel space, device drivers, and performance optimization and best practices. 1) The kernel is the core of the system, managing hardware, memory and processes. 2) The file system organizes data and supports multiple types such as ext4, Btrfs and XFS. 3) Shell is the command center for users to interact with the system and supports scripting. 4) Separate user space from kernel space to ensure system stability. 5) The device driver connects the hardware to the operating system. 6) Performance optimization includes tuning system configuration and following best practices.

Linux Architecture: Unveiling the 5 Basic ComponentsLinux Architecture: Unveiling the 5 Basic ComponentsApr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

Linux Operations: Utilizing the Maintenance ModeLinux Operations: Utilizing the Maintenance ModeApr 19, 2025 am 12:08 AM

Linux maintenance mode can be entered through the GRUB menu. The specific steps are: 1) Select the kernel in the GRUB menu and press 'e' to edit, 2) Add 'single' or '1' at the end of the 'linux' line, 3) Press Ctrl X to start. Maintenance mode provides a secure environment for tasks such as system repair, password reset and system upgrade.

Linux: How to Enter Recovery Mode (and Maintenance)Linux: How to Enter Recovery Mode (and Maintenance)Apr 18, 2025 am 12:05 AM

The steps to enter Linux recovery mode are: 1. Restart the system and press the specific key to enter the GRUB menu; 2. Select the option with (recoverymode); 3. Select the operation in the recovery mode menu, such as fsck or root. Recovery mode allows you to start the system in single-user mode, perform file system checks and repairs, edit configuration files, and other operations to help solve system problems.

Linux's Essential Components: Explained for BeginnersLinux's Essential Components: Explained for BeginnersApr 17, 2025 am 12:08 AM

The core components of Linux include the kernel, file system, shell and common tools. 1. The kernel manages hardware resources and provides basic services. 2. The file system organizes and stores data. 3. Shell is the interface for users to interact with the system. 4. Common tools help complete daily tasks.

Linux: A Look at Its Fundamental StructureLinux: A Look at Its Fundamental StructureApr 16, 2025 am 12:01 AM

The basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.

Linux Operations: System Administration and MaintenanceLinux Operations: System Administration and MaintenanceApr 15, 2025 am 12:10 AM

The key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools