Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1349237 - virt-inspector can not get windows drive letters for GPT disks
virt-inspector can not get windows drive letters for GPT disks
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs (Show other bugs)
7.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-22 23:19 EDT by Xianghua Chen
Modified: 2016-11-03 14:01 EDT (History)
3 users (show)

See Also:
Fixed In Version: libguestfs-1.32.5-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:01:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 08:06:51 EDT

  None (edit)
Description Xianghua Chen 2016-06-22 23:19:55 EDT
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 04:03:25 EDT
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 06:26 EDT
Created attachment 1171406 [details]
system
Comment 3 Richard W.M. Jones 2016-06-23 06:59:29 EDT
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 02:25:44 EDT
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 14:01:53 EDT
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.