[virt-tools-list] [libosinfo] Add Windows OS metadata

Richard W.M. Jones rjones at redhat.com
Fri Jun 17 10:18:34 UTC 2011


On Fri, Jun 17, 2011 at 10:38:43AM +0100, Daniel P. Berrange wrote:
> On Thu, Jun 16, 2011 at 08:14:00PM +0100, Richard W.M. Jones wrote:
> > On Thu, Jun 16, 2011 at 07:49:12PM +0300, Zeeshan Ali wrote:
> > > From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> > > +  <os id="http://microsoft.com/win2k8">
> > > +    <short-id>win2k8</short-id>
> > > +    <name>Microsoft Windows Server 2008</name>
> > > +    <version>6.0</version>
> > > +    <vendor>Microsoft</vendor>
> > > +    <upgrades id="http://microsoft.com/windows"/>
> > > +  </os>
> > > +
> > > +  <os id="http://microsoft.com/vista">
> > > +    <short-id>vista</short-id>
> > > +    <name>Microsoft Windows Vista</name>
> > > +    <version>6.0</version>
> > > +    <vendor>Microsoft</vendor>
> > > +    <upgrades id="http://microsoft.com/windows"/>
> > > +  </os>
> > 
> > You need to expose the product variant field somewhere, else there is
> > no way to distinguish between these two operating systems.  IIRC for
> > W2K8 this field contains "Server" and for Vista it contains "Client".
> > If you have an existing Windows guest, run virt-inspector on it to
> > display the product variant from the registry.
> > 
> > Product variants are also useful elsewhere.  In virt-inspector, we use
> > this field to distinguish different spins of RHEL (like Red Hat
> > Desktop vs. the regular Server spin).
> > 
> > http://libguestfs.org/virt-inspector.1.html#_operatingsystem_
> > http://libguestfs.org/guestfs.3.html#guestfs_inspect_get_product_variant
> 
> We could introduce a new OS relationship for this purpose. eg Have
> a general OS for 'vista', and then add further OS for the variants.
> I imagine each would have the same supported hardware, so hardware
> info could go into the generic 'vista' OS, but we could record the
> different install media paths in the variants
> 
>   <os id="http://microsoft.com/vista/client">
>     <short-id>vista-client</short-id>
>     <name>Microsoft Windows Vista Client Edition</name>
>     <version>6.0</version>
>     <vendor>Microsoft</vendor>
>     <variant id="http://microsoft.com/vista"/>
>     <media>
>       ...
>     </media>
>   </os>

A wider question: what is the purpose of these descriptions?

If it is so that someone can look at the Windows registry[1], and work
out what version of Windows they are dealing with, then you need both
the version (which you have) *and* the product variant string (which
you don't have), in order to do the mapping correctly.

You may even need the Service Pack number too -- it might be important
for some users.  Perhaps even make a distinction between uniprocessor
or multiprocessor variants.

This is all a big mess of course and brings you in contact with the
complexities of the Windows registry (and similar problems for other
OSes).  But my point is that version is not enough, even on RHEL.

Rich.

[1] 

# virt-win-reg --unsafe-printable-strings \
   Win7x32 \
  'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | less

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"BuildGUID"=str(1):"8e5f5753-3840-45f5-a5ee-b517d8f5830e"
"BuildLab"=str(1):"7600.win7_gdr.110408-1633"
"BuildLabEx"=str(1):"7600.16792.x86fre.win7_gdr.110408-1633"
"CSDBuildNumber"=str(1):"1"
"CurrentBuild"=str(1):"7600"
"CurrentBuildNumber"=str(1):"7600"
"CurrentType"=str(1):"Multiprocessor Free"
"CurrentVersion"=str(1):"6.1"                  # version
[...]
"EditionID"=str(1):"Enterprise"
"InstallDate"=dword:4c95d91b
"InstallationType"=str(1):"Client"             # product variant
"PathName"=str(1):"C:\Windows"
"ProductId"=str(1):"55041-049-9665135-86842"
"ProductName"=str(1):"Windows 7 Enterprise"
"RegisteredOrganization"=str(1):""
"RegisteredOwner"=str(1):"rjones"
"SoftwareType"=str(1):"System"
"SystemRoot"=str(1):"C:\Windows"

# virt-win-reg --unsafe-printable-strings \
   WinXP \
  'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | less

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"BuildLab"=str(1):"2600.xpsp.080413-2111"
"CSDVersion"=str(1):"Service Pack 3"             # service pack
"CurrentBuild"=str(1):"1.511.1 () (Obsolete data - do not use)"
"CurrentBuildNumber"=str(1):"2600"
"CurrentType"=str(1):"Uniprocessor Free"
"CurrentVersion"=str(1):"5.1"                    # version
[...]
"InstallDate"=dword:4d886f78
[...]
"PathName"=str(1):"C:\WINDOWS"
"ProductId"=str(1):"76487-339-7282986-22215"
"ProductName"=str(1):"Microsoft Windows XP"
"RegDone"=str(1):""
"RegisteredOrganization"=str(1):""
"RegisteredOwner"=str(1):"RJ"
"SoftwareType"=str(1):"SYSTEM"
"SourcePath"=str(1):"D:\I386"
"SubVersionNumber"=str(1):""
"SystemRoot"=str(1):"C:\WINDOWS"

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the virt-tools-list mailing list