ANNOUNCE: virt-v2v 2.10 released
by Richard W.M. Jones
I'm pleased to announce the release of virt-v2v 2.10. Virt-v2v is a
standalone command line tool for converting virtual machines from
VMware (and some other hypervisors) to run on KVM. You can read more
about it and associated tools here:
https://libguestfs.org/virt-v2v.1.html
https://github.com/libguestfs/virt-v2v
Tarballs for this new stable release can be downloaded from:
https://download.libguestfs.org/virt-v2v/2.10-stable/
The release notes are attached below, but you can also read them
online here:
https://libguestfs.org/virt-v2v-release-notes-2.10.1.html
Rich.
These are the release notes for virt-v2v 2.10. This describes the major
changes since 2.8.
Virt-v2v 2.10.0 was released on 6th January 2026.
New features
In -o kubevirt output mode, new -oo disk and -oo create options let you
respectively override the output disk names, and avoid disk creation,
letting you pre-create disks before running virt-v2v.
For VDDK sources:
• A new -io vddk-compression option lets you enable compression for
data read over the network.
• -io vddk-thumbprint is now optional. If omitted, virt-v2v will
automatically work it out from the VMware server.
New --memsize and --smp options which let you override the default
amount of memory and number of vCPUs assigned to the appliance. For
certain complex guests it is occasionally necessary to adjust these,
although usually virt-v2v should do the right thing automatically.
virt-v2v-inspector(1) now detects Windows Antivirus and Group policy,
and if found adds "<windows_antivirus/>" and "<windows_group_policy/>"
elements respectively.
Features removed
The following virt-v2v options have been removed:
-io vddk-noextents
This was an undocumented troubleshooting option. Any uses of it can
simply be removed.
--sm* options
The Red Hat Subscription Manager customization options did not work
and have been removed (Cole Robinson).
Other fixes
When checking ext4 filesystems before conversion, replay the dirty log
to avoid e2fsck failing (thanks Ming Xie).
When checking XFS filesystems before and after conversion, cap the
amount of memory used by the xfs_repair(8) utility (thanks Ming Xie,
Eric Sandeen).
For output modes that write to local disk, in debugging output we now
report the amount of space on the local (host) disk, in order to make it
easier to debug certain out of space problems (thanks Martin Necas, Alex
Kalenyuk).
Use nbdkit-count-filter(1) (if installed). In debugging mode this will
print a summary of the number of bytes read, written, trimmed and zeroed
when copying the guest, which can be useful when you want to know how
much data was sent over the wire by virt-v2v.
For Windows virtio driver installation:
• Fix this when there is a pending Windows Update (Vadim Rozenfeld).
• Fix this when Windows changes the timezone during firstboot (Vadim
Rozenfeld).
• Skip driver installation when a newer/better virtio driver is
already installed (Vadim Rozenfeld).
• Slightly modify how we patch the regsitry so that we don't break
both Windows Update and "pnputil /e" driver enumeration.
Display the versions of libnbd and nbdcopy in debugging output.
Fix SELinux relabelling for guests which use a separate /usr partition
(thanks Germano Veit Michel, Ming Xie).
We now attempt to generate correct boot order for Linux BIOS guests.
This is necessary with current SeaBIOS so that it initializes the
correct boot disk, allowing the guest to boot if the bootloader is not
on the first disk.
Name nbdkit subprocesses using the new --name option in nbdkit ≥ 1.46.
This allows debugging and error messages from different nbdkit instances
to be distinguished in log files.
A virtual floppy disk is no longer added to the output guest if qemu
does not support it, even if the input guest has a floppy disk (Cole
Robinson).
During conversion of Windows guests, if we have to create
C:\Program Files\Guestfs, it is now created read-only for
non-Administrator accounts (Cole Robinson).
For RHEL 7.2 conversions, ignore archived LVM VG configuration files,
which previously caused a crash in Augeas during conversion (thanks Sean
Haselden, Alasdair Kergon).
Handle .vmdk files in subdirectories on the ESXi server (thanks Ming
Xie).
Fix UEFI conversions of Windows guests if C:\Windows\Temp exists but has
a different upper/lowercase from the directory that Windows normally
creates.
Documentation
Refactored and improved documentation (thanks Ming Xie).
Link from virt-v2v(1) directly to official VMware documentation for
removing VMware Tools.
Build changes
libguestfs ≥ 1.58 is required.
nbdkit ≥ 1.46 is required.
Update "make check-slow" ("slow tests") so we test more recent guest
types.
We now test Windows UEFI conversions in the test suite.
"./configure" output has been colourized.
New configure --disable-block-driver, --disable-glance, --disable-ovirt
and --disable-xen options allowing you to disable those features at
compile time.
Basic github CI has been implemented. Pull requests now do the
equivalent of "./configure --enable-werror && make && make check" on a
few common platforms.
Internals
The internal podwrapper tool used to process the documentation now has a
new --pp to allow a preprocessor to be used. In particular we now use
m4(1) to preprocess some documentation.
In Makefile.am, "$(NULL)" can be used as a list terminator. This
improves patch application.
Bugs fixed
https://issues.redhat.com/browse/RHEL-100682
Installing drivers on firstboot sometimes fail with PnP service not
available [rhel-9.7]
https://issues.redhat.com/browse/RHEL-101599
RFE: Allow -o kubevirt disks to be specified
https://issues.redhat.com/browse/RHEL-102734
virt-v2v can't convert guest with multiple disks from VMware since
nbdkit-1.44.0-1
https://issues.redhat.com/browse/RHEL-104352
Change permission of guestfs folder created
https://issues.redhat.com/browse/RHEL-108174
selinux-relabel doesn't work across filesystem boundaries (because
setfiles doesn't) [rhel-9.7]
https://issues.redhat.com/browse/RHEL-108991
RFE: Set boot order for Linux BIOS guests based on grub location
[rhel-10.1]
https://issues.redhat.com/browse/RHEL-110742
RFE: Set boot order for guests in -o kubevirt output mode
[rhel-10.1]
https://issues.redhat.com/browse/RHEL-113820
guestfs crashed when running aug-init during a conversion
https://issues.redhat.com/browse/RHEL-121728
v2v can't convert guest with multiple windows OS on rhel10
https://issues.redhat.com/browse/RHEL-124569
Windows migration failed: mkdtemp: /Windows/Temp/ESP_XXXXXX: No such
file or directory [rhel-10.2]
https://issues.redhat.com/browse/RHEL-125116
setfiles runs out of memory in glibc fts_read [rhel-10.2 doc fix]
https://issues.redhat.com/browse/RHEL-125956
virt-inspector detect if AV/GPOs are present in a VM [virt-v2v]
https://issues.redhat.com/browse/RHEL-90175
Should remove floppy device for the guest after v2v conversion
[rhel-10.2]
https://issues.redhat.com/browse/RHEL-97600
Virt-v2v fails to convert some guests with libguestfs error: e2fsck
https://issues.redhat.com/browse/RHEL-99313
Improve the error info when converting a guest with less than 100
inodes by virt-v2v
https://issues.redhat.com/browse/RHEL-99745
Improve info about guest must not be running or must be shut down in
virt-v2v related man page [rhel-10.1]
https://github.com/libguestfs/virt-v2v/issues/100
Please implement nbdkit-vddk-plugin's compression parameter in
virt-v2v
SEE ALSO
virt-v2v(1).
AUTHORS
Authors of virt-v2v 2.10:
Alan Alberghini
Cole Robinson
Fco. Javier F. Serrador
Richard W.M. Jones
Ricky Tigg
Vadim Rozenfeld
Yuri Chornoivan
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
1 week, 4 days
[nbdkit PATCH] blocksize-policy: Fix assertion failure on unaligned block status
by Eric Blake
The blocksize-policy filter had a minor denial-of-service security
flaw, where a client could trigger the server to die from an assertion
failure by sending an unaligned block status request in violation of
NBD protocol recommendations (see the updated test within the patch
for a sample trigger). Note that libnbd makes it difficult to
trigger, as by default an unaligned request won't be sent to the
server. Additionally, use of blocksize-error-policy=error is not
impacted; and although the blocksize-policy filter defaults to an
error policy of allow, it makes less sense to use the filter in
production without opting in to blocksize-error-policy=error.
Rather than complicating the blocksize-policy filter to manually munge
its extents requests to an aligned boundary, I opted to instead relax
the server's nbdkit_extents_aligned to support unaligned inputs by
first widening the request to alignment boundaries and then truncating
back to the original offset after at least one aligned extent is
learned. The function still stops at the first unaligned extent,
rather than trying harder to use all of the plugin's underlying
information; I have plans to add a parameter in a later patch to
optionally behave more like nbdkit_extents_full, but wanted this patch
to focus on merely the assertion failure.
An audit of all callers of nbdkit_extents_aligned shows that only
blocksize-policy was vulnerable; the blocksize and swab filters only
ever pass in aligned values. And while at it, I made the interface
accept a 64-bit count, which makes usage easier when a client widens a
request near the 4G boundary up to an alignment boundary.
Since the flaw is minor, I've gone ahead and made this patch public.
However, in parallel I am pursuing with Red Hat security on whether a
CVE needs to be assigned.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
docs/nbdkit-filter.pod | 7 ++--
include/nbdkit-filter.h | 2 +-
server/extents.c | 25 +++++++----
tests/test-blocksize-policy-extents.sh | 57 ++++++++++++++++++++++++++
4 files changed, 79 insertions(+), 12 deletions(-)
diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod
index 022799f4..1bb01675 100644
--- a/docs/nbdkit-filter.pod
+++ b/docs/nbdkit-filter.pod
@@ -1043,7 +1043,7 @@ A convenience function is provided to filters only which makes it
easier to ensure that the client only encounters aligned extents.
int nbdkit_extents_aligned (nbdkit_next *next,
- uint32_t count, uint64_t offset,
+ uint64_t count, uint64_t offset,
uint32_t flags, uint32_t align,
struct nbdkit_extents *extents, int *err);
@@ -1052,8 +1052,9 @@ obtained, where C<align> is a power of 2. Anywhere the underlying
plugin returns differing extents within C<align> bytes, this function
treats that portion of the disk as a single extent with zero and
sparse status bits determined by the intersection of all underlying
-extents. It is an error to call this function with C<count> or
-C<offset> that is not already aligned.
+extents. This function supports unaligned C<offset> or C<count>, but
+the given C<extents> must begin at C<offset> and not have any extents
+added yet.
=head2 C<.cache>
diff --git a/include/nbdkit-filter.h b/include/nbdkit-filter.h
index ffa7fa5d..aa99af65 100644
--- a/include/nbdkit-filter.h
+++ b/include/nbdkit-filter.h
@@ -135,7 +135,7 @@ NBDKIT_EXTERN_DECL (struct nbdkit_extents *, nbdkit_extents_full,
NBDKIT_ATTRIBUTE_NONNULL ((1, 5)));
NBDKIT_EXTERN_DECL (int, nbdkit_extents_aligned,
(nbdkit_next *next,
- uint32_t count, uint64_t offset,
+ uint64_t count, uint64_t offset,
uint32_t flags, uint32_t align,
struct nbdkit_extents *extents, int *err)
NBDKIT_ATTRIBUTE_NONNULL ((1, 6, 7)));
diff --git a/server/extents.c b/server/extents.c
index e0a2b224..8e507a94 100644
--- a/server/extents.c
+++ b/server/extents.c
@@ -213,7 +213,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts,
/* Compute aligned extents on behalf of a filter. */
NBDKIT_DLL_PUBLIC int
nbdkit_extents_aligned (struct context *next_c,
- uint32_t count, uint64_t offset,
+ uint64_t count, uint64_t offset,
uint32_t flags, uint32_t align,
struct nbdkit_extents *exts, int *err)
{
@@ -222,22 +222,25 @@ nbdkit_extents_aligned (struct context *next_c,
struct nbdkit_extent *e, *e2;
int64_t size;
+ assert (exts->extents.len == 0);
+ assert (exts->start == offset);
+
size = next->get_size (next_c);
if (size == -1) {
*err = EIO;
return -1;
}
- assert (IS_ALIGNED (offset, align));
- assert (IS_ALIGNED (count, align) || offset + count == size);
+ exts->start = ROUND_DOWN (offset, align);
+ count = MIN (ROUND_UP (offset + count, align), size) - exts->start;
/* Perform an initial query, then scan for the first unaligned extent. */
- if (next->extents (next_c, count, offset, flags, exts, err) == -1)
+ if (next->extents (next_c, count, exts->start, flags, exts, err) == -1)
return -1;
for (i = 0; i < exts->extents.len; ++i) {
e = &exts->extents.ptr[i];
if (!IS_ALIGNED (e->length, align)) {
/* If the unalignment is past align, just truncate and return early */
- if (e->offset + e->length > offset + align) {
+ if (e->offset + e->length > exts->start + align) {
e->length = ROUND_DOWN (e->length, align);
exts->extents.len = i + !!e->length;
exts->next = e->offset + e->length;
@@ -271,13 +274,13 @@ nbdkit_extents_aligned (struct context *next_c,
CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents2 = NULL;
extents2 = nbdkit_extents_new (e->offset + e->length,
- offset + align);
+ exts->start + align);
if (extents2 == NULL) {
*err = errno;
return -1;
}
if (next->extents (next_c, align - e->length,
- offset + e->length,
+ exts->start + e->length,
flags & ~NBDKIT_FLAG_REQ_ONE,
extents2, err) == -1)
return -1;
@@ -298,7 +301,13 @@ nbdkit_extents_aligned (struct context *next_c,
break;
}
}
- /* Once we get here, all extents are aligned. */
+ /* Once we get here, all extents are aligned. Trim back to the
+ * original offset if it was unaligned.
+ */
+ e = &exts->extents.ptr[0];
+ e->length -= offset - exts->start;
+ e->offset += offset - exts->start;
+ exts->start = offset;
return 0;
}
diff --git a/tests/test-blocksize-policy-extents.sh b/tests/test-blocksize-policy-extents.sh
index 46f804bb..688161ba 100755
--- a/tests/test-blocksize-policy-extents.sh
+++ b/tests/test-blocksize-policy-extents.sh
@@ -40,6 +40,8 @@ set -u
requires_run
requires_plugin data
requires_nbdinfo
+requires nbdsh --base-allocation --version
+requires_nbdsh_uri
files="blocksize-policy-extents.out"
rm -f $files
@@ -69,3 +71,58 @@ diff -u - blocksize-policy-extents.out <<EOF
0 4294967296 3 hole,zero
4294967296 512 0 data
EOF
+
+# Check that unaligned requests are rejected when required
+define script <<\EOF
+def print_extents(context, offset, extents, err):
+ assert context == nbd.CONTEXT_BASE_ALLOCATION;
+ print(extents)
+
+h.set_strict_mode(0)
+try:
+ h.block_status(511, 512, print_extents)
+except nbd.Error:
+ print("detected misaligned count")
+try:
+ h.block_status(512, 511, print_extents)
+except nbd.Error:
+ print("detected misaligned offset")
+h.block_status(513, 32256, print_extents)
+h.block_status(1, 32768, print_extents)
+EOF
+export script
+nbdkit data "@32k 1" --filter=blocksize-policy \
+ blocksize-minimum=512 blocksize-error-policy=error \
+ --run 'nbdsh --base-allocation -u "$uri" -c "$script"' \
+ > blocksize-policy-extents.out
+diff -u - blocksize-policy-extents.out <<EOF
+detected misaligned count
+detected misaligned offset
+[512, 3]
+[1, 0]
+EOF
+
+# Check that unaligned requests still work when permitted (a user could trigger
+# an assertion failure prior to 1.48, as a minor security flaw)
+define script <<\EOF
+def print_extents(context, offset, extents, err):
+ assert context == nbd.CONTEXT_BASE_ALLOCATION;
+ print(extents)
+
+h.set_strict_mode(0)
+h.block_status(511, 512, print_extents)
+h.block_status(512, 511, print_extents)
+h.block_status(2, 32767, print_extents)
+h.block_status(1, 32768, print_extents)
+EOF
+export script
+nbdkit data "@32k 1" --filter=blocksize-policy \
+ blocksize-minimum=512 blocksize-error-policy=allow \
+ --run 'nbdsh --base-allocation -u "$uri" -c "$script"' \
+ > blocksize-policy-extents.out
+diff -u - blocksize-policy-extents.out <<EOF
+[32256, 3]
+[32257, 3]
+[1, 3]
+[1, 0]
+EOF
--
2.52.0
1 week, 5 days
ANNOUNCE: libguestfs 1.58 released
by Richard W.M. Jones
I'm pleased to announce the new stable release of libguestfs.
Libguestfs is a library for creating and manipulating disk images,
virtual machines and similar. You can read more about it here:
https://libguestfs.org/
The release notes for this version are attached below, or you can read
them online here:
https://libguestfs.org/guestfs-release-notes-1.58.1.html
You can get source tarballs from:
https://download.libguestfs.org/1.58-stable/
Rich.
RELEASE NOTES FOR LIBGUESTFS 1.58
These are the release notes for libguestfs stable release 1.58. This
describes the major changes since 1.56.
Libguestfs 1.58.0 was released on 5th January 2026.
Inspection
Fix inspection of SLES 15 guests that have an encrypted Btrfs
filesystem, by correctly parsing /etc/crypttab (Cole Robinson).
Windows named drives (like "D:") which point to completely blank disks
are now ignored instead of causing an error (thanks Ming Xie, Ameen
Barakat).
Existing code in virt-v2v which recognized Windows Antivirus (AV)
software is now part of inspection. The new code recognizes a wider
range of AV software.
API
"guestfs_selinux_relabel" was deprecated, replaced by new
"guestfs_setfiles". This new API also uses the setfiles(8) -A option to
reduce memory usage.
New "guestfs_ntfs_chmod" API which changes the permissions of Windows
paths (Cole Robinson).
In the list of structures returned by
"guestfs_inspect_get_applications2", a new "app2_class" field has been
added. This classifies the application by its primary usage, but
currently only "antivirus" can be returned here for Windows AV software.
New "guestfs_inspect_get_windows_group_policy" API which reports whether
Group Policy Objects were found in the Windows guest.
"guestfs_btrfs_subvolume_show" would sometimes crash when parsing the
snapshots of a Btrfs subvolume. Furthermore, in any API that returned a
device name associated with a Btrfs volume, the device name might not be
translated correctly resulting in the wrong device name being returned.
(Both problems fixed by Arye Yurkovsky.)
Fix a memory leak in "guestfs_filesystem_walk" (Susant Sahani).
In "guestfs_disk_create", when creating raw block devices, check for
errors in the close(2) system call, ensuring we don't miss any delayed
I/O errors (Susant Sahani).
In several LVM-related APIs, it was possible for an internal failure to
happen for logical volumes which are incomplete (eg. missing a physical
volume). This was fixed by skipping these LVs (Arye Yurkovsky).
Language bindings
Note that GObject / Javascript bindings will be removed in the next
release of libguestfs.
Ruby deprecation warnings were fixed (Cole Robinson).
Documentation
Fix links to ntfs-3g documentation (Cole Robinson).
Build changes
libvirt ≥ 11.10.0 with passt support is now required.
qemu ≥ 7.2.0 is now required.
Fix guestmount compilation on macOS (thanks Mohamed Akram).
Basic github CI has been implemented. Pull requests now do the
equivalent of "./configure --enable-werror && make && make check" on a
few common platforms.
Several obsolete tests were removed, and the test suite in general has
been fixed and made more robust against missing dependencies and other
common problems (Cole Robinson).
In test output we no longer print absolute paths for the test names
(Cole Robinson).
"AM_GNU_GETTEXT" usage was completely removed and replaced with a simple
test for LIBINTL (Cole Robinson).
build-aux/config.rpath was removed since it was no longer actually used
(Cole Robinson).
Fix const-correctness issues caused by changes to the strchr(3) and
strrchr(3) functions in C23.
Internals
If the "sit.ko" Linux kernel module is loaded, then a "sit0" (a kind of
IPv6 tunnel) network device is created in the appliance. Ignore this as
it would break appliance networking (thanks Srikanth Aithal, Stefano
Brivio).
In the direct backend we simplified probing of qemu features by assuming
that qemu ≥ 7.2.0.
In the libvirt backend:
• Fix compatibility with SeaBIOS 1.17 (thanks Gerd Hoffmann).
• We made some changes to how errors from the libvirt call
"virDomainDestroyFlags" are handled when shutting down the
appliance. If there is an error, the error message is now printed
when debug is enabled (but it is still non-fatal). Also we sleep
between retries instead of busy looping.
• The libvirt backend now adds a virtio-rng device to the appliance
unconditionally so that we always have good entropy (for
cryptographic operations).
• When running as root, remove explicit socket relabelling and allow
libvirt to relabel the sockets instead (Cole Robinson).
• Enable sVirt for the appliance, which was sometimes accidentally
disabled (Cole Robinson).
During inspection of Linux/Unix guests, the contents of guest /etc/fstab
and some mdadm files are written to debug output. This can help with
debugging inspection issues (thanks Ming Xie).
When the appliance starts up, if debugging is enabled, then we log
lsblk(8) and blkid(8) info to debugging output (thanks Ming Xie).
In the generator StringList(Pathname) was implemented for OCaml
functions.
Add more debugging in Windows Registry inspection functions to make it
easier to track what's going on.
OCaml "{|...|}" string literals are now used in the code for things like
literal Windows batch files that we inject into the guest, regular
expressions, and POD documentation in the generator (thanks Nicolas
Ojeda Bar).
Internal calls to pcre2_match(3) which return an unexpected error now
emit a debug message, although the error is still ignored.
Multiple code cleanups throughout (Susant Sahani).
Fix order of inclusion of Python header file because of changes in
recent Python 3.14.
Some test scripts which were written in Perl before have been rewritten
in Python (Susant Sahani).
Bugs fixed
https://issues.redhat.com/browse/RHEL-104352
Change permission of guestfs folder created
https://issues.redhat.com/browse/RHEL-106490
Adding the commands "lsblk", "cat /etc/fstab" and "blkid" to the v2v
debug log
https://issues.redhat.com/browse/RHEL-108803
Parted fails to read a blank disk "virt-v2v: error: libguestfs
error: inspect_os: parted: /dev/sdb: parted exited with status 1:
Error: /dev/sdb: unrecognised disk label: Invalid argument"
[rhel-9.7]
https://issues.redhat.com/browse/RHEL-111165
[Testonly]virt-v2v of RHEL 8.10 VM fails because setfiles invoked
oom-killer
https://issues.redhat.com/browse/RHEL-111505
Lots of memory used in 'setfiles' utility / 'restorecon_sb' function
https://issues.redhat.com/browse/RHEL-113397
[DEV Task]: The available subscriptions of guest sometimes can't be
shown unless use --sm-remove and --sm-unregister options to remove
all subscriptions from the guest
https://issues.redhat.com/browse/RHEL-113398
[DEV Task]: Virt-v2v can't use --sm-remove and --sm-unregister
options to remove the subscriptions from guest if consumer profile
has been deleted from the guest.
https://issues.redhat.com/browse/RHEL-114292
Use setfiles -A option when relabelling
https://issues.redhat.com/browse/RHEL-121076
[libguestfs] [aarch64] libguestfs-test-tool failed with
LIBGUESTFS_BACKEND=direct
https://issues.redhat.com/browse/RHEL-125846
virt-inspector detect if AV/GPOs are present in a VM
https://issues.redhat.com/browse/RHEL-93584
virt-v2v can't convert sles15sp6 guest with encrypted brtfs
fliesystem
https://github.com/libguestfs/libguestfs/issues/180
Fails to build with macFUSE
https://github.com/libguestfs/libguestfs/issues/234
make -j8 check failures with selinux enforcing
SEE ALSO
guestfs-examples(1), guestfs-faq(1), guestfs-performance(1),
guestfs-recipes(1), guestfs-testing(1), guestfs(3), guestfish(1),
http://libguestfs.org/
AUTHORS
Arye Yurkovsky
Cole Robinson
Ettore Atalan
Fco. Javier F. Serrador
Pavel Borecki
Richard W.M. Jones
Susant Sahani
Yuri Chornoivan
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
1 week, 5 days