While this doesn't answer your question, I use Docker for this exact purpose, since you can throw away everything if it fails, whilst keeping a recipe for success documented in a Dockerfile.