diff --git a/README.md b/README.md index 8784a36..09b2837 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ To use patched vBIOS, edit VM's configuration to include patched vBIOS inside ** -### Libvirt Hooks +### **Libvirt Hooks** Libvirt hooks automate the process of running specific tasks during VM state change. \ More info at: [PassthroughPost](https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/)
@@ -266,7 +266,7 @@ systemctl start display-manager
-### Keyboard/Mouse Passthrough +### **Keyboard/Mouse Passthrough** Modify libvirt configuration of your VM. Change first line to: @@ -404,7 +404,7 @@ virsh edit win10
-### Video card driver virtualisation detection +### **Video card driver virtualisation detection** Video Card drivers refuse to run in Virtual Machine, so you need to spoof Hyper-V Vendor ID. @@ -434,7 +434,7 @@ virsh edit win10
-Nvidia guest drivers also require hiding the KVM CPU leaf: +NVIDIA guest drivers also require hiding the KVM CPU leaf:
@@ -461,8 +461,8 @@ virsh edit win10
-### User Groups -You should add your user to ***input***, ***kvm***, and ***libvirt*** groups. +### **User Groups** +You should add your user to ***input***, ***kvm***, and ***libvirt*** groups to be able to run VM without root. ```sh usermod -aG kvm,input,libvirt username ``` diff --git a/scripts/qemu b/scripts/qemu deleted file mode 100644 index ee19314..0000000 --- a/scripts/qemu +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -GUEST_NAME="$1" -HOOK_NAME="$2" -STATE_NAME="$3" -MISC="${@:4}" - -BASEDIR="$(dirname $0)" - -HOOKPATH="$BASEDIR/qemu.d/$GUEST_NAME/$HOOK_NAME/$STATE_NAME" -set -e # If a script exits with an error, we should as well. - -if [ -f "$HOOKPATH" ]; then - eval \""$HOOKPATH"\" "$@" -elif [ -d "$HOOKPATH" ]; then - while read file; do - eval \""$file"\" "$@" - done <<< "$(find -L "$HOOKPATH" -maxdepth 1 -type f -executable -print;)" -fi diff --git a/scripts/qemu.d/win10/prepare/begin/begin.sh b/scripts/qemu.d/win10/prepare/begin/begin.sh deleted file mode 100755 index 351bb3a..0000000 --- a/scripts/qemu.d/win10/prepare/begin/begin.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -x - -# Stop display manager -systemctl stop display-manager - -# Unbind EFI Framebuffer -echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind - -# Unload NVIDIA kernel modules -modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia - -# Unload AMD kernel module -# modprobe -r amdgpu - -# Detach GPU devices from host -# Use your GPU and HDMI Audio PCI host device -virsh nodedev-detach pci_0000_01_00_0 -virsh nodedev-detach pci_0000_01_00_1 - -# Load vfio module -modprobe vfio-pci diff --git a/scripts/qemu.d/win10/release/end/end.sh b/scripts/qemu.d/win10/release/end/end.sh deleted file mode 100755 index 097c7a7..0000000 --- a/scripts/qemu.d/win10/release/end/end.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -x - -# Unload vfio module -modprobe -r vfio-pci - -# Attach GPU devices to host -# Use your GPU and HDMI Audio PCI host device -virsh nodedev-reattach pci_0000_01_00_0 -virsh nodedev-reattach pci_0000_01_00_1 - -# Rebind framebuffer to host -echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind - -# Load NVIDIA kernel modules -modprobe nvidia_drm -modprobe nvidia_modeset -modprobe nvidia_uvm -modprobe nvidia - -# Load AMD kernel module -# modprobe amdgpu - -# Restart Display Manager -systemctl start display-manager diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 97e27ba..0000000 --- a/setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -if [[ -z lspcu | grep Virtualization ]]; then - echo "ERROR: Virtualization isn't supported in this system" - exit 1 -fi - -if [[ -z dmesg | grep 'IOMMU enabled' ]]; then - echo "IOMMU isn't enabled. Enabling IOMMU... " - if [[ -f /boot/grub/grub.cfg ]]; then - echo "Loading GRUB configuration.. " - config=/etc/default/grub - if [[ lscpu | grep GenuineIntel ]]; then - if [[ -z sed -n 's/^GRUB_CMDLINE_LINUX_DEFAULT=//p' $config | grep intel_iommu=on ]]; then - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 intel_iommu=on"/' $config - fi - else - if [[ -z sed -n 's/^GRUB_CMDLINE_LINUX_DEFAULT=//p' $config | grep amd_iommu=on ]]; then - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 amd_iommu=on"/' $config - fi - elif [[ -f /boot/loader/loader.conf ]]; then - echo "Loading systemd-boot configuration... " - echo "Add intel_iommu=on or amd_iommu=on depending on your CPU to options in boot entry.." - # TODO - fi - echo "IOMMU enabled.." - echo "Please reboot your system to continue.." - exit 1 -fi - -echo "COPYING LIBVIRT SCRIPTS" -cp scripts/* /etc/libvirt/hooks/ - -echo "CONFIGURATION FINISHED.." -# TODO MORE OPTIONS