Change VM Hardware Version

changing vm hardware version in cli

3 September 2017   2 min read

The VM hardware version designates the virtual hardware functions supported by a virtual machine, which relates to the hardware on the host server. A VMware product will not be able to power on a VM with a hardware version higher than what it supports.

Having the wrong hardware version for your hypervisor can lead to issues moving VMs between differing versions of ESX and/or Fusion and restrict the ability to edit the specific VMs settings within the Vsphere HW client. VMware have published a full vmware hardware version compatible matrix of ESXi hosts and compatible virtual machine hardware versions.

To get round this you need to change the hardware version within the VMs .vmx file. In ESX this is stored within the VMs folder in the datastore (/vmfs/volumes/ds2/vm_name/). In fusion hold alt and right-click on the VM, will have an option Open Config File in Editor.

1. Before editing the hardware version you should unregister the VM (by referencing its vmid) and create a copy of the current vmx file in case you screw it up. Alternatively from the GUI right click and choose unregister.

vim-cmd vmsvc/getallvms                                                  List all the registered VMs to get VMID
vim-cmd vmsvc/unregister vmid
cp /vmfs/volumes/ds2/vm_name/vm_name.vmx /vmfs/volumes/ds2/vm_name/vm_name-copy.vmx

2. Use vi to edit the hardware version number within the .vmx file. For example virtualHW.version = “13” is ESX 6.5 and virtualHW.version = “10” ESX 5.5. You can always check what version existing machines are if unsure.
To do this in Fusion hold alt, right-click on the VM and choose Open Config File in Editor

vi /vmfs/volumes/ds2/vm_name/vm_name.vmx

3. Re-register the VM by referencing the VMs .vmx file.

vim-cmd solo/registervm /vmfs/volumes/ds2/vm_name/vm_name.vmx

4. Obtain the Inventory ID (VMID) for the virtual machine and start it

vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.on vmid
vim-cmd vmsvc/reload vmid             If need to restart a vm

del /vmfs/volumes/ds2/vm_name/vm_name-copy.vmx Delete the backup if VM worked as planned

If the Guest operating system template is wrong this can also be changed within the .vmx file. For example ESX 6.5 uses centos 64bit whereas in 5.5 it uses other 32bit. Edit the guestOS dictionary in the .vmx file.

guestOS = other                                                        Centos64 bit guest OS on ESX5.5
guestOS = centos-64 Centos64 bit guest OS on ESX6.5