I was asked about this today and realized it’s not very well documented in the virt-builder manual page. So here goes.
Firstly you have to (as root) drop in the file
[local] uri=file:///home/YOUR_USERNAME/builder/index proxy=off
As non-root, create the
~/builder directory (you can of course put the repository somewhere else). Drop in the disk image — in the example below it’s called
os-image-1.xz, and next to it the following
[os-1] name=OS-1 arch=x86_64 file=os-image-1.xz checksum[sha512]=place the sha512sum of the compressed file here format=raw size=place the uncompressed virtual size of the disk image here compressed_size=place the compressed size of the disk image here expand=/dev/sda3 notes=My wonderful cloud OS, version 1
You only need the
expand field if you want image resizing to work (ie. the virt-builder
--size option), and other fields are documented in the manual. To get the uncompressed virtual size of a disk image, use
Other cloud image formats like qcow2 or uncompressed raw are possible, but you’ll need to read the manual closely and experiment a bit.