Suppose, not entirely hypothetically, that you have a VM running
on VMWare ESXi 6 that fails to boot due to some within-VM issue.
For instance, perhaps it is an Ubuntu Linux system with
unattended-upgrades
active, a modest sized /boot
partition, and
nothing has been done to stop the accumulation of Ubuntu kernel
images....
The obvious fix to this problem is:
Boot the affected system from a live CD
Tidy up the problem causing it not to boot (eg, remove some of the redundant Ubuntu kernel images with something like "
sudo apt-get --purge autoremove
", and reinstall the most recent one to ensure it is complete, including a completelyinitrd
)Reboot the system
(Optional, but desirable) do something to avoid the problem reoccuring :-)
Declare success
Unfortunately if the VM is running in VMWare ESXi 6 or similar the first step in this process is the most complicated, because common configuration results in the POST screen clearing too quickly (in 0ms in the case of at least some VMs I had to fix for a customer!), the VM's BIOS default is to boot the hard drive first if there is an OS install on it, and hitting the reset button the VM will detach the virtual CD :-( (Plus if the system is a Linux system that has panic'd due to not being able to find its root file system, it will ignore Ctrl-Alt-Del, forcing a reset or power cycle which then detaches the CD....)
The most direct work around for systems managed by VMWare vCenter is:
Download the live CD ISO image to somewhere accessible to either (a) the Windows vSphere client or (b) the ESXi host running the VM
On the VM go to Edit Settings -> Options -> Boot Options and tick "Force BIOS Setup" to force entry into the BIOS setup screen on the next boot.
Reset the affected VM (assumed to be okay, since it does not boot!)
Observe direct entry into the BIOS setup
Go to the Boot page in the PhoenixBIOS Setup Utility, and select the "Hard Drive" entry, and then use "-" to move it down the order to below the "CD-ROM" entry.
F10
to save the change, and exit.Attach the live CD ISO image as a Virtual CD (eg, right click on the "CD" icon in the vSphere Client Console, and attach it)
Use VM -> Guest -> Send Ctrl-Alt-Del to reboot the VM (which should work if you catch it while it is in the GRUB menu)
Observe VM booting from the virtual CD.
Fix issue, and reboot.
(Optional, but possibly not desirable) Change boot order back by forcing another entry into the BIOS.
Detach virtual CD, and if necessary (eg, too slow) reboot again
(There is similar workaround for VMWare ESXi and VMWare
Fusion,
but it involves manually editing the .vmx
files, and reimporting them.)