From 3dbf80bcd390dca6585dce9aa4a02e3651136b71 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 28 Nov 2021 18:17:05 +0100 Subject: [PATCH] make sure libvirtd starts when needed --- blocks/base-guest-agents.cfg | 1 - blocks/base-hypervisor-a.cfg | 2 ++ blocks/base-hypervisor-ii.cfg | 2 ++ leaves/virtual-desktop.cfg | 5 +++-- leaves/virtual-phyllome-desktop.cfg | 25 +++++++++++++++---------- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/blocks/base-guest-agents.cfg b/blocks/base-guest-agents.cfg index e100165..955d5eb 100644 --- a/blocks/base-guest-agents.cfg +++ b/blocks/base-guest-agents.cfg @@ -14,5 +14,4 @@ spice-vdagent # "Agent for Spice guests" The spice agent is unnecessary for a ba %end # End of the packages section -services --enabled=NetworkManager,qemu-guest-agent,spice-vdagentd,libvirtd --disabled=sshd # enable services for guest agents diff --git a/blocks/base-hypervisor-a.cfg b/blocks/base-hypervisor-a.cfg index 83dfc68..46e3415 100644 --- a/blocks/base-hypervisor-a.cfg +++ b/blocks/base-hypervisor-a.cfg @@ -7,6 +7,8 @@ # What ? This kickstart file configures an hypervisor for AMD (tm) CPUs +services --enabled="NetworkManager,libvirtd" + %post --nochroot --log=/mnt/sysimage/root/bha.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting sed -i 's/\(quiet\)/\1 amd_iommu=on amd_iommu=pt rd.driver.pre=vfio-pci/i' /mnt/sysimage/etc/default/grub # Load kernel modules in GRUB. diff --git a/blocks/base-hypervisor-ii.cfg b/blocks/base-hypervisor-ii.cfg index 98db073..8555bfc 100644 --- a/blocks/base-hypervisor-ii.cfg +++ b/blocks/base-hypervisor-ii.cfg @@ -7,6 +7,8 @@ # What ? This kickstart file configures an hypervisor for Intel(tm) CPUs and Intel(tm) graphic cards +services --enabled="NetworkManager,libvirtd" + %post --nochroot --log=/mnt/sysimage/root/bhi.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installtion troubleshooting sed -i 's/\(quiet\)/\1 intel_iommu=on iommu=pt rd.driver.pre=vfio-pci i915.enable_gvt=1/i' /mnt/sysimage/etc/default/grub # Load kernel modules in grub. diff --git a/leaves/virtual-desktop.cfg b/leaves/virtual-desktop.cfg index 7b75153..587b66e 100644 --- a/leaves/virtual-desktop.cfg +++ b/leaves/virtual-desktop.cfg @@ -25,7 +25,7 @@ timezone Europe/Paris --utc # SELinux configuration selinux --enforcing # System services -services --disabled="sshd" --enabled="NetworkManager,qemu-guest-agent,spice-vdagentd" +services --disabled="sshd" --enabled="NetworkManager" # System bootloader configuration bootloader --location=mbr --timeout=1 # Clear the Master Boot Record @@ -45,7 +45,7 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful %end -%post --nochroot --logfile=/mnt/sysimage/root/d.log +%post --nochroot --logfile=/mnt/sysimage/opt/base-initial-setup-gnome.log truncate -s 0 /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf # remove content of vendor.conf so that all options are made available @@ -72,6 +72,7 @@ generic-release-notes gnome-initial-setup gnome-shell gnome-terminal +mesa-dri-drivers nano neofetch pciutils diff --git a/leaves/virtual-phyllome-desktop.cfg b/leaves/virtual-phyllome-desktop.cfg index 427e578..d05e566 100644 --- a/leaves/virtual-phyllome-desktop.cfg +++ b/leaves/virtual-phyllome-desktop.cfg @@ -25,7 +25,7 @@ timezone Europe/Paris --utc # SELinux configuration selinux --enforcing # System services -services --disabled="sshd" --enabled="NetworkManager,qemu-guest-agent,spice-vdagentd,libvirtd" +services --disabled="sshd" --enabled="NetworkManager,libvirtd" # System bootloader configuration bootloader --location=mbr --timeout=1 # Clear the Master Boot Record @@ -45,6 +45,18 @@ grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful %end +%post --nochroot --logfile=/mnt/sysimage/opt/base-desktop-gnome-virtual-machine-manager.log + +# Create a file to autostart virt-manager +cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF +[Desktop Entry] +Type=Application +Name=Virtual Machine Manager +Exec=virt-manager +EOF + +%end + %post --nochroot --logfile=/mnt/sysimage/root/bh.log # %post --log=/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting @@ -89,18 +101,10 @@ chmod +x /mnt/sysimage/usr/sbin/virtualization-tweaks-root-needed.sh %end -%post --nochroot --logfile=/mnt/sysimage/root/dh.log +%post --nochroot --logfile=/mnt/sysimage/opt/base-initial-setup-gnome.log truncate -s 0 /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf # remove content of vendor.conf so that all options are made available -# Create a file to autostart virt-manager -cat > /mnt/sysimage/etc/xdg/autostart/virt-manager.desktop << EOF -[Desktop Entry] -Type=Application -Name=Virtual Machine Manager -Exec=virt-manager -EOF - ## Append lines to existing vendor.conf file, so that options are skipped upon reboot cat >> /mnt/sysimage/usr/share/gnome-initial-setup/vendor.conf<< EOF [pages] @@ -129,6 +133,7 @@ libguestfs-tools libvirt libvirt-daemon-config-network libvirt-daemon-kvm +mesa-dri-drivers nano neofetch pciutils