Bug 1278371 - inspection returns arch="unknown" for Windows guest if file command is not installed
inspection returns arch="unknown" for Windows guest if file command is not in...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-05 06:03 EST by kwsk
Modified: 2015-11-06 08:21 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-06 08:21:24 EST
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)
config.log output.log (200.11 KB, application/zip)
2015-11-05 20:46 EST, kwsk
no flags Details

  None (edit)
Description kwsk 2015-11-05 06:03:56 EST
Description of problem:

virt-v2v failed to find virtio-win driver 1.31.24

libguestfs: trace: v2v: mkdir_p "/Windows/Drivers/VirtIO"
guestfsd: main_loop: proc 365 (hivex_node_set_value) took 0.00 seconds
guestfsd: main_loop: new request, len 0x44
libguestfs: trace: v2v: mkdir_p = 0
virt-v2v: warning: there are no virtio drivers available for this version
of Windows (6.1 unknown Server).  virt-v2v looks for drivers in
/usr/share/virtio-win

The guest will be configured to use slower emulated devices.

success in 1.28.1

libguestfs: trace: mkdir_p "/Windows/Drivers/VirtIO"
guestfsd: main_loop: new request, len 0x44
libguestfs: trace: mkdir_p = 0
virtio-win driver files matching this guest:
netkvm.cat [6,1,not-client,x86_64,cat] from /usr/share/virtio-win/./drivers/amd64/Win2008R2/netkvm.cat
netkvm.inf [6,1,not-client,x86_64,inf] from /usr/share/virtio-win/./drivers/amd64

virtio-win driver is located in /usr/share

echo $VIRTIO_WIN
/usr/share/virtio-win


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Richard W.M. Jones 2015-11-05 07:23:06 EST
(In reply to kwsk from comment #0)
> Description of problem:
> 
> virt-v2v failed to find virtio-win driver 1.31.24
> 
> libguestfs: trace: v2v: mkdir_p "/Windows/Drivers/VirtIO"
> guestfsd: main_loop: proc 365 (hivex_node_set_value) took 0.00 seconds
> guestfsd: main_loop: new request, len 0x44
> libguestfs: trace: v2v: mkdir_p = 0
> virt-v2v: warning: there are no virtio drivers available for this version
> of Windows (6.1 unknown Server).  virt-v2v looks for drivers in
                  ^^^^^^^
It seems to have failed to find the Windows architecture.  That
should say something like "i386" or "x86_64", not "unknown".

I wonder if recent changes to libguestfs broke that?
Comment 2 Richard W.M. Jones 2015-11-05 08:11:55 EST
Could you attach the full virt-v2v -v -x ... output to this bug.
Comment 3 Richard W.M. Jones 2015-11-05 08:34:17 EST
I was unable to reproduce this bug with 1.31.24.  So I need the
full -v -x output from the failing run.
Comment 4 kwsk 2015-11-05 20:09:25 EST
It was solved with libvirt-devel
Thank you for response
Comment 5 kwsk 2015-11-05 20:46 EST
Created attachment 1090436 [details]
config.log output.log
Comment 6 kwsk 2015-11-05 20:47:20 EST
It still failed to find driver
I uploaded config.log and output.log
Comment 7 kwsk 2015-11-05 21:46:46 EST
file-devel rpm was lacked
closed
Comment 8 Richard W.M. Jones 2015-11-06 06:48:55 EST
OK I reproduced this finally.  To reproduce:

(1) 'yum remove file' so the 'file' command/RPM is not installed

(2) compile libguestfs from source

(3) try to inspect a Windows guest, eg:

$ ./run virt-inspector /mnt/fastscratch/win2003.img | head
libguestfs: error: file: /WINDOWS/system32/cmd.exe: file: No such file or directory
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda1</root>
    <name>windows</name>
    <distro>windows</distro>
    <product_name>Microsoft Windows Server 2003</product_name>
    <major_version>5</major_version>
    <minor_version>2</minor_version>

There is an error message, but this should fail much harder.

Note that the error message does not appear in virt-v2v output,
although I'm not clear why.
Comment 9 Richard W.M. Jones 2015-11-06 08:21:24 EST
I pushed the following commit to make it fail hard in this case:

https://github.com/libguestfs/libguestfs/commit/7964e48b5e4c0d0cc2bcf2c2bc027c65fa855d62

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