Advertisement
Querzion

start.sh

Nov 14th, 2021 (edited)
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.31 KB | None | 0 0
  1. # Path >> /etc/libvirt/hooks/qemu.d/win10/prepare/begin/start.sh
  2. #!/bin/bash
  3. ### Debugging
  4. set -x
  5.  
  6. ### Load variables defined in kvm.conf
  7. source "/etc/libvirt/hooks/kvm.conf"
  8.  
  9. ### Stop display manager
  10. systemctl stop sddm.service ### Manjaro / Arch / ArchTitus
  11. # systemctl stop display-manager.service
  12.  
  13. ### Uncomment the following line if you use GDM
  14. # killall gdm-x-session
  15.  
  16. ### Unbind VTconsoles   -   ls /sys/class/vtconsole/
  17. echo 0 > /sys/class/vtconsole/vtcon0/bind
  18. echo 0 > /sys/class/vtconsole/vtcon1/bind
  19.  
  20. ### Unbind EFI-Framebuffer
  21. echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
  22.  
  23. ### Avoid a Race condition by waiting 10 seconds. This can be calibrated to be shorter or longer if required for your system
  24. sleep 10
  25.  
  26. ### Unload nVidia - uncomment if nVidia is GPU
  27. # modprobe -r nvidia_drm
  28. # modprobe -r nvidia_modeset
  29. # modprobe -r drm_kms_helper
  30. # modprobe -r nvidia
  31. # modprobe -r i2c_nvidia_gpu
  32. # modprobe -r drm
  33. # modprobe -r nvidia_uvm
  34.  
  35. ### Unload AMD  - uncomment if AMD is GPU
  36. modprode -r amdgpu # Video Driver
  37. # modprode -r snd_hda_intel # Audio Driver
  38.  
  39.  
  40. ### Unbind the GPU from display driver
  41. virsh nodedev-detach $VIRSH_GPU_VIDEO
  42. virsh nodedev-detach $VIRSH_GPU_AUDIO
  43.  
  44. ### Load VFIO Kernel Module
  45. modprobe vfio
  46. modprobe vfio-pci
  47. modprobe vfio_iommu_type1
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement