UEFI booting of ESXi fails and does not progress beyond "VMware Hypervisor Recovery"
search cancel

UEFI booting of ESXi fails and does not progress beyond "VMware Hypervisor Recovery"

book

Article ID: 324877

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides a method to manually install a UEFI boot loader from an ESXi ISO installer image to recover the system.

Symptoms:
When booting in UEFI mode following an ESXi upgrade or install, the system hangs at the boot loader prompt showing the "VMware Hypervisor Recovery" message on the console.

Environment

VMware vSphere ESXi 7.0.0
VMware vSphere ESXi 7.0.x

Cause

ESXi comes with boot loader changes that might be incompatible with some system firmware. In ESXi 7.0u2, the method used to load EFI files was identified to not be supported on affected systems.

Resolution

This is a known issue affecting VMware ESXi 7.0u2. 
VMware is aware of this issue and is working to resolve it in a future release.

Workaround:
To work around this issue, copy the bootloader files from an ESXi 7.0u1 ISO image to the boot device of the affected system by following the instructions below:
  1. Boot the system using the ESXi 7.0u1 installer ISO image.
  2. At the installer dialog, enter the ESXi command-line shell:
    1. Press Alt-F1.
    2. Log in as root (no password).
    3. (Optional) Start the SSH daemon so you can login remotely by issuing the following command:
/etc/init.d/SSH start
  1. In the ESXi shell, issue the following commands:
#
# 1. Identify the boot partition, which is the first partition on the boot disk.

# The name of the boot disk varies from system to system, but it is the one that includes a boot partition (systemPartition) and 2 bootbanks (linuxNative).
#
$ ls /dev/disks
mpx.vmhba32:C0:T0:L0
mpx.vmhba32:C0:T0:L0:1 # <--- boot partition
mpx.vmhba32:C0:T0:L0:5
mpx.vmhba32:C0:T0:L0:6
mpx.vmhba32:C0:T0:L0:7

 
$ partedUtil getptbl /dev/disks/mpx.vmhba32:C0:T0:L0
gpt
1947 255 63 31293440
1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128 # <--- systemPartition is boot
5 208896 2306047 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 2308096 4405247 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 4407296 31293406 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0


 #
# 2. Prepare FAT copy symlink to mtools (in case they are not there yet).

# Ignore warnings about symlinks that already exist.
#
 # Verify if you have mtools or mcopy:
$ ls -l /bin/mcopy /bin/mtools
lrwxrwxrwx 1 root root 11 Jan 10 12:22 /bin/mcopy -> /bin/mtools
-r-xr-xr-x 1 root root 230840 Jan 10 12:22 /bin/mtools

 
# For a version with only mcopy available, e.g. ESXi 6.x:
$ ln -s /bin/mcopy /bin/mdir
 
# For a version with mtools available, e.g. ESXi 7.x:
$ ln -s /bin/mtools /bin/mcopy
$ ln -s /bin/mtools /bin/mdir


#
# 3. Check the contents of the boot partition to make sure files are where they are expected to be.
#
$ mdir -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 EFI/BOOT
 Volume in drive : has no label
 Volume Serial Number is 5083-2758
Directory for ::/EFI/BOOT
 
. <DIR> 2020-04-03 4:59
.. <DIR> 2020-04-03 4:59
BOOTX64 EFI 98896 2020-12-22 5:18 BOOTx64.EFI
        3 files 98 896 bytes
                        104 073 216 bytes free
 
$ mdir -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 EFI/VMware
 Volume in drive : has no label
 Volume Serial Number is 5083-2758
Directory for ::/EFI/VMware
 
. <DIR> 2020-04-03 4:59
.. <DIR> 2020-04-03 4:59
mboot64 efi 167360 2020-12-22 5:18
SAFEBO~1 EFI 98896 2020-12-22 5:18 safeboot64.efi
        4 files 266 256 bytes
                        104 073 216 bytes free


#
# 4. Backup boot files.
#
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 ::EFI/BOOT/BOOTx64.EFI ::EFI/BOOT/BOOTx64-orig.EFI
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 ::/EFI/VMware/mboot64.efi ::/EFI/VMware/mboot64-orig.efi
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 ::/EFI/VMware/safeboot64.efi ::/EFI/VMware/safeboot64-orig.efi

 
#
# 5. Copy the booted version's boot loader to the boot disk.
#
$ cd /usr/lib/vmware/bootloader-installer
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 safeboot64.efi ::EFI/BOOT/BOOTx64.EFI
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 safeboot64.efi ::/EFI/VMware/safeboot64.efi
$ mcopy -i /dev/disks/mpx.vmhba32:C0:T0:L0:1 mboot64.efi ::/EFI/VMware/mboot64.efi


#
# 6. Reboot the system to boot from the disk.