2021-08-18 09:51:42 +00:00
|
|
|
# __ ____ ____ _____
|
|
|
|
# ____ / /_ __ __/ / /___ ____ ___ ___ / __ \/ ___/
|
|
|
|
# / __ \/ __ \/ / / / / / __ \/ __ `__ \/ _ \ / / / /\__ \
|
|
|
|
# / /_/ / / / / /_/ / / / /_/ / / / / / / __/ / /_/ /___/ /
|
|
|
|
# / .___/_/ /_/\__, /_/_/\____/_/ /_/ /_/\___/ \____//____/
|
|
|
|
# /_/ /____/
|
|
|
|
|
2021-08-18 13:46:24 +00:00
|
|
|
# What ? This kickstart file bootstraps a live desktop hypervisor machine.
|
|
|
|
# 'l' for live, 'h' for hypervisor, 'd' for desktop, 'm' for minimal, 'd' for development only.
|
2021-08-18 09:51:42 +00:00
|
|
|
|
|
|
|
# ATTENTION : this kickstart file will automatically DESTROY the main disk and all of its contents.
|
2021-08-18 13:46:24 +00:00
|
|
|
# Bye bye
|
2021-08-18 09:51:42 +00:00
|
|
|
|
2021-08-18 18:10:10 +00:00
|
|
|
# In order to be fed to virt-install or software like livecd-creator, this file needs to be flatten or merged into one.
|
|
|
|
# Here is how you can do it with the ksflatten tool provided by the pykickstart package on Fedora :
|
|
|
|
# ksflatten -c ldhmd.cfg -o flat-ldhmd.cfg
|
|
|
|
|
2021-08-19 10:02:52 +00:00
|
|
|
# An ISO file can be created using the following command as *root*:
|
|
|
|
# livecd-creator -c flat-ldhmd.cfg --fslabel=ldhmd
|
|
|
|
# livecd-creator is part of the livecd-tools package
|
|
|
|
|
|
|
|
# The resulting ISO can be tested with qemu-kvm, using the following command as *root*:
|
|
|
|
# qemu-kvm -m 2048 -vga virtio -display gtk,gl=on ldhmd.iso
|
|
|
|
|
2021-08-18 13:46:24 +00:00
|
|
|
%include ldmd.cfg # A base for a live desktop minimal machine
|
|
|
|
%include bhmd.cfg # A base hypervisor
|
|
|
|
|
2021-08-19 17:37:11 +00:00
|
|
|
%packages --exclude-weakdeps # Beginning of the packages section. Do not include weak dependencies.
|
2021-08-18 13:46:24 +00:00
|
|
|
|
2021-08-19 17:37:11 +00:00
|
|
|
virt-manager # Install virt-manager, the graphical front-end for QEMU/KVM
|
2021-08-18 13:46:24 +00:00
|
|
|
|
2021-08-19 17:37:11 +00:00
|
|
|
%end # End of the packages section
|
2021-08-18 13:46:24 +00:00
|
|
|
|
2021-08-19 10:02:52 +00:00
|
|
|
%post --nochroot # Beginning of %post section. Those commands are executed outside the chroot environment
|
2021-08-18 13:46:24 +00:00
|
|
|
|
|
|
|
usermod -a -G libvirt liveuser # Make user "liveuser" part of the existing libvirt group to allow it to interact with the guest-hypervisor.
|
2021-08-19 10:45:18 +00:00
|
|
|
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
|
2021-08-18 13:46:24 +00:00
|
|
|
|
2021-08-19 17:37:11 +00:00
|
|
|
# Autostart virt-manager
|
|
|
|
cat > /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
|