***** 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.
***** > 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. You might also need to setup "CPU tolpology" manually if VM only uses one core when you've assigned it more.
***** > 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.
@ -45,7 +45,8 @@
**** Click on "Add Hardware" and add PCI devices for GPU and HDMI Audio. For NVIDIA GPU, GPU ROM should be patched. See next section.
** NVIDIA GPU Patching
**** Dump GPU VBIOS
Using GPU-Z in Windows is the easiest method of dumping VBIOS. The following command didn't work for me but it's worth trying.
Using GPU-Z in Windows is the easiest method of dumping VBIOS. You can also download vBIOS from [[https://www.techpowerup.com/vgabios/][TechPowerUp]] (didn't work for me). \\
The following command didn't work for me but it's worth trying.
#+BEGIN_SRC bash
su
echo 1 > /sys/bus/pci/devices/0000:01:00.0/rom
@ -53,7 +54,7 @@ Using GPU-Z in Windows is the easiest method of dumping VBIOS. The following com
echo 0 > /sys/bus/pci/devices/0000:01:00.0/rom
#+END_SRC
**** Patch VBIOS file
Use Hex Editor and search string "VIDEO", and remove everything before HEX value *55*. There are bunch of 0s or fs usually..
Use Hex Editor and search string "VIDEO", and remove everything before char *U*, i.e. HEX value *55*.
**** Using Patched VBIOS file
You need to edit configution file of VM.
@ -130,6 +131,10 @@ Restart libvirtd service
#+END_SRC
* Libvirt Hooks
***** Libvirt hooks automates the process of running specific tasks during VM startup and shutdown.
Replace *win10* with your guestname. \\ Find GPU kernel modules using command
#+BEGIN_SRC bash
lspci -vnn | grep VGA -A 12 | grep modules
#+END_SRC
**** Create libvirt hook
#+BEGIN_SRC bash
sudo mkdir /etc/libvirt/hooks/
@ -179,15 +184,18 @@ Add the following content to script: