Windows 启动管理器错误 - 0xC0000428 状态无效的映像哈希Windows boot manager error - 0xC0000428 Status Invalid Image Hash

本文提供了用于解决以下问题的步骤:使用预览版映像且试用期已过期,这会阻止启动 Azure 虚拟机 (VM)。This article provides steps to resolve issues where a preview image was used and the trial period has expired, which prevents the booting of an Azure Virtual Machine (VM).

症状Symptom

使用启动诊断查看 VM 的屏幕截图时,你将看到屏幕截图显示 Windows 引导管理器,并显示以下消息:When you use Boot diagnostics to view the screenshot of the VM, you will see that the screenshot displays the Windows Boot Manager with the message:

File: \windows\system32\boot\winload.exe

Status: 0xc0000428

Info: Windows cannot verify the digital signature for this file.

图 1 显示状态为“Ox0000428”的 Windows 引导管理器,以及信息“Windows 无法验证此文件的数字签名”。

或消息:or the message:

File: \Windows\system32\winload.exe

Status: 0xc0000428

Info: The digital signature for this file couldn't be verified.

图 2 显示状态为“Ox0000428”的 Windows 引导管理器,以及信息“无法验证此文件的数字签名”。

原因Cause

用于生成 VM 的映像是具有到期日期的预览版映像,而不是 RTM(发布到制造)映像。The image that was used to build the VM was a preview image with an expiration date rather than an RTM (Release to Manufacturing) image.

预览版映像具有指定的生命周期,并且在超过其到期日期(即此映像的试用期已结束)时,就会显示你看到的屏幕截图。Preview images have a designated lifecycle and the screenshot you see is displayed when you pass the expiration date, meaning the trial of the image is over.

预览版映像示例Example of preview images

a699494373c04fc0bc8f2bb1389d6106__Windows-Server-Technical-Preview-201505.01-en.us-127GB.vhd

无法延长预览映像的到期日期。You are not able to extend the expiration date of a preview image. 预览到期后,VM 无法再启动。Once the preview has expired, the VM will no longer be able to boot.

  • 试用期因产品而异。Depending on the product, the trial period may vary. 例如,Windows 预览版映像的试用期为 180 天。For example, Windows preview images have a 180-day trial period.

  • 在 Azure 中,所有 Windows 预览版映像都将在其说明中包含注释,该注释表示这些映像不用于生产,只能在指定的试用期内使用或作为“预览版”使用。In Azure, all images for Windows that are preview versions will include a note in their description that they are not intended for production and that they are available for use only for a specified trial period or as a "preview release".

解决方案Solution

如果你的映像是预览版映像,则无法延长所使用的映像的有效期,你需要使用非预览版映像部署新的 VMIf your image is a preview image, there is no way to extend the expiration date for the image used, you will need to deploy a new VM using a non-preview image. 以下步骤将帮助你确定是否使用了预览版映像,并提供资源来帮助你将数据从相应 VM 传输到新的 VM。The steps below will assist you in identifying if you have used a preview image, as well as provide resources to assist you in transferring data from this VM into a new VM. 如果确实已将映像标识为预览版映像,则该映像将不可恢复,因为它现在已过期。If you have positively identified the image as a preview image, the image isn't recoverable, as it is now expired.

根据你的喜好,你可以使用 Azure PowerShell 或 Azure CLI 查询映像,以确定它是否为预览版映像。Depending upon your preference, you can use either Azure PowerShell or Azure CLI to query your image to determine if it is a preview image. 可以使用这些命令来确认映像为预览版映像。You can use these commands to confirm that the image is a preview image.

使用 Azure PowerShell 进行查询Query using Azure PowerShell

  1. 打开 Windows PowerShell 应用程序。Open the Windows PowerShell application.

  2. 运行以下命令:Run the following commands:

    $locName = "<LOCATION>" 
    $pubName = "<PUBLISHER NAME>" 
    $offerName = "<OFFER NAME>" 
    $skuName= "<YEAR WHEN THIS IMAGE WAS RELEASED>"
    Get-AzVMImagePublisher -Location $locName | Select $pubName
    Get-AzVMImageOffer -Location $locName -PublisherName $pubName | Select Offer
    Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | Select Skus
    Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Skus $skuName | Select Version
    
  • 在前面的命令中,将 <LOCATION><PUBLISHER NAME><OFFER NAME><YEAR WHEN THIS IMAGE WAS RELEASED> 替换为所述的信息。In the previous commands, replace <LOCATION>, <PUBLISHER NAME>, <OFFER NAME>, and <YEAR WHEN THIS IMAGE WAS RELEASED> with the information stated. 同时删除“<”和“>”符号。Also remove the "<" and ">" symbols.

    请参阅以下示例:See the following example:

    $locName = "China North" 
    $pubName = "MicrosoftWindowsServer" 
    $offerName = "WindowsServer" 
    $skuName= "2016-Datacenter"
    Get-AzVMImagePublisher -Location $locName | Select $pubName
    Get-AzVMImageOffer -Location $locName -PublisherName $pubName | Select Offer
    Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | Select Skus
    Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Skus $skuName | Select Version
    

使用 Azure CLI 进行查询Query using the Azure CLI

  1. 如果尚未安装,则需要安装 Azure CLIIf you haven't already, you will need to install the Azure CLI.

  2. 下载后,使用命令提示符或 PowerShell 输入 az login 命令,然后使用你的帐户凭据登录。Once downloaded, use either Command Prompt or PowerShell to enter the az login command and then sign in with your account credentials.

  3. 登录后,请输入以下命令:Once logged in, enter the following commands:

    az vm image list-publishers --location "<LOCATION>"
    az vm image list-offers --location "China North" --publisher "<PUBLISHER NAME>"
    az vm image list-skus --location "China North" --publisher "<PUBLISHER NAME>" --offer "<OFFER NAME>"
    az vm image list  --location "China North" --publisher "<PUBLISHER NAME>" --offer "<OFFER NAME>" --sku "<YEAR WHEN THIS IMAGE WAS RELEASED>"
    
  • 在前面的命令中,将 <LOCATION><PUBLISHER NAME><OFFER NAME><YEAR WHEN THIS IMAGE WAS RELEASED> 替换为所述的信息。In the previous commands, replace <LOCATION>, <PUBLISHER NAME>, <OFFER NAME>, and <YEAR WHEN THIS IMAGE WAS RELEASED> with the information stated. 同时删除“<”和“>”符号。Also remove the "<" and ">" symbols.

    请参阅以下示例:See the following example:

    az vm image list-publishers --location "China North"
    az vm image list-offers --location "China North" --publisher "MicrosoftWindowsServer"
    az vm image list-skus --location "China North" --publisher "MicrosoftWindowsServer" --offer "WindowsServer"
    az vm image list  --location "China North" --publisher "MicrosoftWindowsServer" --offer "WindowsServer" --sku "2016-Datacenter"