From e86690fd983a92bc31a00e3e34f19fc6dcd58f16 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 19 Aug 2021 21:09:38 +0200 Subject: [PATCH] modify path to take into account non-chroot and add autolaunch virt-manager for live system --- leaves/bhmd.cfg | 4 ++-- leaves/ldhmd.cfg | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/leaves/bhmd.cfg b/leaves/bhmd.cfg index 15d4114..eb1a85d 100644 --- a/leaves/bhmd.cfg +++ b/leaves/bhmd.cfg @@ -24,8 +24,8 @@ guestfs-tools # Complementary tools useful for interacting with vith guest syste %post --nochroot --log=/mnt/sysimage/root/bhmd-post.log # Beginning of %post section. Those commands are executed outside the chroot environment -mkdir /var/lib/libvirt/iso # Create a directory to store iso images -virsh pool-create-as --name iso --type dir --target /var/lib/libvirt/iso # Make libvirt aware of this new directory by creating a so-called 'pool' +mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images +virsh pool-create-as --name iso --type dir --target /mnt/sysimage/var/lib/libvirt/iso # Make libvirt aware of this new directory by creating a so-called 'pool' # Add a network bridge. Still need to declare it to virt-manager nmcli con add ifname br0 type bridge con-name br0 diff --git a/leaves/ldhmd.cfg b/leaves/ldhmd.cfg index 4fb1e9f..1d28f03 100644 --- a/leaves/ldhmd.cfg +++ b/leaves/ldhmd.cfg @@ -34,7 +34,15 @@ virt-manager # Install virt-manager, the graphical front-end for QEMU/KVM %post --nochroot --log=/mnt/sysimage/root/ldhmd-post.log # Beginning of %post section. Those commands are executed outside the chroot environment. Add logging. usermod -a -G libvirt liveuser # Make user "liveuser" part of the existing libvirt group to allow it to interact with the guest-hypervisor. -chown liveuser:liveuser /var/lib/libvirt/iso # Make the user "liveuser" the owner of this directory -chown liveuser:liveuser /var/lib/libvirt/images # Make the user "test" the owner of this directory +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 Monitor +Exec=virt-manager +EOF %end # End of the %post section \ No newline at end of file