virt-builder-repository(1)
π virt-builder-repository π
okay bestie, so this is a page from the Virtualization Support manual set β it's called virt-builder-repository(1) and honestly it's the glow-up your template repo has been waiting for β¨
πΈ NAME πΈ
virt-builder-repository β build a virt-builder source repository, easily, no cap π
π¦ SYNOPSIS π¦
virt-builder-repository /path/to/repository
[-i|--interactive] [--gpg-key KEYID]
π DESCRIPTION π
So virt-builder is this iconic tool for quickly building new virtual machines, right? And it can be configured to use template repositories. Slay. But here's the thing β creating and maintaining a repository involves soooo many tasks, and likeβ¦ they can be automated. That's the whole vibe. virt-builder-repository is the tool that helps you manage these repositories π«Ά
Here's what it does, step by step, main character energy:
virt-builder-repository loops over the files in the directory you gave it as the argument, then compresses the files whose names end in "qcow2", "raw", "img" or that have no extension at all, extracts data from them, and creates or updates the "index" file. periodt π
Some of the image-related data needed for the index file can't be computed from the image file itself β rude, I know π So virt-builder-repository first tries to find them in the existing index file. If data are still missing after that, they get prompted in interactive mode β otherwise an error gets triggered. no in-between, bestie.
And if a "KEYID" is provided, the generated index file will be signed with this GPG key π
β¨ EXAMPLES β¨
π Create the initial repository
Create a folder, copy your disk image template files into it, then run a command like this one:
virt-builder-repository --gpg-key "joe@hacker.org" -i /path/to/folder
Quick note: this example command runs in interactive mode. To run in automated mode, a minimal index file needs to be created before running the command, containing sections like this one:
[template_id]
file=template_filename.qcow.xz
The file value needs to match the image name extended with the ".xz" suffix if the --no-compression parameter is not provided β or just the image name if no compression is involved. Other optional data can be prefilled too. Default values are computed by inspecting the disk image. For more information, see "Creating and signing the index file" in virt-builder(1) π
π Update images in an existing repository
In this use case, a new image β or a new revision of an existing image β needs to be added to the repository. Place the corresponding image template files in the repository folder. easy.
To update the revision of an image, the file needs to have the same name as the existing one (without the "xz" extension). matching names, matching energy π¦
Same as in the repository creation use case, a minimal fragment can be added to the index file for the automated mode. And yes, this can be done on the signed index β even if it may sound a strange idea: the index will be signed again by the tool. it's fine, trust the process π
To remove an image from the repository, just remove the corresponding image file before running virt-builder-repository. bye bestie π
Then running the following command will complete and update the index file:
virt-builder-repository --gpg-key "joe@hacker.org" -i /path/to/folder
virt-builder-repository works in a temporary folder inside the repository one. So if anything wrong happens when running the tool, the repository is left untouched. safety first, always π
β OPTIONS β
--helpβ display help.--gpgGPG β specify an alternategpg(1)(GNU Privacy Guard) binary. You can also use this to add gpg parameters, for example to specify an alternate home directory:
virt-builder-repository --gpg "gpg --homedir /tmp" [...]
This can also be used to avoid gpg asking for the key passphrase:
virt-builder-repository --gpg "gpg --passphrase-file /tmp/pass --batch" [...]
-KKEYID--gpg-keyKEYID β specify the GPG key to be used to sign the repository index file. If not provided, the index will be left unsigned."KEYID"is used to identify the GPG key to use. This value is passed to gpg's--default-keyoption and can thus be an email address or a fingerprint. π
NOTE: by default, virt-builder-repository searches for the key in the user's GPG keyring.
-i--interactiveβ prompt for missing data. Default values are computed from the disk image.
When prompted for data, inputting "-" corresponds to leaving the value empty. This can be used to avoid setting the default computed value. cute little trick, iykyk π
--no-compressionβ don't compress the template images.--machine-readable--machine-readable=format β this option is used to make the output more machine friendly when being parsed by other programs. See"MACHINE READABLE OUTPUT"below.--colors--coloursβ use ANSI colour sequences to colourize messages. This is the default when the output is a tty. If the output of the program is redirected to a file, ANSI colour sequences are disabled unless you use this option. π-q--quietβ don't print ordinary progress messages.-v--verboseβ enable debug messages and/or produce verbose output.
When reporting bugs, use this option and attach the complete output to your bug report. please, it helps so much π
-V--versionβ display version number and exit.--wrapβ wrap error, warning, and informative messages. This is the default when the output is a tty. If the output of the program is redirected to a file, wrapping is disabled unless you use this option.-xβ enable tracing of libguestfs API calls.
π MACHINE READABLE OUTPUT π
The --machine-readable option can be used to make the output more machine friendly, which is useful when calling virt-builder-repository from other programs, GUIs etc. π€
Use the option on its own to query the capabilities of the virt-builder-repository binary. Typical output looks like this:
$ virt-builder-repository --machine-readable
virt-builder-repository
A list of features is printed, one per line, and the program exits with status 0. slay.
It is possible to specify a format string for controlling the output; see "ADVANCED MACHINE READABLE OUTPUT" in guestfs(3).
π₯ EXIT STATUS π₯
This program returns 0 if successful, or non-zero if there was an error. that's it, that's the vibe check.
π¦ SEE ALSO π¦
virt-builder(1) http://libguestfs.org/.
π AUTHOR π
CΓ©dric Bosdonnat mailto:cbosdonnat@suse.com
π COPYRIGHT π
Copyright (C) 2016-2025 SUSE Inc.
πΈ LICENSE πΈ
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
π BUGS π
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
When reporting a bug, please supply:
- The version of libguestfs.
- Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- Describe the bug accurately and give a way to reproduce it.
- Run
libguestfs-test-tool(1)and paste the complete, unedited output into the bug report. please and thank you π«Ά
and that's the whole page bestie!! π§ this one's from guestfs-tools-1.57.3, dated 2026-09-16 β go build that repository, you're gonna ate πβ¨π
π¦ where this page comes from
- centos-stream 10: guestfs-tools 1.57.3-1.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms