Virtual Machine fails to power on with error The firmware encountered an unexpected exception
search cancel

Virtual Machine fails to power on with error The firmware encountered an unexpected exception

book

Article ID: 439298

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

While attempting to power on a virtual machine, the operation fails immediately with an error indicating a firmware exception.

Symptoms:

  • Error message: The firmware encountered an unexpected exception. The virtual machine cannot boot.
  • In /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.

Environment

  • VMware vSphere ESXi 8.X

Cause

  • A corruption or inconsistent state in the virtual machine's firmware (NVRAM) initialization, typically precipitated by a failed guest OS update (e.g., Windows Update). This leaves UEFI Secure Boot or virtualization hardware features in an invalid state within the VMX process.

Resolution

To resolve this issue, the virtual machine configuration must be manually re-initialized by toggling firmware-related flags.

  1. Enable SSH on the ESXi host where the VM is registered and log in as root.

  2. Navigate to the virtual machine's directory:

    • cd /vmfs/volumes/<DATASTORE_NAME>/<VM_NAME>/
  3. Create a backup of the .vmx configuration file: 

    • cp <VM_NAME>.vmx <VM_NAME>.vmx.backup
  4. Edit the .vmx file using vi

    • vi <VM_NAME>.vmx
  5. Locate 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"
  6. Save and exit the file (:wq!).

  7. Identify the VM ID (Vmid) for the affected virtual machine:

    • vim-cmd vmsvc/getallvms | grep -i <VM_NAME>
  8. Reload the virtual machine configuration: 

    • vim-cmd vmsvc/reload <Vmid>
  9. Attempt to power on the VM.

  10. Once the VM has attempted to boot, power it off.

  11. Re-edit the .vmx file to remove the comment characters (#) added in Step 5, then save the file.

  12. Reload the VM configuration again: 

    • vim-cmd vmsvc/reload <Vmid>
  13. 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.