At my current workplace we use libvirt and qemu/kvm running on the latest Ubuntu LTS release for our cloud platform. Recently, I wanted to use the awesome tool to simplify the provisioning of guest images. The configuration is for Fedora, but it can easily be done on Ubuntu.
First install the prerequisite packages:
apt-get install bash sed qemu-img virtinst cloud-utils util-linux genisoimage python-guestfs perl libguestfs-tools libguestfs-perl cloud-utils openssl util-linux
Then clone the git repo:
cd /opt sudo git clone git://github.com/lzap/snap-guest.git sudo ln -s /opt/snap-guest/snap-guest /usr/local/bin/snap-guest
You’re now good to go! From the snap-guest link (https://github.com/lzap/snap-guest):
“It’s recommended to use “base” string in the guest name (e.g. fedora-10-base or rhel4-base) to differentiate those files (snap-guest lists them using -l option), but it is not mandatory (option -a lists them all).”
I’d done this previously anyways, so was very easy in my case.
./snap-guest --list ./snap-guest -p /mnt/data/images --list-all
Visit the aforementioned link for further details.