From ddb04feb59f2baffe8a5243d9cce016e32215c6e Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 20 Aug 2021 10:26:23 +0200 Subject: [PATCH] add virt-manager automatic launch --- leaves/dhamd.cfg | 15 +++++++++++++++ leaves/dhimd.cfg | 15 +++++++++++++++ leaves/ldhamd.cfg | 8 ++++++++ leaves/ldhimd.cfg | 8 ++++++++ 4 files changed, 46 insertions(+) diff --git a/leaves/dhamd.cfg b/leaves/dhamd.cfg index 5e16a8c..5897b09 100644 --- a/leaves/dhamd.cfg +++ b/leaves/dhamd.cfg @@ -28,3 +28,18 @@ virt-manager # Install virt-manager, the graphical front-end for QEMU/KVM gnome-initial-setup # Add GNOME initial setup too to let user create local account. %end # End of the packages section + +%post --nochroot --log=/mnt/sysimage/root/dhimd.log # Beginning of %post section. Those commands are executed outside the chroot environment. Add logging. + +# 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 + +# Download netboot.xyz # cannot resolve hostname +# wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /var/lib/libvirt/iso/ + +%end # End of the %post section \ No newline at end of file diff --git a/leaves/dhimd.cfg b/leaves/dhimd.cfg index 8cc1961..d7b5f4c 100644 --- a/leaves/dhimd.cfg +++ b/leaves/dhimd.cfg @@ -28,3 +28,18 @@ virt-manager # Install virt-manager, the graphical front-end for QEMU/KVM gnome-initial-setup # Add GNOME initial setup too to let user create local account. %end # End of the packages section + +%post --nochroot --log=/mnt/sysimage/root/dhimd.log # Beginning of %post section. Those commands are executed outside the chroot environment. Add logging. + +# 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 + +# Download netboot.xyz # cannot resolve hostname +# wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /var/lib/libvirt/iso/ + +%end # End of the %post section \ No newline at end of file diff --git a/leaves/ldhamd.cfg b/leaves/ldhamd.cfg index b425028..86eaa3a 100644 --- a/leaves/ldhamd.cfg +++ b/leaves/ldhamd.cfg @@ -38,4 +38,12 @@ usermod -a -G libvirt liveuser # Make user "liveuser" part of the existing libvi chown liveuser:liveuser /mnt/sysimage/var/lib/libvirt/iso # Make the user "liveuser" the owner of this directory chown liveuser:liveuser /mnt/sysimage/var/lib/libvirt/images # Make the user "test" the owner of this directory +# 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 # End of the %post section diff --git a/leaves/ldhimd.cfg b/leaves/ldhimd.cfg index ca0d533..e2e7c8d 100644 --- a/leaves/ldhimd.cfg +++ b/leaves/ldhimd.cfg @@ -38,4 +38,12 @@ usermod -a -G libvirt liveuser # Make user "liveuser" part of the existing libvi chown liveuser:liveuser /mnt/sysimage/var/lib/libvirt/iso # Make the user "liveuser" the owner of this directory chown liveuser:liveuser /mnt/sysimage/var/lib/libvirt/images # Make the user "test" the owner of this directory +# 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 # End of the %post section \ No newline at end of file