p2v-building(1)

πŸ’– p2v-building(1) πŸ’–

okay bestie, welcome to the Virtualization Support girlies club πŸŽ€ this is p2v-building(1) and it's literally the glow-up guide for building virt-p2v from source. no cap.


✨ NAME ✨

p2v-building β€” the how-to on building virt-p2v from source πŸ› οΈπŸ’…


🌸 DESCRIPTION 🌸

this whole manual page is just: how do i build virt-p2v from source. that's it. that's the vibe. πŸ¦‹

the main steps are giving very much checklist energy:

  • install the requirements πŸ’–
  • build β€” either from the git repository or from a tarball πŸ“¦
  • run the tests πŸ§ͺ
  • run the tools straight from the source directory, or install them πŸƒβ€β™€οΈ

πŸ‘‘ REQUIREMENTS πŸ‘‘

πŸ“ Full list of requirements πŸ“

  • qemu-img β‰₯ 2.2.0 β€” Required, periodt.
  • Gcc or Clang β€” Required, bestie. we use __attribute__((cleanup)), which is a GCC extension that Clang also supports πŸ’œ
  • Perl β€” Required. various build steps and tests are written in Perl. ngl tho, Perl is not needed at runtime. it's a build-time girly only πŸ’…
  • Perl Pod::Man β€” Required. part of Perl core 🫢
  • Perl Pod::Simple β€” Required. also part of Perl core 🫢
  • autoconf β€” Required if you're compiling from git. Optional if you're compiling from a tarball ✨
  • automake β€” Required if you're compiling from git. Optional if you're compiling from a tarball ✨
  • Perl-compatible Regular Expressions (PCRE2) library β€” Required πŸ”₯
  • libxml2 β€” Required 🌈
  • xz β€” Required ⭐
  • nbdkit β€” Optional. okay so virt-p2v(1) does require nbdkit, but it only needs to be present on the virt-p2v ISO β€” it does not need to be installed at compile time 😌
  • Glib β‰₯ 2.56 β€” Required πŸ’–
  • Gtk β‰₯ 3.22 β€” Required πŸ’–
  • D-Bus β€” Optional. here's the tea: if the D-Bus low level C API is available, virt-p2v can send a D-Bus message to logind to inhibit power saving (sleep, suspend, etc) during P2V conversions πŸ”‹βœ¨ and if this API is not available at build time, then very long conversions might get interrupted if the physical machine goes to sleep 😭 so like, keep that in mind.
  • valgrind β€” Optional. for testing memory problems 🧠
  • bash-completion β€” Optional. for tab-completion of commands in bash ⌨️

πŸ› οΈ BUILDING FROM GIT πŸ› οΈ

you will need to install additional dependencies autoconf and automake when building from git. not optional, bestie, sorry 😬

git clone https://github.com/libguestfs/virt-p2v
cd virt-p2v
autoreconf -i
./configure
make

slay. that's the whole thing πŸ’…


πŸ“¦ BUILDING FROM TARBALLS πŸ“¦

tarballs are downloaded from http://download.libguestfs.org/. 🌐

Stable tarballs are signed with the GnuPG key for rich@annexia.org, see https://pgp.mit.edu/pks/lookup?op=vindex&search=0x91738F73E1B768A0. and the fingerprint is F777 4FB1 AD07 4A7E 8C87 67EA 9173 8F73 E1B7 68A0 β€” verify it, queen πŸ‘‘

download and unpack the tarball. then:

cd virt-p2v-1.xx.yy
./configure
make

πŸ§ͺ RUNNING THE TESTS πŸ§ͺ

DO NOT run the tests as root! 😱 Virt-p2v can be built and tested as non-root. running the tests as root could even be dangerous β€” don't do it. fr fr. πŸ™…β€β™€οΈ

to run the tests, do:

make check

there are many more tests you can run, if you're feeling extra. see p2v-hacking(1) for details 🌟


🚫 INSTALLING 🚫

DO NOT use make install! πŸ’€ You'll end up with conflicting versions of virt-p2v installed, and this causes constant headaches for users. see the next section for how to use the ./run script instead πŸ‘€

distro packagers can use:

make DESTDIR=[temp-build-dir] install

(bestie, [temp-build-dir] is a placeholder β€” swap in your actual temp build dir 🫢)


πŸƒβ€β™€οΈ THE ./run SCRIPT πŸƒβ€β™€οΈ

you can test virt-p2v(1) and the other tools without needing to install them by using the ./run script in the top directory. this script works by setting several environment variables. iconic behaviour tbh ✨

for example:

./run virt-p2v-make-disk [usual virt-p2v-make-disk args ...]

the ./run script adds every virt-p2v binary to the $PATH, so the above example runs virt-p2v-make-disk from the build directory β€” not the globally installed virt-p2v-make-disk, if there even is one. main character energy, honestly πŸ‘‘


βš™οΈ SELECTED ./configure SETTINGS βš™οΈ

there are many ./configure options, like so many. use:

./configure --help

to list them all. this section only covers some of the more important ones πŸ’–

  • --enable-werror β€” this turns compiler warnings into errors (ie. -Werror). use this for development, especially when submitting patches. it should generally not be used for production or distro builds 🚨
  • --with-extra="distroname=version,..." β€” this option appends a text to the version of the virt-p2v tools. it's a free text field, but a good idea is to encode a comma-separated list of facts such as the distro name and version, and anything else that may help with debugging problems raised by users πŸ”
  • --with-extra="local" β€” same option, different flavour! for custom and/or local builds, this can be set to local to indicate this is not a distro build 🏠

🌈 USING CLANG (LLVM) INSTEAD OF GCC 🌈

export CC=clang
./configure
make

boom. clang girlies rise πŸ¦‹


πŸŽ€ BUILDING i686 32 BIT VIRT-P2V πŸŽ€

(This section only applies on the x86-64 architecture.) ⚠️

building a 32 bit virt-p2v (i686) binary improves compatibility with older hardware. πŸ–₯️ see virt-p2v-make-disk(1) for details.

although virt-p2v is a simple Gtk application, it is not especially easy to build just virt-p2v as a 32 bit application on a 64 bit host 😭 usually the simplest way is to use a 32 bit chroot or even a 32 bit virtual machine to build virt-p2v. do what you gotta do πŸ’…

on Fedora you can use the mock(1) tool. for example:

fedpkg mockbuild --root fedora-23-i386

this will result in a virt-v2v-*.i686.rpm file which can be unpacked to extract the 32 bit virt-p2v binary πŸ“¦βœ¨

the binary may be compressed to either virt-p2v.i686.xz, or $libdir/virt-p2v/virt-p2v.i686.xz or $VIRT_P2V_DATA_DIR/virt-p2v.i686.xz as appropriate. this enables the virt-p2v-make-disk(1) --arch option πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

p2v-hacking(1), p2v-release-notes(1), http://libguestfs.org/. go read 'em bestie πŸ“š


πŸ‘‘ AUTHORS πŸ‘‘

Richard W.M. Jones (rjones at redhat dot com) β€” the icon himself πŸ’–


Copyright (C) 2009-2019 Red Hat Inc.


πŸ“œ LICENSE πŸ“œ

this library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 🫢

this library 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 Lesser General Public License for more details ⚠️

you should have received a copy of the GNU Lesser General Public License along with this program. if not, see <https://www.gnu.org/licenses/>.


πŸ› BUGS πŸ›

to get a list of bugs against libguestfs (which include virt-p2v), 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:

  1. the version of virt-p2v.
  2. where you got virt-p2v (eg. which Linux distro, compiled from source, etc)
  3. describe the bug accurately and give a way to reproduce it. πŸ”βœ¨

and that's the whole page, bestie!! πŸŽ‰ this was p2v-building(1) from virt-p2v-1.42.4, dated 2026-04-08 β€” go build something cute πŸ’–πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from