QEMU, KVM, virt-manager installation guide for archlinux
First step is installing all packages needed to run KVM:
sudo pacman -S qemu virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcatAlso install ebtables and iptables packages:
#sudo pacman -S ebtables iptablessudo pacman -S iptables-nft libguestfs is a set of tools used to access and modify virtual machine (VM) disk images. You can use this for:
- viewing and editing files inside guests
- scripting changes to VMs
- monitoring disk used/free statistics
- creating guests
- P2V
- V2V
- performing backup e.t.c
sudo pacman -S libguestfs
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.servicealso you might want to check if dnsmasq service is running
sudo systemctl enable dnsmasq.service
sudo systemctl start dnsmasq.serviceSince we want to use our standard Linux user account to manage KVM, let’s configure KVM to allow this.
Open the file /etc/libvirt/libvirtd.conf for editing.
sudo vim /etc/libvirt/libvirtd.confSet the UNIX domain socket group ownership to libvirt
unix_sock_group = "libvirt"
Set the UNIX socket permissions for the R/W socket
unix_sock_rw_perms = "0770"
Add your user account to libvirt group.
sudo usermod -a -G libvirt $(whoami)
newgrp libvirtRestart libvirt daemon.
sudo systemctl restart libvirtd.serviceNested Virtualization feature enables you to run Virtual Machines inside a VM. Enable Nested virtualization for kvm_intel by enabling kernel module as shown.
sudo modprobe -r kvm_intel
sudo modprobe kvm_intel nested=1cat /sys/module/kvm_intel/parameters/nestedTo make this configuration persistent,run:
echo "options kvm-intel nested=1" | sudo tee /etc/modprobe.d/kvm-intel.confConfirm that Nested Virtualization is set to Yes:
$ systool -m kvm_intel -v | grep nested
nested = "Y"
nested_early_check = "N"
$ cat /sys/module/kvm_intel/parameters/nested
YError starting domain: Requested operation is not valid: network 'default' is not active
sudo virsh net-list --all
Name State Autostart Persistent
----------------------------------------------
default inactive no yessudo virsh net-start default