大网数据广告活动
磁盘与文件系统

Manage Virtual Hard Disks (VHD)

· 52CE 我爱测

Manage virtual hard disks (VHDs) with the Disk Management utility in Windows, where you can view, create, attach, and detach a VHD.

You can create, attach, and detach virtual hard disks (VHDs) with the Disk Management system utility in Windows. VHDs are disk image file formats that have similar functionalities to a physical hard drive. The VHD file type is .vhd or .vhdx (recommended). VHDs are designed primarily for use with Hyper-V virtual machines.

A VHD is created and initialized at the same time. In the Disk Management view, the VHD looks just like a physical disk. When the VHD is attached and available for use, the disk icon is colored blue. When the VHD is detached and unavailable, the disk icon is colored gray.

Prerequisites

To complete the procedures in this article, the following prerequisite must be met:

  • The user account must be a member of the Backup Operators or Administrators group.

Create a VHD

To create a VHD, follow these steps:

  1. From the Windows Start menu, search for and open Disk Management with Administrator permissions.

  2. Expand the Action menu and select Create VHD.

  3. In the Create and Attach Virtual Hard Disk dialog, specify the location on the physical computer where you want to store the VHD file:

    1. 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.

    2. For the File name field, enter a name for the new VHD.

    3. Expand the Save as type dropdown list and select Virtual Disk files (*.vhdx).

    4. Select Save.

  4. For the Virtual hard disk size field, enter the file size for the new VHD.

    [!NOTE] A VHD can be only a basic disk with a minimum size of 3 megabytes (MB). A large fixed-size VHD can take extra time to create.

  5. For the Virtual hard disk type field, select Dynamically expanding or Fixed size.

  6. Select OK to finish.

Attach a VHD

To make a VHD available for use (either a disk you created or another existing VHD), follow these steps:

  1. From the Windows Start menu, search for and open Disk Management with Administrator permissions.

  2. Expand the Action menu and select Attach VHD.

  3. In the Attach Virtual Hard Disk dialog, select Browse. Locate and select the .vhdx or .vhd file for the VHD, and select OK.

  4. In the Attach Virtual Hard Disk dialog, select OK to finish.

Detach a VHD

When you detach a VHD, you make the disk unavailable. You don't delete the VHD or any data stored on the disk.

Detach a VHD by following these steps:

  1. From the Windows Start menu, search for and open Disk Management with Administrator permissions.

  2. Locate the VHD that you want to attach in the list of disks.

  3. Right-click the VHD, select Detach VHD, and then select OK.

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 06/24/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。