QEMU、KVM、Libvirt有什么区别,如何与Vagrant一起使用?需要三者一起工作吗? [英] What is the difference between QEMU, KVM, Libvirt, and how to use with Vagrant? Are all 3 needed to work together?
问题描述
我以前在 Virtualbox 中使用过 Vagrant,但 VB 不能在这台计算机上运行,所以我想我会尝试不同的方法,但我不太了解这个软件集群,它们的用途是单独和相互依赖的...我知道 Vagrant 机器可以有 QEMU 或 Libvirt(或 KVM?)提供程序,还有 qemu、qemu-kvm 和 vagrant-libvirt,我只是无法将它们全部划分开来以及它们的互连.我想在我的主机上运行带有同步文件夹的虚拟机.所有这些都是必需的,如何?如果不是,为什么以及如何一起使用?这样我才能更好地理解.在 Debian 10 上
I've used Vagrant with Virtualbox before but VB is not working on this computer so I thought I would try a different approach, but I can't quite make sense of this cluster of software, what their uses are individually and interdependently... I know Vagrant boxes can have QEMU or Libvirt (or KVM?) providers, and there's qemu, and qemu-kvm, and vagrant-libvirt, and I just can't compartmentalize it all and their interconnection. I want to run virtual machines with synchronized folders on my host. Are all those required, and how? If not, why and how would one use all together? So I can better understand. On Debian 10
推荐答案
QEMU、KVM 和 Libvirt 之间的差异
QEMU 是一个机器(硬件)模拟器.
Differences between QEMU, KVM, and Libvirt
QEMU is a machine (hardware) emulator.
KVM 是 Linux 启用虚拟化的内核模块;这是管理程序.
KVM is a kernel module for Linux to enable virtualization; this is the hypervisor.
QEMU 可以在没有 KVM 的情况下运行,但速度可能会慢一些.
QEMU can run without KVM but it can be quite a bit slower.
libvirt 是一个虚拟化库,它封装了 QEMU 和 KVM 以提供供其他程序使用的 API,例如 Vagrant,这是一个创建虚拟化开发环境的工具.
libvirt is a virtualization library which wraps QEMU and KVM to provide APIs for use by other programs, such as Vagrant, which is a tool for creating virtualized development environments.
总结:
- Vagrant 使用 libvirt.
- libvirt 使用 QEMU 和 KVM.
首先确保安装所需的依赖项:
First be sure to install the required dependencies:
apt-get build-dep vagrant ruby-libvirt
apt-get install qemu libvirt-daemon-system libvirt-clients ebtables dnsmasq-base
apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
来源:https://github.com/vagrant-libvirt/vagrant-libvirt#安装
然后使用以下命令运行:
Then use the following command to run:
vagrant up --provider=libvirt
或者,改用环境变量:
export VAGRANT_DEFAULT_PROVIDER=libvirt
来源:https://github.com/vagrant-libvirt/vagrant-libvirt#start-vm
这篇关于QEMU、KVM、Libvirt有什么区别,如何与Vagrant一起使用?需要三者一起工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!