Create custom templates for VMs and containers

Problem/Justification
I regularly find myself creating LXC-containers or VMs, installing some basic set of software and being happy. Than I’ll install some more. And either things might go awry and brake or I might question my design decisions. And I’ll start from scratch. The same (starting from scratch) will be necessary for creating quite similar VMs or containers.
Only going back could probably be solved by simply creating a snapshot.
But in my opinion it would be great to be able to create a (named) template as starting point for creating similar solutions that differ from a certain point on.

Impact
Having templates would prevent users from having to go trough repetitive tasks and thus save a significant amount of time.

User Story
I will usually install nano, openssh-server and aptitude right from the start, whenever I create a new container. Create a set of users with sudo-rights. And maybe install a desktop environment together with xrdp. Especially the latter is obviously quite a hassle and time consuming.

Other users might also have a set of preparations they apply whenever they create a new VM or container. With templates available they would save a desired state of a VM or container as a template and could use it as a starting point - for either starting over fresh or creating a different project.

So when the user creates a new VM or container he or she would get the option in the UI to choose a saved template as a starting point instead of standard image.