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
So to conclude: QEMU is a type 2 hypervisor that runs within user space and performs virtual hardware emulation, whereas KVM is a type 1 hypervisor that runs in kernel space, that allows a user space program access to the hardware virtualization features of various processors.
QEMU can run without KVM but it can be quite a bit slower. 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.
The libvirt KVM/QEMU driver can manage any QEMU emulator from version 4.2. 0 or later. It supports multiple QEMU accelerators: software emulation also known as TCG, hardware-assisted virtualization on Linux with KVM and hardware-assisted virtualization on macOS with Hypervisor.
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). On the other hand, libvirt is detailed as "An open-source virtualization API".
QEMU is a machine (hardware) emulator.
KVM is a kernel module for Linux to enable virtualization; this is the hypervisor.
QEMU can run without KVM but it can be quite a bit slower.
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.
Summary:
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
Source: https://github.com/vagrant-libvirt/vagrant-libvirt#installation
Then use the following command to run:
vagrant up --provider=libvirt
Or, use an environment variable instead:
export VAGRANT_DEFAULT_PROVIDER=libvirt
Source: https://github.com/vagrant-libvirt/vagrant-libvirt#start-vm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With