How to create and use a virtual disk in Windows

Creating a virtual hard disk in Windows 10 (VHDX or VHD) is the process of creating a file that can use the extension ".vhdx" or ".vhd" and acts as a physical hard disk, but with the difference that it is stored on a real hard drive. Using any format (.vhdx or .vhd) for a virtual disk, you can store any files, including documents, images, videos, boot files, and the entire OS installation. The only differences between these two formats are that the .vhdx file supports a maximum size of 64 TB, is fault tolerant to power failures and provides better performance. As a rule, VHD is useful for adding additional storage to a Hyper-V virtual machine, and due to its ability to support other OS installations, this storage virtualization technology can be used to create a dual-boot system without modifying the existing partition.

Work with virtual disks in Windows.

Virtual optical drive and its applications

As more and more data was stored on a computer, tablet or phone, which replaced document cabinets, bookshelves, photo albums and CD holders, we quickly had to face the fact that there might not be enough space on the device all information, including a collection of movies or games. One solution is a hard disk. The virtual partitions of the hard drive transfer the storage of digital data to the next level. First, we will look at what we are talking about when we mean a virtual image. And one of the most important points: the terms “virtual disks” and “virtual machines” can be interchangeable. Digital storage space and high demand for it will continue to grow. Many web services offering a virtual image in the cloud are scrutinized by their privacy policies. Unlike storing all your files on your own computer or physical external drive, with a virtual disk you upload your files to the server. This means that technically you will not be the only one who has access to them.

A virtual disk is a type of logical partition that is used in virtualization solutions. It looks like a normal one, but is installed on a virtual machine or a virtual server. A virtual image performs the same task as a hard drive for a computer, except that it does it for a virtual machine. It is created by the virtualization manager, logically dividing and distributing the space between one or several virtual machines. You can use a virtual disk to install guest operating systems, applications, and virtual machine data. The capacity of the virtual drive depends on the basic requirements of the capacity of the physical drive. In virtual memory, a virtual disk is a logically isolated drive on top of a storage area network. The cloud storage solution installed on the local computer is also used as a virtual hard drive.

Creating a laser disc image

Creating a virtual disk on a Windows 7 image is possible using one of the many applications for working with images and virtual drives. Consider the process on the example of PowerISO, WinISO and WinCDEmu.

How to make an ISO image of a CD, DVD or Blu-ray disc with PowerISO

PowerISO can create an ISO file from a CD, DVD or Blu-ray, performing step-by-step copying. All information, including download information, will be copied. You can launch the ISO maker using the main program or the shell context menu. ISO file using the main program:

  1. Run PowerISO.
  2. Click the "Copy" button on the toolbar, then select "Make CD / DVD / BD Image File ..." from the pop-up menu.
  3. The ISO Maker dialog box opens in PowerISO.
  4. Create and select the virtual drive containing the disk you want to copy.
  5. Select the output file name and set the output format to ISO.
  6. Click “OK” to start the process of creating an ISO file.

ISO file via shell context menu:

  1. Open My Computer and select the drive you want to copy.
  2. Right-click on the selected disk, the shell context menu appears.
  3. Select the "Make Image File" menu.
  4. The ISO Maker dialog box opens.
  5. Select the output file name and set the output format to ISO.
  6. Click “OK” to start the process.

How to create an ISO image file using WinISO

WinISO can satisfy your needs with all image formats, such as .ISO, .BIN, .CUE, .NRG (Nero), .MDF, .MDS, .CCD, .IMG and .DVD.

  • Step 1. Install and run the software. First, download WinISO for free from the official website, install and run it. After installation, run the program.
  • Step 2: Click the “Tools” button. Click the "Tools" button on the toolbar, and then "Make an image from CD / DVD / BD". Or you can simply click Create. Creating a virtual disk for Windows 10 is similar.
  • Step 3. Selecting and installing a destination. A dialog box will appear. Select the drive containing the CD / DVD / BD and select the desired output format at the destination, then enter “File Name”. After that, you can click the “OK” button to start creating the ISO file.

Creating an ISO image using WinCDEmu

You can optimize the storage of data, applications and everything else that can be written to CD / DVD, creating ISO images and saving them to your hard drive. Installing the program from an ISO image is much faster than using a real optical disc. Double clicking on an image to mount it is faster than inserting it into the drive, and finding the correct image using Windows Search is much more convenient than finding the right CD on the shelf. To create an ISO image using WinCDEmu, follow these steps:

  • insert the CD you want to copy into the optical drive;
  • open the “Computer” folder in the “Start” menu;
  • Right-click the CD icon and select Create ISO Image.
  • Select the file name for the image. This is similar to saving a newly created document or image. Click “Save”.
  • Wait until image creation is complete. Once it is created, you can remove the physical CD from the drive and mount the image whenever you need it.

Virtual hard disk

In Windows 7, Microsoft introduced a new way to back up your data called “Backup and Restore.” It allows you to backup all data to another location and provides the ability to create an image of the system. A system image is a large document with a .vhd extension. It can be used to restore the entire system. In windows 7, the program for creating images was so popular that it was preserved in Windows 8 and Windows 10. There is a tool on the control panel - Backup and Restore (Windows 7). The convenience of backing up your computer using this method, except being able to completely restore it later, is that you can transfer the file to any Windows 7, 8 or 10 computer, and access the data just as you would from a regular hard drive. Therefore, if you need to copy only a few files from your backup, it is much easier to make a virtual hard disk use VHD, rather than restore the backup, which will first completely delete the data, and then copy the ones saved in the image.

Mounting VHD

To mount the image in Windows, click "Start" and type "Computer Management" in the search window. You can also go to the Control Panel, then “System and Security”, then click “Administration” and then “Computer Management”. If you are in the "Icons" view, click "Administration". Now in the menu on the left, click "Disk Management", and wait until the list of disks and partitions appears. Then right-click Disk Management and select Mount VHD. In the dialog box, click Browse, navigate to the location of the file you want to connect, and click OK.

ATTENTION. If you do not check the “Read Only” box, you can add, change or delete files / folders from a virtual hard disk. This is really useful because you can attach your file, add some more data you want to copy, and then just extract it.

As soon as the system has finished mounting, you will see that the disk will appear as a new device in My computer. Windows will automatically assign a drive letter. Otherwise, right-click on the Primary Partition and select "Change Drive Letter." To remove the VHD, right-click on the gray area with the name of the disk and select "Extract VHD".

VHD creation

You can save a copy of the operating system and all personal data in a document using the free Microsoft tool. Go to the Computer Management section, click on Disk Management, and then right-click on Disk Management. Instead of choosing Mount, click Create VHD. This will bring up a window in which you need to specify the document size, format and location. It is recommended that you select the VHDX file format, since it is less susceptible to cracking and can support larger sizes. If you choose a VHD file format, it will recommend a fixed size. If you select VHDX, you will be offered a dynamic extension. It is better to leave the default settings. Be sure to enter the size value of your virtual disk. You can change it to GB or TB in the drop-down list.

Now one more device will appear in disk management - marked “Unallocated”. In the gray section for the new image, right-click and select "Enable Disk". Then you need to choose what to use - MBR or GPT. For compatibility with versions of Windows older than Vista, select the MBR. For new features and large hard drives, use GPT. Now right-click on the unallocated area and select “New Simple Volume”. This will trigger the new volumes master. First, you must choose the size of the new volume. This cannot be the size of the unallocated space.

Click Next and select a drive letter to assign to the partition. Then select a formatting method. By default, it is set to NTFS, but you can also select FAT32. Choose NTFS if you are using virtual media to back up files from your computer. Click "Next" and "Done", and that's it! Now a new device is displayed in Disk Management.

Using VHD in a virtual machine

The extension denotes a virtual hard drive. This is a format that is structured to represent a standard hard drive and allows you to encapsulate the operating system and data in one file. This document supports all standard operations. The document is on our hard drive, but all the content is written inside the document. All partitions, data and the entire file system are saved in the document that is used for the download. Please note that the extension may include the operating system and / or data. The name can be chosen during the configuration process, but its extension will always be .vhd. You can create a new document using the available disk space.

The image looks like an unused hard drive. After creating a VHD in it, you can create one or more partitions and format them using the FAT, ExFAT or NTFS file system. When it comes to size, VHD can be fixed in size or it can be dynamically expanded. A fixed VHD has a predefined amount of space that is reserved on physical media. This reservation also includes empty space. Creating a VHD takes more time, but its performance is better because it is all a solid block. Dynamically expanding VHD allocates physical disk space because virtual memory is used by the virtual machine. This means that the size of the .vhd file grows as you use our virtual machine. In addition, dynamically expanding VHD files do not become smaller when deleting files.

You can mount (connect) an existing image to display it in our existing operating system. You can also mount the image as a disk with the ability to read. Thus, the contents of the image can not be changed. Mounted images can be removed (removed) or deleted. The advantage of using VHD is the ability to download and configure multiple versions of the operating system. When configuring multiboot using standard settings, you need to create a new partition and install Windows there. When using images just create a new VHD. This means that you can have one partition with several files (several operating systems). Installing a virtual disk also implies greater flexibility when it comes to disaster recovery. We can copy the image from one computer that was damaged to another with similar hardware. Users will have access to the same OS and data as on the old computer.

Management tools

You can use DiskPart, Disk Management in Windows, WIM2VHD and BCDEdit to manage VHD. MMC for disk management allows you to create, mount and extract images. With DiskPart you can create, mount, extract, compress, expand and view image details. Common diskpart commands used for a virtual disk:

  • create vdisk - creates an image with the size of the VHD file expressed in MB (the file name must have the extension .vhd);
  • mount vdisk - mount image;
  • extract vdisk - extracts the image;
  • compress vdisk - reduces the size of the image;
  • increase vdisk - expands the maximum size available in the image;
  • vdisk details - displays information.

Windows Automated Installation Kit (Windows AIK) includes a WIM2VHD emulator utility that you can use to create an image from a Windows installation source. Using WIM2VHD, you can create a new image of the specified type and size, apply WIM, use the Unattend file to automate the Out Of Box part of the Windows boot when you first launch the generalized image and apply updates to it.