There might be times that you need to know if the ESXi host boot mode is set to UEFI or Legacy and obviously one option is to reboot the host and check the boot mode from BIOS. But it requires a downtime and sometimes it’s not an option in critical production environment.
Here is a simple command in both ESXi and Xen server that you can run to identify the boot mode without rebooting the server:
to check boot type of esx run this command from putty SSH:
vsish -e get /hardware/firmwareType
to check boot type of a xen host check for the EFI folder under /sys/firmware/
open up the xen host console and run the check the contents of /sys/firmware folder by running the below commands:
cd /sys/firmware/ ls
if it returns a folder labled EFI then it’s UEFI boot. Otherwise it’s Legacy.