In libguestfs ≥ 1.19.32 you can now use the virt-sysprep to add “firstboot” scripts to Linux guests. These scripts run exactly once the next time the guest boots, so you can use them to customize the guest in an infinite number of ways: Installing software, changing logos and desktop backgrounds, adding user accounts, etc.
To use this, simply use the
--firstboot option on the command line as many times as required:
$ virt-sysprep -a guest.img \ --firstboot ./yum-update.sh \ --firstboot ./set-desktop.sh