Libvirt is collection of software that provides a convenient way to manage virtual machines and other virtualization functionality, such as storage and network interface management.
An primary goal of libvirt is to provide a single way to manage multiple different virtualization providers/hypervisors.
No need to learn the hypervisor specific tools.
For example: 'virsh list --all' listS the existing virtual machines for any supported hypervisor (KVM, Xen, VMWare ESX, etc.)
Some of the major libvirt features are:
sudo apt-get install qemu-kvm
sudo apt-get install libvirt-bin virtinstall virt-manager
sudo gpasswd -a milad libvirtd
virsh list
virsh net-list
virsh # go to interactive mode
virsh net-destroy --help
stoping a network
virsh net-destroy default
virsh net-list
virsh net-list --inactive # or --all
disabling autostart
virsh net-autostart --disable default
virsh net-list --all
KVM (Kernel-based Virtual Machine) is a full virtualization solution for Linux containing virtualization extensions (Intel VT or AMD-V).
KVM does not support paravirtualization for CPU but may support paravirtualization for device drivers to improve I/O performance.
QEMU uses emulation; KVM uses processor extensions (HVM) for virtualization.
KVM kernel modules are part of the Linux kernel package Userspace tools are usually called "qemu-kvm" or "kvm" Linux guest drivers are part of the Linux kernel package
sudo apt-get install cpu-checker
dpkg -L cpu-checker | grep bin/
The program will first determine if /proc/cpuinfo contains the flags indicating that
the CPU has the Virtualization Technology (VT) capability.
Next, it will check if the /dev/kvm device exists.
kvm-ok
egrep 'vmx|svm' -m1 -c /proc/cpuinfo # match first one, just count; vmx: intel, svm: amd
"vmx" stands for Virtual Machine Extensions, which adds ten new instructions, These instructions permit entering and exiting a virtual execution mode where the guest OS perceives itself as running with full privilege (ring 0), but the host OS remains protected.
file /dev/kvm
lsmod | grep kvm
QEMU is a generic and open source machine emulator and virtualizer.
When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.
When used as a virtualizer, QEMU achieves near native performance by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, 64-bit POWER, S390, 32-bit and 64-bit ARM, and MIPS guests.
KVM (Kernel Virtual Machine) is a Linux kernel module that allows a user space program to utilize the hardware virtualization features of various processors. Today, it supports recent Intel and AMD processors (x86 and x86_64), PPC 440, PPC 970, S/390, ARM (Cortex A15, AArch64), and MIPS32 processors.
QEMU can make use of KVM when running a target architecture that is the same as the host architecture. For instance, when running qemu-system-x86 on an x86 compatible processor, you can take advantage of the KVM acceleration - giving you benefit for your host and your guest system.
The KVM project used to maintain a fork of QEMU called qemu-kvm. All feature differences have been merged into QEMU upstream and the development of the fork suspended.
To use KVM pass --enable-kvm to QEMU.
ipynb
format: https://github.com/ravexina/linux-notes. html
exports of project available at: https://ravexina.github.io/linux-notes.Linux Notes by Milad As (Ravexina) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.