preparing the template image:#Setup io scheduler and serial console for virshsed -i -r 's/GRUB_CMDLINE_LINUX=".*"/GRUB_CMDLINE_LINUX="elevator=deadline console=ttyS0,38400n8 console=tty0"/g' /etc/default/grub && update-grub#Setup serial terminal console configcat <<EOF >/etc/init/ttyS0.conf# ttyS0 - getty## This service maintains a getty on ttyS0 from the point the system is# started until it is shut down again.