While attempting to power on a virtual machine, the operation fails immediately with an error indicating a firmware exception.
Symptoms:
The firmware encountered an unexpected exception. The virtual machine cannot boot./var/log/vmware/hostd.log, entries similar to the following are observed:YYYY-MM-DDTHH:MM:SSZ Db (167) Hostd[20###40]: [Originator@6876 sub=Vmsvc. vm:/vmfs/volumes/<datastore>/VM/VM.vmx] Handling vmx message 56####34: The firmware encountered an unexpected exception. The virtual machine cannot boot.To resolve this issue, the virtual machine configuration must be manually re-initialized by toggling firmware-related flags.
Enable SSH on the ESXi host where the VM is registered and log in as root.
Navigate to the virtual machine's directory:
cd /vmfs/volumes/<DATASTORE_NAME>/<VM_NAME>/Create a backup of the .vmx configuration file:
cp <VM_NAME>.vmx <VM_NAME>.vmx.backupEdit the .vmx file using vi:
vi <VM_NAME>.vmxLocate and comment out the following lines by adding a # at the beginning of the line:
#vhv.enable = "TRUE"
#uefi.secureBoot.enabled = "TRUE"
#vvtd.enable = "TRUE"Save and exit the file (:wq!).
Identify the VM ID (Vmid) for the affected virtual machine:
vim-cmd vmsvc/getallvms | grep -i <VM_NAME>Reload the virtual machine configuration:
vim-cmd vmsvc/reload <Vmid>Attempt to power on the VM.
Once the VM has attempted to boot, power it off.
Re-edit the .vmx file to remove the comment characters (#) added in Step 5, then save the file.
Reload the VM configuration again:
vim-cmd vmsvc/reload <Vmid>Power on the virtual machine.
Note: If the issue originated from a failed guest OS update, it is recommended to engage the OS vendor (e.g., Microsoft) to investigate the update failure.