This article provides steps to change the boot device without using the virtual machine's BIOS and its limitation to 8 visible devices.
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.7
VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 8.0.x
Shut down the virtual machine.
Click the virtual machine in the Inventory.
Right click Edit Settings.
In the Virtual Machine Properties dialog, click the VM Options tab.
Under Boot Options, select the check box for Force BIOS setup.
Click OK to save the changes.
Power on the virtual machine
Open a VM console and navigate to the BIOS > Boot section
Select the correct boot order selection and save
The boot device can be selected using the virtual machine advanced options bios.bootOrder and bios.hddOrder. These settings will override the previous boot order selection.
The virtual machine's boot order can be set to any virtual NIC ethernetX, where X is the number of the device. For example, ethernet0 or ethernet5. It can also be set to hdd, cdrom, or floppy. If set to cdrom or floppy there are multiple devices, the virtual machine tries them sequentially until it finds one to boot from. If bios.bootOrder is set to hdd, also need to define bios.hddOrder and set a device (for example, scsi0:3 or ide1:0) to boot from.
To make this change, ensure that the virtual machine is currently in powered off state, then:
Right-click the VM in vSphere Client.
Select Edit Settings.
In the VM Options tab, select Advanced.
Next to Configuration Parameters, click on EDIT CONFIGURATION.
Select [ADD CONFIGURATION PARAMS] to create the new VM advanced parameters:
Name | Value |
bios.bootOrder
|
ethernet5,ethernet2,hdd,cdrom,floppy
|
bios.hddOrder
|
scsi2:2,scsi0:1,ide1:0
|
Click [OK], then [OK] again to save the change and exit the VM settings wizard.
To configure the list of devices by editing the VMX configuration file. Ensure that the VM is currently powered off for this. When adding the settings in the VMX file, make sure to put the device list(s) into quotation marks and separate the devices with commas.
For example:
bios.bootOrder = "ethernet5,ethernet2,hdd,cdrom,floppy"
bios.hddOrder = "scsi2:2,scsi0:1,ide1:0"
In this example, the virtual machine tries to boot with ethernet5. If there is nothing to boot from, try ethernet2. If that fails, try from the disks (hdd) defined in hddOrder, then all CD-ROMs, and finally from all floppies.
Note: Adding these advanced options will block changing the boot order in the BIOS setup, and to be able to use the BIOS to make boot order changes, remove both options while the VM is in powered off state. The next time the VM is powered on, it will use the boot order which was originally configured in the BIOS setup.
$strVMName = "vm-name"
$strBootNICDeviceName = "Network adapter 1"
$strBootHDiskDeviceName = "Hard disk 1"
$viewVM = Get-View -ViewType VirtualMachine -Property Name, Config.Hardware.Device -Filter @{"Name" = "^$strVMName$"}
$intNICDeviceKey = ($viewVM.Config.Hardware.Device | ?{$_.DeviceInfo.Label -eq $strBootNICDeviceName}).Key
$oBootableNIC = New-Object -TypeName VMware.Vim.VirtualMachineBootOptionsBootableEthernetDevice -Property @{"DeviceKey" = $intNICDeviceKey}
$intHDiskDeviceKey = ($viewVM.Config.Hardware.Device | ?{$_.DeviceInfo.Label -eq $strBootHDiskDeviceName}).Key
$oBootableHDisk = New-Object -TypeName VMware.Vim.VirtualMachineBootOptionsBootableDiskDevice -Property @{"DeviceKey" = $intHDiskDeviceKey}
$oBootableCDRom = New-Object -Type VMware.Vim.VirtualMachineBootOptionsBootableCdromDevice
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec -Property @{
"BootOptions" = New-Object VMware.Vim.VirtualMachineBootOptions -Property @{
BootOrder = $oBootableNIC, $oBootableCDRom, $oBootableHDisk
}
}
$viewVM.ReconfigVM_Task($spec)
$vm = Get-VM vm-name; $vm.ExtensionData.Config.BootOptions | Select BootOrder
Expected Outcome:BootOrder
---------
{4000, VMware.Vim.VirtualMachineBootOptionsBootableCdromDevice, 2000}
bios.bootOrder
and bios.hddOrder
to its .vmx file. As a result, no modifications to the boot order in the BIOS or EFI setup interface will be allowed.bios.bootOrder
and bios.hddOrder
if they exist.