Home > vSphere API > Finding out Guest OS Running on a Virtual Machine

Finding out Guest OS Running on a Virtual Machine

March 18th, 2011 Leave a comment Go to comments



Time to learn how to "Google" and manage your VMware and clouds in a fast and secure


VMware ESX and ESXi (a.k.a. vSphere Hypervisor) support the most guest operating systems among all the hypervisors. From the vSphere API, you can determine what operating system is installed on a virtual machine.

The related managed object is the VirtualMachine and there are multiple ways to find out the guest OS information:

1.     config property (type: VirtualMachineConfigInfo). It has sub-properties like alternateGuestName, guestFullName, and guestId as xsd:string type.

2.     Guest property (type: GuestInfo). It has same sub-properties except the alternateGuestName.

3.     Summary.config property (type: VirtualMachineConfigSummary). It has the same sub-properties as #2.

Although duplicated, they are consistent in values. So you can pick any one of them. Note that #2 works only when VMware Tools is installed in the guest OS, which we always highly recommend.

The alternateGuestName is only useful when the guestId is other*.

The guestId is defined as string, but really the values are limited by an enumeration with limited set of values that depends on releases. The following table from vSphere API reference lists all the possible values in vSphere 4.1.  This is the most accurate and reliable way to determine the operating systems.

The guestFullName is mainly used for display purpose. Windows 7, for instance, has value like “Microsoft Windows 7 (32-bit)” if it’s 32 bits; Ubuntu, “Ubuntu Linux (32-bit)”; Redhat, “Red Hat Enterprise Linux 5 (32-bit)”.

asianux3_64Guest Asianux Server 3 (64 bit)Since vSphere API 4.0
asianux3Guest Asianux Server 3Since vSphere API 4.0
asianux4_64Guest Asianux Server 4 (64 bit)Since vSphere API 4.0
asianux4Guest Asianux Server 4Since vSphere API 4.0
centos64Guest CentOS 4/5 (64-bit)Since vSphere API 4.1
centosGuest CentOS 4/5Since vSphere API 4.1
darwin64Guest Mac OS 10.5 (64 bit)Since vSphere API 4.0
darwinGuest Mac OS 10.5
debian4_64Guest Debian GNU/Linux 4 (64 bit)Since vSphere API 4.0
debian4Guest Debian GNU/Linux 4Since vSphere API 4.0
debian5_64Guest Debian GNU/Linux 5 (64 bit)Since vSphere API 4.0
debian5Guest Debian GNU/Linux 5Since vSphere API 4.0
dosGuest MS-DOS.
eComStationGuest eComStationSince vSphere API 4.1
freebsd64Guest FreeBSD x64
freebsdGuest FreeBSD
mandriva64Guest Mandriva Linux (64 bit)Since vSphere API 4.0
mandrivaGuest Mandriva LinuxSince vSphere API 4.0
netware4Guest Novell NetWare 4
netware5Guest Novell NetWare 5.1
netware6Guest Novell NetWare 6.x
nld9Guest Novell Linux Desktop 9
oesGuest Open Enterprise Server
openServer5Guest SCO OpenServer 5Since vSphere API 4.0
openServer6Guest SCO OpenServer 6Since vSphere API 4.0
oracleLinux64Guest Oracle Linux 4/5 (64-bit)Since vSphere API 4.1
oracleLinuxGuest Oracle Linux 4/5Since vSphere API 4.1
os2Guest OS/2
other24xLinux64Guest Linux 2.4x Kernel (64 bit) (experimental)
other24xLinuxGuest Linux 2.4x Kernel
other26xLinux64Guest Linux 2.6x Kernel (64 bit) (experimental)
other26xLinuxGuest Linux 2.6x Kernel
otherGuest Other Operating System
otherGuest64 Other Operating System (64 bit) (experimental)
otherLinux64Guest Linux (64 bit) (experimental)
otherLinuxGuest Other Linux
redhatGuest Red Hat Linux 2.1
rhel2Guest Red Hat Enterprise Linux 2
rhel3_64Guest Red Hat Enterprise Linux 3 (64 bit)
rhel3Guest Red Hat Enterprise Linux 3
rhel4_64Guest Red Hat Enterprise Linux 4 (64 bit)
rhel4Guest Red Hat Enterprise Linux 4
rhel5_64Guest Red Hat Enterprise Linux 5 (64 bit) (experimental)Since VI API 2.5
rhel5Guest Red Hat Enterprise Linux 5Since VI API 2.5
rhel6_64Guest Red Hat Enterprise Linux 6 (64 bit)Since vSphere API 4.0
rhel6Guest Red Hat Enterprise Linux 6Since vSphere API 4.0
sjdsGuest Sun Java Desktop System
sles10_64Guest Suse Linux Enterprise Server 10 (64 bit) (experimental)Since VI API 2.5
sles10Guest Suse linux Enterprise Server 10Since VI API 2.5
sles11_64Guest Suse Linux Enterprise Server 11 (64 bit)Since vSphere API 4.0
sles11Guest Suse linux Enterprise Server 11Since vSphere API 4.0
sles64Guest Suse Linux Enterprise Server 9 (64 bit)
slesGuest Suse Linux Enterprise Server 9
solaris10_64Guest Solaris 10 (64 bit) (experimental)
solaris10Guest Solaris 10 (32 bit) (experimental)
solaris6Guest Solaris 6
solaris7Guest Solaris 7
solaris8Guest Solaris 8
solaris9Guest Solaris 9
suse64Guest Suse Linux (64 bit)
suseGuest Suse Linux
turboLinux64Guest Turbolinux (64 bit)Since vSphere API 4.0
turboLinuxGuest Turbolinux
ubuntu64Guest Ubuntu Linux (64 bit)
ubuntuGuest Ubuntu Linux
unixWare7Guest SCO UnixWare 7Since vSphere API 4.0
win2000AdvServGuest Windows 2000 Advanced Server
win2000ProGuest Windows 2000 Professional
win2000ServGuest Windows 2000 Server
win31Guest Windows 3.1
win95Guest Windows 95
win98Guest Windows 98
windows7_64Guest Windows 7 (64 bit)Since vSphere API 4.0
windows7Guest Windows 7Since vSphere API 4.0
windows7Server64Guest Windows Server 2008 R2 (64 bit)Since vSphere API 4.0
winLonghorn64Guest Windows Longhorn (64 bit) (experimental)Since VI API 2.5
winLonghornGuest Windows Longhorn (experimental)Since VI API 2.5
winMeGuest Windows Millenium Edition
winNetBusinessGuest Windows Small Business Server 2003
winNetDatacenter64Guest Windows Server 2003, Datacenter Edition (64 bit) (experimental)Since VI API 2.5
winNetDatacenterGuest Windows Server 2003, Datacenter EditionSince VI API 2.5
winNetEnterprise64Guest Windows Server 2003, Enterprise Edition (64 bit)
winNetEnterpriseGuest Windows Server 2003, Enterprise Edition
winNetStandard64Guest Windows Server 2003, Standard Edition (64 bit)
winNetStandardGuest Windows Server 2003, Standard Edition
winNetWebGuest Windows Server 2003, Web Edition
winNTGuest Windows NT 4
winVista64Guest Windows Vista (64 bit)
winVistaGuest Windows Vista
winXPHomeGuest Windows XP Home Edition
winXPPro64Guest Windows XP Professional Edition (64 bit)
winXPProGuest Windows XP Professional

Update: my colleague Christian Dickmann commented “@sjin2008 you should mention that the guest OS as reported by the #vSphere API is not authoritative and can be wrong.” Yes, there is slight possibility that you pick a OS while creating VM and install a different OS. Although possible, it’s not likely the case in real world projects.

  1. Christian DIckmann
    March 19th, 2011 at 23:40 | #1


    just to add to the question whether the information reported by vSphere is to be trusted: You are right, in traditional vSphere environment only human error would cause the OS info to be wrong, which is likely acceptable.

    But in a cloud/self-service environment the trust relationship gets redefined. You no longer have full trust in the guy deploying the VM, i.e. you have to assume he is not aware what he is doing or even malicious. So in a cloud environment, the guest OS info reported by vSphere is a hint, but shouldn’t be used for security policies or similar purposes.


  2. March 20th, 2011 at 02:47 | #2

    Thanks for information. The guest OS information stored in the guest (type: GuestInfo) should be trustable because it’s reported by VMware Tools installed in a guest OS. If you don’t have VMware Tools installed, you don’t have it however. In a cloud/self-service environment as you suggested, a user may hack the VMware Tools to report wrong OS information. So you are right, there is no absolute trust.

  3. Dietrich Rebmann
    September 17th, 2014 at 06:56 | #3


    on one of my VMs runs “Windows Server 2012 R2” but VirtualMachineConfigInfo#getGuestFullName() reports it as “Windows Server 2008 R2”.
    The VMWare Server itself displays the correct OS.
    I’m using “com.vmware:vijava:5.1”.
    Will this be fixed with vijava:5.5 or are there any plans to update the mentioned table?


  4. September 17th, 2014 at 10:40 | #4

    I don’t think it’s related to the API itself. Most likely the VM was selected to Win2008 when it’s first created.


  5. sundeep
    September 22nd, 2014 at 08:17 | #5

    Hi Steve,

    I have imported ovf using VSphere java API, but after deployment and at the state of power on the VM execute a script which is already a part of ovf and ask few user input.
    Can you please share any code if you have to respond those inputs.
    1.Do you like to provide static ip [y/n]:
    2.Please select a desired option [1/2/3/4] from the list:

    I tried powerCLI script to handle but no success.

    I need it very urgent.


  1. No trackbacks yet.