从 Azure 下载 Windows VHDDownload a Windows VHD from Azure

本文介绍如何使用 Azure 门户从 Azure 下载 Windows 虚拟硬盘 (VHD) 文件。In this article, you learn how to download a Windows virtual hard disk (VHD) file from Azure using the Azure portal.

可选:通用化 VMOptional: Generalize the VM

如果要使用 VHD 作为映像来创建其他 VM,则应使用 Sysprep 来通用化操作系统。If you want to use the VHD as an image to create other VMs, you should use Sysprep to generalize the operating system.

若要使用 VHD 作为映像创建其他 VM,请通用化该 VM。To use the VHD as an image to create other VMs, generalize the VM.

  1. 登录到 Azure 门户(如果未登录)。If you haven't already done so, sign in to the Azure portal.
  2. 连接到 VMConnect to the VM.
  3. 在 VM 上,以管理员身份打开“命令提示符”窗口。On the VM, open the Command Prompt window as an administrator.
  4. 将目录切换到 %windir%\system32\sysprep,然后运行 sysprep.exe。Change the directory to %windir%\system32\sysprep and run sysprep.exe.
  5. 在“系统准备工具”对话框中,选择“进入系统全新体验(OOBE)”,确保已选中“通用化”。 In the System Preparation Tool dialog box, select Enter System Out-of-Box Experience (OOBE), and make sure that Generalize is selected.
  6. 在“关闭选项”中选择“关闭” ,然后单击“确定” 。In Shutdown Options, select Shutdown, and then click OK.

停止 VMStop the VM

如果 VHD 附加到正在运行的 VM,则不能从 Azure 下载。A VHD can't be downloaded from Azure if it's attached to a running VM. 需要停止 VM,才能下载 VHD。You need to stop the VM to download a VHD.

  1. 在 Azure 门户的“中心”菜单上,单击“虚拟机” 。On the Hub menu in the Azure portal, click Virtual Machines.
  2. 从列表中选择 VM。Select the VM from the list.
  3. 在 VM 的边栏选项卡上,单击“停止” 。On the blade for the VM, click Stop.

生成下载 URLGenerate download URL

若要下载 VHD 文件,需要生成共享访问签名 (SAS) URL。To download the VHD file, you need to generate a shared access signature (SAS) URL. 生成 URL 时,将为 URL 分配到期时间。When the URL is generated, an expiration time is assigned to the URL.

  1. 在 VM 的页面上,单击左侧菜单中的“磁盘” 。On the page for the VM, click Disks in the left menu.
  2. 选择 VM 的操作系统磁盘。Select the operating system disk for the VM.
  3. 在磁盘的页面上,从左侧菜单中选择“磁盘导出” 。On the page for the disk, select Disk Export from the left menu.
  4. URL 默认的过期时间为 3600 秒。The default expiration time of the URL is 3600 seconds. 对于 Windows OS 磁盘,将此提高为 36000 秒。Increase this to 36000 for Windows OS disks.
  5. 单击“生成 URL”。 Click Generate URL.

Note

从默认值增加到期时间,以便提供足够时间来下载 Windows Server 操作系统的大型 VHD 文件。The expiration time is increased from the default to provide enough time to download the large VHD file for a Windows Server operating system. 可能需要包含 Windows Server 操作系统的 VHD 文件,以便根据连接花几个小时下载。You can expect a VHD file that contains the Windows Server operating system to take several hours to download depending on your connection. 如果下载的是数据磁盘的 VHD,则默认时间就足够了。If you are downloading a VHD for a data disk, the default time is sufficient.

下载 VHDDownload VHD

  1. 在生成的 URL 下,单击“下载 VHD 文件”。Under the URL that was generated, click Download the VHD file.
  2. 可能需要单击浏览器中的“保存” 以开始下载。You may need to click Save in your browser to start the download. VHD 文件的默认名称为 abcdThe default name for the VHD file is abcd.

后续步骤Next steps