Creating a local virt-builder repository

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 /etc/virt-builder/repos.d/local.conf containing:

[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 index file:

[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 qemu-img info.

Other cloud image formats like qcow2 or uncompressed raw are possible, but you’ll need to read the manual closely and experiment a bit.

1 Comment

Filed under Uncategorized

One response to “Creating a local virt-builder repository

  1. Excellent info. Exactly what I needed to get started using the F21 templates that I built locally.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s