Advertisement
Querzion

etc-libvirt-hooks-qemu-d-winx-prepare-begin-start.sh

Apr 5th, 2023
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.28 KB | Source Code | 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 5 seconds. This can be calibrated to be shorter or longer if required for your system
  24. sleep 5
  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
  37. # modprode -r snd_hda_intel
  38.  
  39. ### Unbind the GPU from display driver
  40. virsh nodedev-detach $VIRSH_GPU_VIDEO
  41. virsh nodedev-detach $VIRSH_GPU_AUDIO
  42.  
  43. ### Load VFIO Kernel Module
  44. modprobe vfio
  45. modprobe vfio-pci
  46. modprobe vfio_iommu_type1
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement