A virtual operating system of course needs a virtual hard disk to store its files and the major software companies each have their own implementations of a virtual hard disk. Oracle’s VirtualBox uses Virtual Disk Image (VDI), VMWare uses Virtual Machine Disk (VMDK) and Microsoft products like Virtual PC, Windows XP Mode or Hyper-V use Virtual Hard Disks (VHD or VHDX). Virtual disk formats are sometimes interchangeable between products, VirtualBox for instance supports VDI, VHD, VMDK and a few more.
Sometimes it might be useful to read data or copy files from a virtual hard disk to your computer without booting into the virtual operating system. In that situation being able to open the virtual hard disk and read the contents is important. Also you might want to delete, move or add files to the virtual operating system in the same way, perhaps to perform repairs to a non booting system or run offline Windows updates. Here we show you ways to open virtual disk images with both read and write access for major virtual disk file formats VDI, VHD and VMDK. They are separated into read only and read/write methods. Make sure your virtual machine software is not running before trying to open the disk image, it also works more reliably when there are no snapshots attached to the virtual disk.
Read Only Access for Virtual Disk Files (VHD, VDI or VMDK)
There are many different ways you can access the contents of a virtual disk without actually booting into the virtual operating system itself. Here’s a selection of easy solutions.
1. 7-Zip (VHD, VDI and VMDK)
7-Zip is probably the most popular free archiver and it includes the ability to open VHD, VDI and VMDK disk images. You can easily extract whatever files are required from the virtual operating system using drag and drop or copying out with the Extract button.
To open a virtual disk right click on it and select Open archive from the 7-Zip context menu or open File Manager and manually browse for the virtual disk. Only single volume VDI’s are supported which means if there is more than one partition the VDI won’t open. Multi volume VHD and VMDK files are supported and the volumes will be shown numbered. In the image above 0 is the Reserved Boot partition, 1 is the main Windows partition and 2 is the Recovery partition.
2. Passmark OSFMount (VHD and VMDK)
OSFMount can handle VHD and VMDK virtual hard disks but does not support the VDI files from VirtualBox. The virtual disks are mounted as drive letters in this program which means they behave much like an ordinary hard disk while connected, but are read only.
After installing and launching OSFMount, press the Mount new button, this will bring up the mount drive dialog. Click the button to browse for a virtual image file and a list of available partitions will be displayed, simply select the one you want to mount. To mount multiple partitions at once click the Mount all partitions radio button and all partitions will receive their own drive letter automatically. No other options need changing although you can choose a different drive letter if required.
3. PowerISO (VHD, VDI and VMDK)
Although PowerISO is a shareware program costing $29.95 the trial version can be used indefinitely and allows you to open and access disk image files, including VHD, VDI and VMDK images. The good thing about PowerISO is its ability to handle multi partition VDI virtual disks in addition to VHD and VMDK. Please watch out for the adware offered during install.
Install and open PowerISO, click the Open button and browse for the disk image to load. The next window will ask you to select which partition to import, you can only load a single partition at once but all partitions in the image file will be available. You can then drag and drop folders or files out of the window or click the Extract button and browse for a save location. The highlighted bar near the bottom of the window offers some basic information about the virtual disk file.
Read and Write Access for Virtual Disks (VHD, VDI or VMDK)
Being able to read and copy files from the virtual hard disk will probably be enough for many users, but there will be others that need to write files into the image without booting the operating system.
4. Mount VHD, VDI and VMDK Disk Images Using ImDisk Toolkit
ImDisk virtual disk driver creates and mounts virtual hard disks, optical disks and floppies. Although you can mount virtual hard disks the process is complicated because you need to know the location offsets for the virtual partitions. ImDisk Toolkit uses the ImDisk driver but has an easy to use interface making the whole process much simpler.
1. Download ImDisk Toolkit and install it, if you don’t want to make use of the ImDisk RamDisk feature it can be deselected. Double click the “Mount Image File” desktop shortcut.
2. Drag and drop the virtual disk image onto the window or use the browse button to locate it. A drive letter will be preassigned which can be changed from the drop down, for just read access tick the Read-only box. When using multi partition images you can click on which one to mount from the list at the bottom. Click OK to mount the virtual drive to the selected letter.
The virtual drive will appear in Explorer like any other hard drive complete with read and write access. ImDisk Toolkit is able to mount static, dynamic and multipart virtual disk images.
Unmount VHD, VDI and VMDK files From ImDisk
During installation the ImDisk driver adds its own entry into Control Panel where you can create, mount and unmount virtual disks from the applet. To unmount a drive open “ImDisk Virtual Disk Driver”, click on the virtual drive and press the Remove button, right click and select Remove or press Delete.
An easier option if you allowed the context menu shortcuts to be installed is to open Computer or This PC, right click on the virtual drive and select Unmount ImDisk Virtual Disk.
This will automatically dismount the virtual disk and release the drive letter.
5. Mount VMDK and VHD images With The VMWare DiskMount Utility
If you are someone that primarily uses VMDK disk images then a dedicated disk mounting tool from VMWare themselves is a good option. The DiskMount utility can also mount multi volume VHD files for read and write but VDI is not supported. An issue for some users will be DiskMount is a command line only tool but it should provide a reliable way to access a VMDK for writing.
1. Download VDDK for vSphere 5.1.4 (Virtual Disk Development Kit) from VMWare, you will need to create an account at VMWare before downloading any files from their website. Do not download a newer VDDK version as the DiskMount utility won’t be included. Install VDDK.
2. Open a Command Prompt, the utility is located in the following location, for ease of use make it the current directory:
64-bit: cd "C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin"
32-bit: cd "C:\Program Files\VMware\VMware Virtual Disk Development Kit\bin"
3. The commands are quite simple, this one will mount the first volume in the virtual disk:
vmware-mount.exe [drive:] [path to vdisk]
The above will automatically mount the first volume in VirtualDisk.vmdk to drive V. To mount a volume which isn’t the first in the virtual disk, add the /v:[number] argument. You can first check how many volumes are in the image with the /p argument:
vmware-mount.exe /p [path to vdisk]
vmware-mount.exe /v:[number] [drive:] [path to vdisk]
The first command above lists how many volumes are in the VHD file and the second mounts volume 2 to drive V:.
Unmount Virtual Images With VMWare DiskMount
To dismount a virtual drive from the system and free the drive letter use the command:
vmware-mount.exe /d /f [drive:]
Mount Virtual Images Easily With a DiskMount Script
For convenience we have created a simple batch script that will automatically mount the selected volume in a virtual disk to drive letter V:.
Download the zip, extract it then drag and drop a VMDK/VHD file onto the Mount_Virtual_Disk.bat file. It will list the available volumes and ask which one you want to mount, press the corresponding number key and the volume will mount to the V: drive with read and write access.
Run the batch file again for the option to dismount the drive or execute Unmount_Virtual_Disk.bat to silently dismount. Note that the VDDK needs to be installed to the default location in Program Files for the script to work, or you can edit that, the number of selectable volumes and the assigned drive letter yourself.
6. Mount VHD, VDI and VMDK Disk Images Using Daemon Tools Lite
Due to several factors Daemon Tools probably isn’t as popular as it once was, but the free Lite version is still a capable disk mounting tool for several types of disk images. In this case it includes read and write support for VHD, VDI and VMDK virtual hard drives.
Do be very careful during install as there is opt out adware to get past but make sure for ease of use to leave the virtual disk file associations enabled, that way you only need to double click on an image file to mount it. One drawback is Daemon Tools doesn’t recognize multi volume disk images and will only mount the first available partition however many are present. The handy thing is you can easily mount up to 4 virtual disks with just a few mouse clicks.
Unmount Disk Images From Daemon Tools Lite
There’s a few ways to dismount a virtual drive from Daemon Tools. From the main interface mounted images are listed across the bottom and hovering over one will popup a red X, click it to dismount the drive. In the Images tab you can also right click and Unmount.
If you have enabled the tray icon from within the settings individual drives or all drives can be unmounted in one go, right click the icon and go to the Virtual devices sub menu.
7. Mount a VHD Using Windows 7, 8.1 and 10 Disk Management
Microsoft introduced a way of mounting VHD files as virtual drives starting with Windows 7. Like many Windows features the option is not particularly well publicized and a bit hidden away.
1. Either type Compmgmt.msc into the Start Menu search box or right click Computer/This PC and click Manage.
2. In Computer Management click on Disk Management and let it enumerate the disks on the system. Then right click on Disk Management and select Attach VHD.
3. Browse for the VHD file or enter the path manually, Windows 8.1 and 10 users have the added option to mount Hyper-V VHDX images. There’s no need to tick the Read-only box unless you only want to read or extract files. Click OK when ready.
The VHD will be mounted and given a drive letter, if there are multiple partitions they will each be given additional letters. Mounted virtual drives will appear with pale blue icons in the lower pane of the Disk Management window as will the volumes in the upper pane.
The mounted virtual VHD will now be listed as a standard hard drive in Explorer with read and write access.
Detaching the Virtual Hard Disk
VHD files mounted in this way only stay mounted for the current session so when you reboot or shutdown the computer they will automatically be detached. To manually remove the VHD from the system, do the following.
1. Open Disk Management (Diskmgmt.msc or steps 1 – 2 above) and find the virtual hard disk you want to remove. Right click on the drive information in the lower window (where it says Disk #) and click Detach VHD.
2. Click OK to confirm the detach. Obviously make sure you do not tick the delete box as the VHD itself will be deleted.