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 1349237 - virt-inspector can not get windows drive letters for GPT disks
Summary: virt-inspector can not get windows drive letters for GPT disks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-23 03:19 UTC by Xianghua Chen
Modified: 2016-11-03 18:01 UTC (History)
3 users (show)

Fixed In Version: libguestfs-1.32.5-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:01:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log.virt-inspector-win8 (124.86 KB, text/plain)
2016-06-23 03:19 UTC, Xianghua Chen
no flags Details
system (7.50 MB, application/octet-stream)
2016-06-23 10:26 UTC, Xianghua Chen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 0 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Description Xianghua Chen 2016-06-23 03:19:55 UTC
Created attachment 1171226 [details]
log.virt-inspector-win8

Description of problem:
I prepared a Windows8.1 image with GPT disk, but I can't get the drive letters using virt-inspector.
Windows7 also has the same problem.

You can see the full log with -v -x in the attachment.



Version-Release number of selected component (if applicable):
libguestfs-1.32.5-3.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Prepare an Windows8.1 image with GPT disk:
First, prepare a Win8 iso.
Then, download and install OVMF ( The UEFI firmware for virtual machines).
Then,  use virt-manager to install Win8:
  --Create a new virtual machine , and choose “Customize configuration before install”
  --At Overview tab—Hypervisor Details-- Firmware, choose: “UEFI x86_64:/usr/share/OVMF/OVMF_CODE.fd"
At last, install it according to the guide.

2. Inspect the Win8 image:
# virt-inspector -a /home/xchen/my-images/win8.1-uefi.qcow2
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda4</root>
    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows 8.1 Enterprise</product_name>
    <product_variant>Client</product_variant>
    <major_version>6</major_version>
    <minor_version>3</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>WIN-NKLFAJFC4EN</hostname>
    <format>installed</format>
    <mountpoints>
      <mountpoint dev="/dev/sda4">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda4">
        <type>ntfs</type>
        <uuid>468ADC538ADC40DB</uuid>
      </filesystem>
    </filesystems>
    <applications/>
  </operatingsystem>
</operatingsystems>


There should be lines like in win7 with MBR as following:
 <drive_mappings>
      <drive_mapping name="C">/dev/sda1</drive_mapping>
    </drive_mappings>


Actual results:
As above output.

Expected results:
There should be lines like in win7 with MBR as following:
 <drive_mappings>
      <drive_mapping name="C">/dev/sda1</drive_mapping>
    </drive_mappings>

Additional info:
Win7 also have this problem.

Comment 1 Richard W.M. Jones 2016-06-23 08:03:25 UTC
The drive mappings are stored in the Windows SYSTEM hive, so
can you grab the SYSTEM hive from the guest for me please.

You just need to do this command:

  guestfish --ro -a /home/xchen/my-images/win8.1-uefi.qcow2 -i \
    download 'win:\windows\system32\config\system' /tmp/system

and then attach the /tmp/system file to this bug (if it's too
big to attach you may have to compress it).

Comment 2 Xianghua Chen 2016-06-23 10:26:47 UTC
Created attachment 1171406 [details]
system

Comment 3 Richard W.M. Jones 2016-06-23 10:59:29 UTC
I think this one should be fixed by:

  commit 7cb28488a6b974c86a9dd0264d892cd01739c36e
  Author: Dawid Zamirski <*@*>
  Date:   Sat Feb 6 11:50:05 2016 -0500

    inspect: get windows drive letters for GPT disks.
    
    This patch updates the guestfs_inspect_get_drive_mappings API call to
    also return drive letters for GPT paritions. Previously this worked
    only for MBR partitions. This is achieved by matching the GPT partition
    GUID with the info stored in the blob from
    HKLM\SYSTEM\MountedDevices\DosDevices keys. For GPT partions this blob
    contains a "DMIO:ID:" prefix followed by a 16 byte binary GUID.

Comment 5 Xianghua Chen 2016-06-28 06:25:44 UTC
Verified with the packages:
libguestfs-1.32.5-6.el7.x86_64

Verify steps:
1. Prepare an Windows8.1 image with GPT disk:
First, prepare a Win8 iso.
Then, download and install OVMF ( The UEFI firmware for virtual machines).
Then,  use virt-manager to install Win8:
  --Create a new virtual machine , and choose “Customize configuration before install”
  --At Overview tab—Hypervisor Details-- Firmware, choose: “UEFI x86_64:/usr/share/OVMF/OVMF_CODE.fd"
At last, install it according to the guide.

2. Inspect the Win8 image:
# virt-inspector -a /home/xchen/my-images/win8.1-uefi.qcow2
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda4</root>
    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows 8.1 Enterprise</product_name>
    <product_variant>Client</product_variant>
    <major_version>6</major_version>
    <minor_version>3</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>xchen</hostname>
    <format>installed</format>
    <mountpoints>
      <mountpoint dev="/dev/sda4">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda4">
        <type>ntfs</type>
        <uuid>468ADC538ADC40DB</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name="C">/dev/sda4</drive_mapping>
    </drive_mappings>
    <applications/>
  </operatingsystem>
</operatingsystems>


There is drive_mapping info .

So verified.

Comment 7 errata-xmlrpc 2016-11-03 18:01:53 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


Note You need to log in before you can comment on or make changes to this bug.