启动kvm虚拟机不进入内核
Virtualization is a hot area in Computing. There is a different type of virtualization solutions and techniques used in a different environment and operating systems. KVM or Kernel-based Virtual Machine is a virtualization technology used in Linux kernel and distributions. Linux KVM can be only used in Linux kernel and distribution because of its design architecture.
虚拟化是计算领域的热点。 在不同的环境和操作系统中使用了不同类型的虚拟化解决方案和技术。 KVM或基于内核的虚拟机是Linux内核和发行版中使用的一种虚拟化技术。 由于其设计架构,Linux KVM仅可用于Linux内核和发行版。
KVM的硬件支持 (Hardware Support for KVM)
KVM technology can be only used with hardware support which is provided by the CPU. Intel and AMD CPUs provide this hardware support with the name of
KVM技术只能与CPU提供的硬件支持一起使用。 英特尔和AMD CPU以以下名称提供此硬件支持:
KVM如何工作? (How Does KVM Work?)
KVM is a Linux kernel module and in order to work with KVM, the module should be installed and loaded into the Linux kernel. The module is named as kvm
generically but for Intel processors, it is named as kvm_intel
and AMD processors kvm_amd
. Linux kernel will isolate the created Virtual Machine memory and CPU into a process like a separate system.
KVM是Linux内核模块,为了与KVM一起使用,应将模块安装并加载到Linux内核中。 该模块的名称通常为kvm
但对于Intel处理器,其名称为kvm_intel
和AMD处理器kvm_amd
。 Linux内核会将创建的虚拟机内存和CPU隔离到一个类似单独系统的进程中。
KVM功能 (KVM Features)
KVM virtualization provides the following features during the virtualization process.
KVM虚拟化在虚拟化过程中提供以下功能。
Security
: KVM uses a combination of SELinux and sVirt in order to secure and isolate VMs.Security
:KVM结合使用SELinux和sVirt来保护和隔离VM。Storage
: KVM can use local or NAS related storage technologies with different file systems. VM disk is stored single or multiple files with snapshots, backups.Storage
:KVM可以将本地或NAS相关的存储技术与不同的文件系统一起使用。 VM磁盘存储带有快照,备份的单个或多个文件。Hardware
: KVM can use a wide variety of Linux supported hardware like USB, Printer, PCI devices, etc.Hardware
:KVM可以使用各种Linux支持的硬件,例如USB,打印机,PCI设备等。Memory
: KVM inherits memory management features of Linux, including non-uniform memory access and kernel same-page merging.Memory
:KVM继承了Linux的内存管理功能,包括非均匀内存访问和内核同一页合并。Live Migration
: KVM supports live migration from one Virtualization host to another host without service interruption.Live Migration
:KVM支持从一台虚拟化主机到另一台主机的实时迁移,而不会中断服务。
KVM内核模块 (KVM Kernel Modules)
As stated previously Linux KVM can be used with kernel modules named kvm
. We install the Linux KVM kernel module with the following command if it is not installed.
如前所述,Linux KVM可与名为kvm
内核模块一起使用。 如果未安装Linux KVM内核模块,请使用以下命令进行安装。
$ sudo apt install qemu-kvm
验证KVM安装(Verify KVM Installation)
We can verify the KVM installation with the kvm-ok
command where which will provide information and the hardware support like below.
我们可以使用kvm-ok
命令验证KVM安装,该命令将提供信息以及如下所示的硬件支持。
$ kvm-ok
We can see from the screenshot that /dev/kvm
exists and KVM acceleration
can be used without problem.
从屏幕快照中我们可以看到/dev/kvm
存在,并且可以毫无问题地使用KVM acceleration
。
KVM Qemu(KVM Qemu)
KVM is the Linux kernel part of the virtualization. In the user space, the tool named Qemu
is used. Qemu provides the VM devices emulation and kernel communication. Qemu
is started as a VM emulator and merged with KVM to provide full virtualization. We can install KVM Qemu with the following command.
KVM是虚拟化Linux内核部分。 在用户空间中,使用了名为Qemu
的工具。 Qemu提供了VM设备仿真和内核通信。 Qemu
作为VM仿真器启动,并与KVM合并以提供完整的虚拟化。 我们可以使用以下命令安装KVM Qemu。
$ sudo apt install qemu-kvm
KVM工具Libvirt (KVM Tool Libvirt)
Libvirt is a library used to make KVM virtualization in a more enterprise manner. Libvirt provides services in order to connect, manage virtualization services and create, delete, start, and stop VMs. We can install the libvirt
with the package name libvirt-daemon
which is a service.
Libvirt是用于以更企业化的方式进行KVM虚拟化的库。 Libvirt提供服务以连接,管理虚拟化服务以及创建,删除,启动和停止VM。 我们可以使用软件包名称libvirt-daemon
来安装libvirt
,这是一项服务。
$ sudo apt install libvirt-daemon
KVM GUI工具 (KVM GUI Tools)
KVM VMs can be managed with different GUI tools. But virt-manager
is the popular tool that can be used locally on the system. We can install Virt Manager like below.
可以使用不同的GUI工具来管理KVM VM。 但是virt-manager
是可以在系统上本地使用的流行工具。 我们可以如下安装Virt Manager。
$ sudo apt install virt-manager
翻译自: https://www.poftut.com/what-is-kvm-kernel-based-virtual-machine-in-linux/
启动kvm虚拟机不进入内核