***** You can't install Windows without virtio drivers. Click [[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso][here]] to download.
** Starting services
**** Enable and start libvirt service
#+BEGIN_SRC bash
@ -29,12 +31,12 @@
sudo virsh net-autostart default
#+END_SRC
** Setup Guest OS
**** Launch virt-manager, and start creating guest. On final step, check "Customize before install".
**** > In the "Overview" section, set Chipset to "Q35" and firmware to "UEFI".
**** > In the "CPUs" section, change CPU model to "host-passthrough". You need to type it manually. According to Arch Wiki, this makes sure that the CPU is detected properly. Without it, some applications may complain about your CPU being of an unknown model.
**** > Set Disk Bus of Storage to "virtio".
**** > Set NIC Device Model to "virtio".
**** Now, you can *Begin Installation*. You can continue installing Windows right now or after setting up Passthrough.
***** Launch virt-manager, and start creating guest. On final step, check "Customize before install".
***** > In the "Overview" section, set Chipset to "Q35" and firmware to "UEFI".
***** > In the "CPUs" section, change CPU model to "host-passthrough". You need to type it manually. According to Arch Wiki, this makes sure that the CPU is detected properly. Without it, some applications may complain about your CPU being of an unknown model.
***** > Set Disk Bus of Storage to "virtio".
***** > Set NIC Device Model to "virtio".
***** Now, you can *Begin Installation*. You can continue installing Windows right now or after setting up Passthrough.
** Attach PCI devices
**** Remove devices such as Spice Channel, XQL video adaper, USB tablet, etc.
**** Click on "Add Hardware" and add PCI devices for GPU and HDMI Audio. For NVIDIA GPU, GPU ROM should be patched. See next section.
@ -115,7 +117,7 @@ to
]
#+END_SRC
** Add user to different groups
*** Add user to groups input, kvm, libvirt to make sure it has access to required config and devices.
**** Add user to groups input, kvm, libvirt to make sure it has access to required config and devices.
#+BEGIN_SRC bash
sudo usermod -aG input,kvm,libvirt username
#+END_SRC
@ -123,3 +125,97 @@ Restart libvirtd service
#+BEGIN_SRC bash
sudo systemctl restart libvirtd
#+END_SRC
* Libvirt Hooks
***** Libvirt hooks automates the process of running specific tasks during VM startup and shutdown.
**** Create libvirt hook
#+BEGIN_SRC bash
sudo mkdir /etc/libvirt/hooks/
sudo touch /etc/libvirt/hooks/qemu
#+END_SRC
***** Add following content to the qemu hook
More at: [[https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/][PassthroughPost]] \\