Sometimes I just need the name of the OS that goes into the virtual machine configuration. Having the list of GuestID's is useful because you can choose one to deploy by using New-VM or by using the vCenter API.

To get the list, we will use VMware PowerCLI to access the vCenter API using Connect-CisServer. For more detail on this topic see Using the vCenter 6.5 API to Deploy Virtual Machines with PowerCLI.

Connect to API

Using PowerCLI we connect to vCenter and create a specification and save it into a runtime PowerShell variable. Later we can read in the details of the $createSpec variable.

Adjust the first two lines as needed to reflect your user and vCenter.

$credsVC = Get-Credential administrator@vsphere.local
Connect-CisServer vcsa01.lab.local -Credential $credsVC
$vmService = Get-CisService com.vmware.vcenter.VM
$createSpec = $vmService.Help.create.spec.CreateExample()

Get the list of IDs

Here we use the $CreateSpec variable we built in the last step. The following is the output from a vCenter Server 6.7.0 Build 8833179.

PS C:\> $createSpec.guest_OS -split ','
The valid values for this variable are:
 DOS
 WIN_31
 WIN_95
 WIN_98
 WIN_ME
 WIN_NT
 WIN_2000_PRO
 WIN_2000_SERV
 WIN_2000_ADV_SERV
 WIN_XP_HOME
 WIN_XP_PRO
 WIN_XP_PRO_64
 WIN_NET_WEB
 WIN_NET_STANDARD
 WIN_NET_ENTERPRISE
 WIN_NET_DATACENTER
 WIN_NET_BUSINESS
 WIN_NET_STANDARD_64
 WIN_NET_ENTERPRISE_64
 WIN_LONGHORN
 WIN_LONGHORN_64
 WIN_NET_DATACENTER_64
 WIN_VISTA
 WIN_VISTA_64
 WINDOWS_7
 WINDOWS_7_64
 WINDOWS_7_SERVER_64
 WINDOWS_8
 WINDOWS_8_64
 WINDOWS_8_SERVER_64
 WINDOWS_9
 WINDOWS_9_64
 WINDOWS_9_SERVER_64
 WINDOWS_HYPERV
 FREEBSD
 FREEBSD_64
 FREEBSD_11
 FREEBSD_12
 FREEBSD_11_64
 FREEBSD_12_64
 REDHAT
 RHEL_2
 RHEL_3
 RHEL_3_64
 RHEL_4
 RHEL_4_64
 RHEL_5
 RHEL_5_64
 RHEL_6
 RHEL_6_64
 RHEL_7
 RHEL_7_64
 RHEL_8_64
 CENTOS
 CENTOS_64
 CENTOS_6
 CENTOS_6_64
 CENTOS_7
 CENTOS_7_64
 CENTOS_8_64
 ORACLE_LINUX
 ORACLE_LINUX_64
 ORACLE_LINUX_6
 ORACLE_LINUX_6_64
 ORACLE_LINUX_7
 ORACLE_LINUX_7_64
 ORACLE_LINUX_8_64
 SUSE
 SUSE_64
 SLES
 SLES_64
 SLES_10
 SLES_10_64
 SLES_11
 SLES_11_64
 SLES_12
 SLES_12_64
 SLES_15_64
 NLD_9
 OES
 SJDS
 MANDRAKE
 MANDRIVA
 MANDRIVA_64
 TURBO_LINUX
 TURBO_LINUX_64
 UBUNTU
 UBUNTU_64
 DEBIAN_4
 DEBIAN_4_64
 DEBIAN_5
 DEBIAN_5_64
 DEBIAN_6
 DEBIAN_6_64
 DEBIAN_7
 DEBIAN_7_64
 DEBIAN_8
 DEBIAN_8_64
 DEBIAN_9
 DEBIAN_9_64
 DEBIAN_10
 DEBIAN_10_64
 ASIANUX_3
 ASIANUX_3_64
 ASIANUX_4
 ASIANUX_4_64
 ASIANUX_5_64
 ASIANUX_7_64
 ASIANUX_8_64
 OPENSUSE
 OPENSUSE_64
 FEDORA
 FEDORA_64
 COREOS_64
 VMWARE_PHOTON_64
 OTHER_24X_LINUX
 OTHER_24X_LINUX_64
 OTHER_26X_LINUX
 OTHER_26X_LINUX_64
 OTHER_3X_LINUX
 OTHER_3X_LINUX_64
 OTHER_4X_LINUX
 OTHER_4X_LINUX_64
 OTHER_LINUX
 GENERIC_LINUX
 OTHER_LINUX_64
 SOLARIS_6
 SOLARIS_7
 SOLARIS_8
 SOLARIS_9
 SOLARIS_10
 SOLARIS_10_64
 SOLARIS_11_64
 OS2
 ECOMSTATION
 ECOMSTATION_2
 NETWARE_4
 NETWARE_5
 NETWARE_6
 OPENSERVER_5
 OPENSERVER_6
 UNIXWARE_7
 DARWIN
 DARWIN_64
 DARWIN_10
 DARWIN_10_64
 DARWIN_11
 DARWIN_11_64
 DARWIN_12_64
 DARWIN_13_64
 DARWIN_14_64
 DARWIN_15_64
 DARWIN_16_64
 DARWIN_17_64
 DARWIN_18_64
 VMKERNEL
 VMKERNEL_5
 VMKERNEL_6
 VMKERNEL_65
 OTHER
 OTHER_64

Disconnect from API

 Disconnect-CisServer -Confirm:$false

For more detail about Supported Guest Operating Systems, see the VMware Guest OS Compatibility Guide

Summary

In this article we demonstrated how to retrieve the list of available guest operating systems you can deploy using VMware vCenter Server 6.7.