可以使用 Windows 中的磁盘管理系统实用工具创建、附加和分离虚拟硬盘(VHD)。 VHD 是磁盘映像文件格式,具有与物理硬盘驱动器类似的功能。 VHD 文件类型为 .vhd 或 .vhdx (建议)。 VHD 主要设计用于 Hyper-V 虚拟机。
VHD 的创建与初始化是同时进行的。 在“磁盘管理”视图中,VHD 类似于物理磁盘。 当 VHD 附加并可供使用时,磁盘图标的颜色为蓝色。 当 VHD 分离且不可用时,磁盘图标颜色为灰色。
Prerequisites
若要完成本文中的过程,必须满足以下先决条件:
The user account must be a member of the Backup Operators or Administrators group.
创建 VHD
要创建 VHD,请执行以下步骤:
From the Windows Start menu, search for and open Disk Management with Administrator permissions.
Expand the Action menu and select Create VHD.
在 “创建和附加虚拟硬盘 ”对话框中,指定要在其中存储 VHD 文件的物理计算机上的位置:
For the Location field, select Browse. Locate and select the folder to store the new VHD, and select OK.
Note
The location must be a fully qualified path that doesn't include the \Windows directory.
For the File name field, enter a name for the new VHD.
展开“另存为类型”下拉列表,然后选择“虚拟磁盘文件”(*.vhdx)。
Select Save.
对于 “虚拟硬盘大小 ”字段,请输入新 VHD 的文件大小。
Note
VHD 只能是最小大小为 3 MB(MB)的基本磁盘。 大型固定大小的 VHD 可能需要更多的时间才能创建。
对于 “虚拟硬盘类型 ”字段,请选择“ 动态扩展 ”或“ 固定大小”。
Select OK to finish.
附加 DVD
若要使 VHD 可供使用(你创建的磁盘或其他现有 VHD),请执行以下步骤:
From the Windows Start menu, search for and open Disk Management with Administrator permissions.
Expand the Action menu and select Attach VHD.
在“ 附加虚拟硬盘 ”对话框中,选择“ 浏览”。 Locate and select the .vhdx or .vhd file for the VHD, and select OK.
在“ 附加虚拟硬盘 ”对话框中,选择“ 确定 ”完成。
分离 DVD
分离 VHD 时,会使磁盘不可用。 不会删除 VHD 或磁盘上存储的任何数据。
请按照以下步骤分离 VHD:
From the Windows Start menu, search for and open Disk Management with Administrator permissions.
在磁盘列表中找到要附加的 VHD。
Right-click the VHD, select Detach VHD, and then select OK.