-
Install dependancies:
For Debian-based systems:
./install-deps-deb.sh
For Arch-based systems:
./install-deps-arch.sh
-
Add yourself to the libvirt group:
sudo usermod -a -G libvirt $(whoami)
-
Add the following options to
GRUB_CMDLINE_LINUX_DEFAULT
:/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... iommu=1 amd_iommu=on pcie_acs_override=downstream ..."
-
Update grub:
sudo grub-mkconfig -o /boot/grub/grub.cfg
-
Check device ids and modify configurations files if necessary:
ls-iommu.sh
-
Place vfio configuration files:
setup.sh
-
Reboot and check device is bound to the vfio driver:
ls-pci.sh
-
Enable/start libvirtd:
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
-
Edit
/etc/apparmor.d/abstractions/libvirt-qemu
:# for usb access /dev/bus/usb/** rw, /etc/udev/udev.conf r, /sys/bus/ r, /sys/class/ r, /run/udev/data/* rw,
-
Restart apparmor:
service apparmor restart
-
Install VM.
-
Fix code 43 issue:
virsh edit <VM-name>
<hyperv> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> <vendor_id state='on' value='whatever'/> </hyperv> <kvm> <hidden state='on'/> </kvm>`