From 7409500bc3b46cfc2d7a6ad63b7f077af813bbeb Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:15:27 +0100 Subject: [PATCH] feat: Enable libvirtd service if virt-manager layered (#613) * feat: Enable libvirtd service if virt-manager layered * chore: remove extra indent from enable-vfio * chore: add forgotten shebang --- .../usr/share/ublue-os/just/60-custom.just | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/60-custom.just b/system_files/desktop/shared/usr/share/ublue-os/just/60-custom.just index 801bd389..192bf6c8 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/60-custom.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/60-custom.just @@ -203,11 +203,20 @@ add-user-to-input-group: # Enable Virtualization and add workaround for a specific windows VM crash enable-virtualization: - echo "Installing QEMU and virt-manager..." - rpm-ostree install virt-manager edk2-ovmf qemu - rpm-ostree kargs \ - --append-if-missing="kvm.ignore_msrs=1" \ - --append-if-missing="kvm.report_ignored_msrs=0" + #!/usr/bin/env bash + virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager") + if [[ -z ${virt_test} ]]; then + echo "Installing QEMU and virt-manager..." + rpm-ostree install virt-manager edk2-ovmf qemu + rpm-ostree kargs \ + --append-if-missing="kvm.ignore_msrs=1" \ + --append-if-missing="kvm.report_ignored_msrs=0" + echo 'Please re-run "ujust enable-virtualization" after the reboot to finish setup' + else + echo "Enabling libvirtd service" + sudo systemctl enable --now libvirtd + echo "libvirtd enabled! If virt-manager says libvirtd.sock is not available after a big update, re-run this command." + fi # Enable VFIO on the system if virtualization is enabled enable-vfio: @@ -217,8 +226,8 @@ enable-vfio: CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }') VENDOR_KARG="unset" if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then - echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf - sudo touch /etc/bazzite/initramfs/rebuild + echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf + sudo touch /etc/bazzite/initramfs/rebuild if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then VENDOR_KARG="amd_iommu=on" elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then