管理虛擬硬碟 (VHD)Manage Virtual Hard Disks (VHD)

適用於:Windows 10、Windows 8.1、Windows Server (半年度管道)、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012Applies To: Windows 10, Windows 8.1, Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

本主題說明如何使用 [磁碟管理] 建立、連結和中斷連結虛擬硬碟。This topic describes how to create, attach, and detach virtual hard disks with Disk Management. 虛擬硬碟 (VHD) 是虛擬化硬碟檔案,一經掛接,就差不多和實際硬碟一模一樣地顯示和運作。Virtual hard disks (VHDs) are virtualized hard disk files that, once mounted, appear and operate pretty much identically to a physical hard drive. 它們最常與 Hyper-V 虛擬機器搭配使用。They're most commonly used with Hyper-V virtual machines.

在磁碟管理中檢視 VHDViewing VHDs in Disk Management

VHD 就像實體磁碟一樣顯示在 [磁碟管理] 中。VHDs appear just like physical disks in Disk Management. VHD 連結後 (也就是,提供給系統使用),會顯示藍色。When a VHD has been attached (that is, made available to the system for use), it appears blue. 如果磁碟中斷連結 (也就是,變得無法使用),其圖示會回復為灰色。If the disk is detached (that is, made unavailable), its icon reverts to gray.

建立 VHDCreating a VHD

注意

您必須至少是備份操作員系統管理員群組的成員,才能完成這些步驟。You must be a member of the Backup Operators or Administrators group, at minimum, to complete these steps.

若要建立 VHDTo create a VHD

  1. [動作] 功能表上,選取 [建立 VHD]On the Action menu, select Create VHD.

  2. [建立和連結虛擬硬碟] 對話方塊中,同時指定您想要在實體電腦上儲存 VHD 檔案的位置,以及 VHD 的大小。In the Create and Attach Virtual Hard Disk dialog box, specify both the location on the physical computer where you want the VHD file to be stored, and the size of the VHD.

  3. [虛擬硬碟格式] 中,選取 [動態擴充][固定大小],然後按一下 [確定]In Virtual hard disk format, select Dynamically expanding or Fixed size, and then click OK.

連結和中斷連結 VHDAttaching and detaching a VHD

若要讓 VHD 可供使用 (無論是剛建立的還是其他現有的 VHD):To make a VHD available for use (either one you have just created or another existing VHD):

  1. [動作] 功能表上,選取 [連結 VHD]On the Action menu, select Attach VHD.

  2. 使用完整路徑指定 VHD 的位置。Specify the location of the VHD, using a fully-qualified path.

若要中斷連結 VHD,使其無法供使用:以滑鼠右鍵按一下磁碟,選取 [中斷連結 VHD],然後按一下 [確定]To detach the VHD, making it unavailable: Right-click the disk, select Detach VHD, and then click OK. 中斷連結 VHD 不會刪除 VHD 或其中儲存的任何資料。Detaching a VHD does not delete the VHD or any data stored in it.

其他考量Additional considerations

  • 指定 VHD 位置的路徑必須是完整路徑,而且不可在 \Windows 目錄中。The path specifying the location for the VHD must be fully-qualified and cannot be in the \Windows directory.
  • VHD 的大小下限是 3 MB。The minimum size for a VHD is 3 megabytes (MB).
  • VHD 只能是基本磁碟。A VHD can only be a basic disk.
  • 由於 VHD 是在建立時初始化,建立大型固定大小的 VHD 可能需要一些時間。Because a VHD is initialized when it is created, creating a large fixed-size VHD might take some time.