mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-02-25 21:41:02 +00:00
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
This commit is contained in:
parent
bb7b2e514a
commit
f82083ccd1
@ -221,11 +221,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:
|
||||
@ -235,8 +244,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user