linux-kernel - KVM和LXC的区别

标签 linux-kernel kvm lxc cgroups linux-namespaces

KVM 和 Linux 容器 (LXC) 之间有什么区别?在我看来,如果我们同时使用内核的“命名空间”和“控制组”功能,那么 LXC 也是在同一内核中创建多个虚拟机的一种方法。

最佳答案

来自 https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/Resource_Management_and_Linux_Containers_Guide/sec-Linux_Containers_Compared_to_KVM_Virtualization.html 的文本版权所有 © 2014 红帽公司:

Linux Containers Compared to KVM Virtualization

The main difference between the KVM virtualization and Linux Containers is that virtual machines require a separate kernel instance to run on, while containers can be deployed from the host operating system. This significantly reduces the complexity of container creation and maintenance. Also, the reduced overhead lets you create a large number of containers with faster startup and shutdown speeds. Both Linux Containers and KVM virtualization have certain advantages and drawbacks that influence the use cases in which these technologies are typically applied:

KVM virtualization

KVM virtualization lets you boot full operating systems of different kinds, even non-Linux systems. However, a complex setup is sometimes needed. Virtual machines are resource-intensive so you can run only a limited number of them on your host machine.

Running separate kernel instances generally means better separation and security. If one of the kernels terminates unexpectedly, it does not disable the whole system. On the other hand, this isolation makes it harder for virtual machines to communicate with the rest of the system, and therefore several interpretation mechanisms must be used.

Guest virtual machine is isolated from host changes, which lets you run different versions of the same application on the host and virtual machine. KVM also provides many useful features such as live migration. For more information on these capabilities, see Red Hat Enterprise Linux 7 Virtualization Deployment and Administration Guide.

Linux Containers:

The current version of Linux Containers is designed primarily to support isolation of one or more applications, with plans to implement full OS containers in the near future. You can create or destroy containers very easily and they are convenient to maintain.

System-wide changes are visible in each container. For example, if you upgrade an application on the host machine, this change will apply to all sandboxes that run instances of this application.

Since containers are lightweight, a large number of them can run simultaneously on a host machine. The theoretical maximum is 6000 containers and 12,000 bind mounts of root file system directories. Also, containers are faster to create and have low startup times.

source

关于linux-kernel - KVM和LXC的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20578039/

相关文章:

linux-kernel - Linux 内核的静态调用图生成

c - 一个人怎么能故意饿死内核进程呢?

c - Linux内核代码中的内存映射数据文件

x86 - 从指令替换的角度看QEMU与KVM的交互

linux - LXC容器显示主节点磁盘空间

linux - 使用 schroot 替换 lxc

linux - Beagleboard xm rev C 上未检测到 SMSC9514

尽管在 ubuntu 14.04 中安装了 KVM,但 Android Studio 显示 KVM 错误

ssh - KVM Debian - 禁用 ICMP 重定向接受会使 SSH 和 ping 无法进行

linux - 任何 "lxc-*"命令都可以列出搜索模板路径吗?