Using virtualised systems and dev-ops processes means that most of the time it is easier to build something afresh using templates and tools than to make changes to an existing environment. But sometimes, you do need to make those changes. And if that change requires an alteration to the BIOS configuration, that can be challenging. The BIOS Setup prompt in a VMware environment is only available for a short time. Often, this isn’t long enough to reestablish the connection to the guest, which broke when the system rebooted. So how do you get to the BIOS setup reliably?
So there are a few things you can try:
Repeat ad nauseam
Keep rebooting the system and pressing that virtual
F2 key. Every once in a while you could achieve a successful BIOS Setup screen. This only seems to happen when a passing magnetic monopole triggers some quantum effect within the connection process. But normally the repeated key presses result in a lot of wasted time, so try one of the methods below, which work reliably for me.
Make changes to the guest’s configuration file
This way involves using the guest’s .vmx file (which hold configuration and startup parameters) to alter the behaviour of the guest when it boots. You can do this via the
vi editor over an SSH connection to the VMware server. Alternatively, use an SFTP (Secure FTP) program to edit the file in your favourite text editor and don’t forget to copy back to the VMware server when finished. (It sucks that ESXi doesn’t have the full screen
nano editor that was present in the ESX environment.)
<guest-name>.vmxfile. First, check for a
<guest-name>.vmx.lckfile, which indicates the guest is active. This file will get written back to the disk when VMware shutdown the guest if vCenter or APIs have made any changes. So you don’t want to make the changes, then reboot the guest, as they won’t take effect.
Force BIOS access on system startup
Add the line
bios.forceSetupOnce = "TRUE" to the
It will then trigger the guest to forcibly display the BIOS setup screen on the next boot, allowing you to make the changes you need. This line is automatically removed from the
<guest-name>.vmx file by VMware once the system boots.
Increase the BIOS delay
Add the line
bios.bootDelay = "5000" to the
Altering the BIOS delay allows the prompt to stay on the screen for longer, giving you time to make that repeated
F2 keypress work. In this case, the delay is specified in milliseconds, so the 5000 seen here represents 5 seconds. You might not want to set it that high, as it will delay each subsequent reboot of the guest by that amount of time. (You could always remove it after making the BIOS adjustments if this is an issue).
There are many more configuration lines that can be used in the
<guest-name>.vmx file. Some of these are documented on Ulli Hankeln’s Sanbarrow site. Have fun tweaking the file, but as always, the virtual breakage is your issue, test responsibly.