Stale screenshot in Azure VM Boot Diagnostics

If you notice the Boot Diagnostics screenshot for your Azure VM is stale in the Azure portal, first make sure the virtual display timeout is disabled in the guest operating system.

For example, for a Windows VM you may see the time shown on the logon screen is stale.

For Windows, run the following command from elevated CMD:

powercfg /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 0

For Linux, run the following command:

xset s off

For Windows VMs, the Azure provisioning agent is different than the VM agent, and it is the provisioning agent that runs the above command during provisioning for VMs created from a generalized image. You can see the evidence of that if you search for powercfg in C:\Windows\Panther\WaSetup.xml, which is the provisioning agent log. But since the provisioning agent does not need to run for VMs created from a specialized VHD, that is a scenario where you would need to run the powercfg command manually to disable the virtual display timeout. Also, it is possible to have a particularly old Azure VM created from generalized image that may not have it set because it was created before the provisioning agent was updated to disable the virtual display timeout.