On an apt / dpkg based Linux system, dump the list of installed packages in a file and select the same packages for installation, preferrably on a different system or version. Other than the usual recommendation `dpkg --get-selections` and `dpkg --set-selections` this keeps the information about automatic dependencies intact.
Old version of https://github.com/hepix-virtualisation/vmimagemanager
...https://github.com/hepix-virtualisation/vmimagemanager
vmimagemanager.py is a command line libvirt client and virtual machine image management python script. It is intended for backing up snapshotting. It supports libvirt, mount (re)store images, booting virtual machines. Its simple and fast to use.