Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1296606

Summary: virt-v2v doesn't remove VirtualBox additions correctly because of file quoting
Product: Red Hat Enterprise Linux 7 Reporter: Bimal Chollera <bcholler>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: juzhou, mxie, mzhan, ptoscano, sherold, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.32.0-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 17:57:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bimal Chollera 2016-01-07 16:11:53 UTC
Description of problem:

virt-v2v conversion fails with the following message:

guestfsd: error: is_file_stub: path must start with a / character^M
libguestfs: trace: is_file = -1 (error)
virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start with a / character


Version-Release number of selected component (if applicable):

RHEL 7.2
virt-v2v-1.28.1-1.55.el7.x86_64
libguestfs-1.28.1-1.55.el7.x86_64
qemu-kvm-rhev-2.1.2-23.el7_1.10.x86_64 or qemu-kvm-rhev-2.3.0-31.el7_2.4.x86_64 , both show the same behavior 

How reproducible:

Run virt-v2v conversion and observe the error.

virt-v2v -v -x -i disk ./disk1.img -o rhev -os RHEV1:/domains/export --network rhevm

Steps to Reproduce:
1.
2.
3.

Actual results:

virt-v2v fails with error.

Expected results:

virt-v2v should complete without errors.

Additional info:

Comment 7 Richard W.M. Jones 2016-01-11 11:59:24 UTC
To reproduce this bug (a little bit involved I'm afraid!)

(1) Download the latest VirtualBox Guest Additions ISO from
http://download.virtualbox.org/virtualbox/
eg: http://download.virtualbox.org/virtualbox/5.0.10/VBoxGuestAdditions_5.0.10.iso

(2) Install a CentOS 7.2 VM:
$ virt-builder centos-7.2

(3) Boot CentOS 7.2 VM with the ISO attached:

$ virt-install --import --name tmp-bz1296606 --ram 4096 --disk path=centos-7.2.img,format=raw --os-variant rhel7 --disk device=cdrom,path=VBoxGuestAdditions_5.0.10.iso,format=raw --boot hd

(4) Log in as root (using the password printed in step 2).

(5) Mount the VBox Additions in the guest:

# mount /dev/cdrom /mnt

(6) Run the VBox Additions script to install them in the guest:

# yum install bzip2
# /mnt/VBoxLinuxAdditions.run

This should create /opt/VBoxGuestAdditions-XXX
and /var/lib/VBoxGuestAdditions/config.

(7) Shut down the guest and delete the libvirt config:

$ virsh undefine tmp-bz1296606

(8) You will now have a guest image containing VirtualBox Guest
Additions that you can try to convert using virt-v2v:

$ ll centos-7.2.img 
-rw-r--r--. 1 rjones rjones 6442450944 Jan 11 11:52 centos-7.2.img
$ virt-v2v -i disk centos-7.2.img -o null
[...]
[  16.1] Converting CentOS Linux release 7.2.1511 (Core)  to run on KVM
virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start 
with a / character

Comment 8 Richard W.M. Jones 2016-01-11 13:41:39 UTC
Interestingly this bug existed in old virt-v2v too.

I have pushed a commit upstream:

https://github.com/libguestfs/libguestfs/commit/64af88a1b766edddeb1dcf845019f1ed01202d0b

Comment 10 Xiaodai Wang 2016-02-25 06:45:12 UTC
I can reproduce it following the steps in comment 7.

# rpm -q libguestfs virt-v2v
libguestfs-1.28.1-1.55.el7.x86_64
virt-v2v-1.28.1-1.55.el7.x86_64

steps:
1) Download the latest VirtualBox Guest Additions ISO from
   http://download.virtualbox.org/virtualbox/
   eg: http://download.virtualbox.org/virtualbox/5.0.10/VBoxGuestAdditions_5.0.10.iso
2) Prepare a guest image which has rhel7 installed.
3) Create a temp guest by the image in step2 and with VBos ISO attached.
$ virt-install --import --name tmp-bz1296606 --ram 4096 --disk path=centos-7.2.img,format=raw --os-variant rhel7 --disk device=cdrom,path=VBoxGuestAdditions_5.0.10.iso,format=raw --boot hd
4) Log in the guest as root.
5) Mount the VBox Additions in the guest:
# mount /dev/cdrom /mnt
6) Run the VBox Additions script to install them in the guest:
# yum install bzip2
# /mnt/VBoxLinuxAdditions.run

This should create /opt/VBoxGuestAdditions-XXX
and /var/lib/VBoxGuestAdditions/config.

7) Shut down the guest and delete the libvirt config.

$ virsh undefine tmp-bz1296606

8) You will now have a guest image containing VirtualBox Guest
Additions that you can try to convert using virt-v2v:

# virt-v2v -i disk rhel7.2-1030-clone.qcow2 -o null
[   0.0] Opening the source -i disk rhel7.2-1030-clone.qcow2
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[ 105.0] Initializing the target -o null
[ 105.0] Inspecting the overlay
[ 114.0] Checking for sufficient free disk space in the guest
[ 114.0] Estimating space required on target for each disk
[ 114.0] Converting Red Hat Enterprise Linux Server release 7.2 (Maipo) to run on KVM
virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start 
with a / character

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


And the try it with latest libguestfs.

# rpm -q libguestfs virt-v2v
libguestfs-1.32.2-6.el7.x86_64
virt-v2v-1.32.2-6.el7.x86_64

# virt-v2v -i disk rhel7.2-1030-clone.qcow2 -o null
[   0.0] Opening the source -i disk rhel7.2-1030-clone.qcow2
[   0.1] Creating an overlay to protect the source from being modified
[   0.5] Initializing the target -o null
[   0.5] Opening the overlay
[  55.4] Inspecting the overlay
[  64.6] Checking for sufficient free disk space in the guest
[  64.6] Estimating space required on target for each disk
[  64.6] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: warning: /files/boot/grub2/device.map/hd0 references unknown 
device "vda".  You may have to fix this entry manually after conversion.
virt-v2v: This guest has virtio drivers installed.
[  91.0] Mapping filesystem data to avoid copying unused and blank areas
[  92.2] Closing the overlay
[  92.5] Checking if the guest needs BIOS or UEFI to boot
[  92.5] Assigning disks to buses
[  92.5] Copying disk 1/1 to /var/tmp/null.Z660lw/sda (qcow2)
    (100.00/100%)
[ 125.1] Creating output metadata
[ 125.1] Finishing off

So move the bug to VERIFIED.

Comment 12 errata-xmlrpc 2016-11-03 17:57:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2576.html