How to create and set up a virtual hard disk on Windows 10
Here are the instructions to get started with a virtual hard disk on Windows 10.
On Windows 10, a virtual hard disk (VHDX or VHD) is a file that can use a ".vhdx" or ".vhd" extension and acts like a physical hard drive, but with the difference that this is a file stored on a real disk.
Using either format (.vhdx or .vhd) for a virtual drive, you can store any files, including documents, pictures, videos, boot files, and an entire OS installation. The only differences between the two formats are that a .vhdx file supports a maximum size of 64TB, features resiliency against power failure, and provides better performance.
Typically, a VHD comes in handy to add extra storage to a Hyper-V virtual machine, and thanks to its ability to support other OS installations, you can even use this storage virtualization technology to create a dual-boot system without modifying an existing partition.
In this Windows 10 guide, we'll walk you through the steps to create and set up a virtual hard disk to store files on Windows 10.
- How to create a VHDX or VHD on Windows 10
- How to set up a VHDX or VHD on Windows 10
- How to mount a VHDX or VHD on Windows 10
How to create a VHDX or VHD on Windows 10
In order to create a VHD on Windows 10, do the following:
- Open Start.
- Search for Disk Management and click the top result to launch the experience.
- Click the Action button.
- Click the Create VHD option.
- Click the Browse button and locate the folder you want to store the virtual disk.
- In the "File name" field enter a name for the drive.
- Use the "Save as type file" drop-down menu and select Virtual Disk files (*.vhdx) . Or select Virtual Disk files (*.vhd) if you're planning to create a VHD file.
- Click the Save button.
- Under "Virtual hard disk size," specify the size of the drive in megabytes (MB), gigabytes (GB), or terabytes (TB).
- Under "Virtual hard disk format," select the VHDX option. (While using a VHDX format is recommended, you can also select the VHD format, but use it only if required.)
- Under "Virtual hard disk type," select the Dynamic expanding option. (If you have selected the VHD format in the previous step, it's recommended to select the Fixed size option when selecting a type.)
- Click OK.
Once you complete these steps, you'll have created a VHD that you can then set up and use with any compatible version of Windows.
How to set up a VHDX or VHD on Windows 10
Using the above steps, you created a VHD, but it's empty without any data or file system. To make it useful, you need to initialize the disk, create a partition, and format the drive using these steps:
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
- Right-click the newly created drive button on the far-left side, and click the Initialize Disk option.
- Select the disk from the list.
- Check the MBR (Master Boot Record) option. (You could also select the "GPT (GUID Partition Table)" option, but this option isn't supported by all versions of Windows.)
- Click OK.
- Right-click the Unallocated space, and select the New Simple Volume option.
- Click Next.
- Specify the size of the partition. (Leave this option unchanged if you're planning to use all the available space for the partition.)
- Click Next.
- Using the drop-down menu, select the drive letter you want to assign to the drive.
- Click Next.
- Under the Format this volume with the following settings section, make sure to use the following options:
- File System - NTFS.
- Allocation unit size - Default.
- Volume label - Use the name of the drive file, but you can enter any name.
- Perform a quick format - Formats the drive faster.
- Enable file and folder compression - If it's not required, don't select it (optional).
- Click Next.
- Click Finish.
After completing these steps, the VHDX or VHD will be initialized, partitioned, and formatted. The VHD will mount automatically, and you can now access and save files using File Explorer.
How to mount a VHDX or VHD on Windows 10
Although during the setup process, Windows 10 will automatically mount a VHDX or VHD file to your device, that won't always be the case.
If you're creating a VHD for another device, or you're storing the file on an external hard drive, you'll need to know the steps to properly attach and detach the virtual drive.
Mounting
To mount or attach the virtual hard disk, do the following:
- Open Start.
- Search for Disk Management and click the top result to launch the experience.
- Click the Action button.
- Click the Attach VHD option.
- Click the Browse button, and locate the .vhdx or .vhd file.
- Quick Tip: If you are only viewing and extracting files from the drive, you can also check the Read-only option to prevent accidental deletion or temper with the virtual drive's content.
- Click OK.
After completing these steps, you can access the VHD like any other drive using File Explorer.
Dismounting
It's important to save any files and applications located in the VHDX or VHD file before dismounting or detaching to prevent data loss.
- Open Start.
- Search for Disk Management and click the top result to launch the experience.
- Right-click the drive button on the far-left side, and select the Detach VHD option.
- Ensure you're detaching the correct drive, and then click OK.
Once you complete these steps, the VHDX or VHD file will no longer be mounted, and it'll no longer show up in File Explorer.
While this guide is focused on Windows 10, the ability to use a VHD has been available for some time, and you can use the same instructions on Windows 8.1.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
- Windows 10 on Windows Central – All you need to know
- Windows 10 help, tips, and tricks
- Windows 10 forums on Windows Central
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.