|
|
|
# Software install and configuration guide
|
|
|
|
|
|
|
|
*Note: if you don't use* ArchLinux *your distribution should have the same packages available maybe with a different name.*
|
|
|
|
|
|
|
|
## Last updated
|
|
|
|
2018/12/28
|
|
|
|
|
|
|
|
## Table of contents
|
|
|
|
- [Common software](#common-software-for-every-script)
|
|
|
|
- [Configure IOMMU](#configure-iommu)
|
|
|
|
- [systemd-boot](#systemd-boot)
|
|
|
|
- [grub](#grub)
|
|
|
|
- [Check that IOMMU is working](#check-after-reboot-that-iommu-is-working)
|
|
|
|
- [*windows-basic.sh* and *macos-basic.sh*](#for-windows-basic.sh-and-macos-basic.sh)
|
|
|
|
- [*windows-network.sh* and *macos-network.sh*](#for-windows-network.sh-and-macos-network.sh)
|
|
|
|
- [*windows-virsh.sh* and *macos-virsh.sh*](#for-windows-virsh.sh-and-macos-virsh.sh)
|
|
|
|
- [*windows.sh* and *macos.sh*](#for-windows.sh-and-macos.sh)
|
|
|
|
|
|
|
|
|
|
|
|
## Common software. For every script.
|
|
|
|
Install `qemu` and `ovmf`
|
|
|
|
```bash
|
|
|
|
sudo pacman -S qemu ovmf
|
|
|
|
```
|
|
|
|
|
|
|
|
## Configure IOMMU
|
|
|
|
### Enable IOMMU. For *systemd-boot* **or** *grub*
|
|
|
|
#### systemd-boot
|
|
|
|
For `systemd-boot` edit `/boot/loader/entries/arch.conf` and add `intel_iommu=on` **OR** `amd_iommu=on`, and `iommu=pt`.
|
|
|
|
```
|
|
|
|
# For AMD CPUs
|
|
|
|
options root=/dev/sda2 amd_iommu=on iommu=pt
|
|
|
|
---------------------------------------------
|
|
|
|
# For Intel CPUs
|
|
|
|
options root=/dev/sda2 intel_iommu=on iommu=pt
|
|
|
|
```
|
|
|
|
**Reboot**. [Check if IOMMU works](#check-after-reboot-that-iommu-is-working)
|
|
|
|
|
|
|
|
---
|
|
|
|
#### grub
|
|
|
|
For `grub` edit `/etc/default/grub` and append your kernel options, `intel_iommu=on` **OR** `amd_iommu=on` and `iommu=pt`, to the `GRUB_CMDLINE_LINUX_DEFAULT`.
|
|
|
|
```
|
|
|
|
# For AMD CPUs
|
|
|
|
GRUB_CMDLINE_LINUX_DEFAULT="amd_iommu=on iommu=pt"
|
|
|
|
---------------------------------------------------
|
|
|
|
# For Intel CPUs
|
|
|
|
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on iommu=pt"
|
|
|
|
```
|
|
|
|
And then automatically re-generate the `grub.cfg` file with:
|
|
|
|
```
|
|
|
|
# grub-mkconfig -o /boot/grub/grub.cfg
|
|
|
|
```
|
|
|
|
**Reboot**. [Check if IOMMU works](#check-after-reboot-that-iommu-is-working)
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### Check, after reboot, that IOMMU is working
|
|
|
|
```
|
|
|
|
$ dmesg | grep -e DMAR -e IOMMU
|
|
|
|
--------------------------------------------
|
|
|
|
[ 0.492684] AMD-Vi: IOMMU performance counters supported
|
|
|
|
[ 0.494370] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
|
|
|
|
[ 0.494644] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
|
|
|
|
```
|
|
|
|
|
|
|
|
## For `windows-basic.sh` and `macos-basic.sh`
|
|
|
|
If you did the previous, you are good to go.
|
|
|
|
|
|
|
|
## For `windows-network.sh` and `macos-network.sh`
|
|
|
|
Install `dnsmasq`, `iproute2`, `iptables` and `samba`
|
|
|
|
|
|
|
|
*Note: these packages **may** already be installed on your system.*
|
|
|
|
```
|
|
|
|
sudo pacman -S dnsmasq iproute2 iptables samba
|
|
|
|
```
|
|
|
|
|
|
|
|
[You may edit `dnsmasq.conf` and `smb.conf`, more info in the *edit script* wiki](edit script.md)
|
|
|
|
|
|
|
|
## For `windows-virsh.sh` and `macos-virsh.sh`
|
|
|
|
Install `libvirt`.
|
|
|
|
```
|
|
|
|
sudo pacman -S libvirt
|
|
|
|
```
|
|
|
|
*Note: the scripts already handle `libvirtd` so you don't have to start the service.*
|
|
|
|
|
|
|
|
## For `windows.sh` and `macos.sh`
|
|
|
|
Install `dnsmasq`, `iproute2`, `iptables`, `samba` and `libvirt`.
|
|
|
|
```
|
|
|
|
sudo pacman -S dnsmasq iproute2 iptables samba libvirt
|
|
|
|
```
|
|
|
|
|
|
|
|
[You may edit `dnsmasq.conf` and `smb.conf`, more info in the *edit script* wiki](edit script.md)
|
|
|
|
|
|
|
|
## For more information refer to this guides
|
|
|
|
|
|
|
|
[ArchWiki QEMU](https://wiki.archlinux.org/index.php/QEMU)
|
|
|
|
|
|
|
|
[ArchWiki PCI passthrough via OVMF](https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF)
|
|
|
|
|
|
|
|
[How to setup a gaming virtual machine with gpu passthrough qemu kvm libvirt and vfio](https://www.se7ensins.com/forums/threads/how-to-setup-a-gaming-virtual-machine-with-gpu-passthrough-qemu-kvm-libvirt-and-vfio.1371980/)
|
|
|
|
|
|
|
|
[VM performance](https://rokups.github.io/#!pages/gaming-vm-performance.md) |