Mounting DMG image files to Vmware, Palallels or VirtualBox on Windows & Mac. Jan 21, 2014 Disk2vhd is a utility that creates VHD (Virtual Hard Disk - Microsoft's Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs). Disk2vhd is a utility that creates VHD (Virtual Hard Disk - Microsoft's Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs). The difference between Disk2vhd and other physical-to-virtual tools is that you can run Disk2vhd on a system that’s online.
Scroll down to “Update and Solution” to see how to get this to work.
Apple recently released new installers for Mac OS X/OS X/mac OS to deal with expired certificates:
Three of the six are links to the Mac App Store:
The other three are URLs to download DMGs:
- macOS Sierra – InstallOS.dmg
- OS X El Capitan – InstallMacOSX.dmg
- OS X Yosemite – InstallMacOSX.dmg
Today I tried (and failed) to create a new Virtual Machine in either Parallels or VMware Fusion using one of these DMGs, specifically, the El Capitan one.
I will explain what I did, and where I got stuck, in the hopes that someone else might figure out what I did wrong and point me in the right direction.
Download the DMG
Apple has created three DMGs for Yosemite, El Capitan, and Sierra, but couldn’t be bothered to give them useful names, so Yosemite and El Capitan are called ‘InstallMacOSX.dmg’ and Sierra is ‘InstallOS.dmg’.
Likewise the DMGs aren’t named usefully when you mount them either, so make sure you name the DMGs well when you download them to avoid confusion. Here’s how to download it and rename it at the same time
Mount the DMG
Dmg To Vmdk Windows
Open the ‘~/Downloads/InstallElCapitan.dmg’
That will leave you with
“/Volumes/Install OS X/InstallMacOSX.pkg”
Extract the App
Don’t try to install from that .pkg file, it probably won’t work unless the Mac you’re using is capable of running El Capitan:
Instead, open it with Suspicious Package which will let you examine the contents of the .pkg file, as shown here:
Note the area in the red box. Obviously that’s not the full installer, despite the .dmg being over 6 GB. But let’s export it anyway:
Save it to /Applications/ (or wherever you prefer, but that’s where I’ll assume it is for the rest of these instructions).
Don’t eject “/Volumes/Install OS X/InstallMacOSX.pkg” yet, we still need to get the actual .dmg from it.
Get the other DMG

Download The Archive Browser if you don’t already have it (it’s free!) and use it to open “/Volumes/Install OS X/InstallMacOSX.pkg”.
It will look like this:
Click on the triangle to the left of “InstallMaxOSX.pkg” to reveal its contents, and select the “InstallESD.dmg” file from it.
Once it is selected, choose “Extract Selected” from the bottom-left. Save it to ~/Downloads/ (it won’t be staying there long).
Ok, this part could be confusing…
When The Archive Browser exports the file, it will not just export the “InstallESD.dmg” file. First it creates a folder “InstallMacOSX” and then it created “InstallMacOSX.pkg” inside that folder, and the “InstallESD.dmg” file is put inside the .pkg… but you can’t see it, because the .pkg file won’t let you open it.
That’s OK, because we’re going to use Terminal.app to move the file into place anyway.
First we need to create a directory inside the ‘Install OS X El Capitan.app’ which we previously saved to /Applications/. We’re going to use the same folder for two commands and we want to make sure we get it exactly right both times, so we’ll make it a variable:
Then use the variable with mkdir
to create the folder:
and then we need to move the “InstallESD.dmg” file into that folder
Note: you probably want to trash the ‘~/Downloads/InstallMacOSX/InstallMacOSX.pkg’ (and its parent folder) now that it is empty, to avoid confusion later
Now if you look at the ‘Install OS X El Capitan.app’ in the Finder, it should show itself as 6.21 GB:
So close, and yet…
VMWare was willing to start trying to make a virtual machine using the app, but it failed when it came to the actual installation part:
I don’t know what to try next. Parallels would not use either the ‘Install OS X El Capitan.app’ or the ‘InstallESD.dmg’ to try to create a new virtual machine.
Update and Solution
I posted a question on the VMware Fusion support forum asking how to do this, and someone came up with a very clever solution, which I will replicate here in case others are interested. The idea is simple, but I never would have thought of it.
- Create a virtual machine of any version of macOS, even the current version that you are using on your Mac.
Inside the VM, download the .dmg (see below) and mount it.
Launch the .pkg inside the .dmg.
The .pkg seems to understand that it is inside a VM, and will install the app, which it would not do outside of the VM. Note that the Installer.app says that it will only take a few megabytes, but that is incorrect.
Find the “Install OS X El Capitan.app” (or whatever the app name is) in the /Applications/ folder inside the VM. It should be over 6 GB in size.
Copy the “Install….app” from the VM out to your actual Mac.
Create a new VM using the “Install….app” from the /Applications/ folder on your Mac.
Step #4 is the part that I never would have guessed. The .pkg would not install the app outside of a VM, but will install it inside of a VM.
This worked perfectly with the El Capitan .dmg file, and I’m currently doing the same with Yosemite and Sierra. Then I’ll try the older versions of Mac OS X from old installers that I have from before they disappeared from Apple’s servers.
Update 2
Turns out that Rich Trouton wrote about this technique back in early 2017:

But I wasn’t working with VMs at the time, so I must not not stored that in my long-term memory.
Update 3
I had saved the older installers for Lion, Mountain Lion, and Mavericks, which are no longer available for download.
Each of them still installed as a VM. Apparently they were not signed with the certificates that expired.
Older versions of Mac OS X (10.6.8 and before) are not available to virtualize.
-->Mounts a previously created disk image (virtual hard disk or ISO), making it appear as a normal disk.
Syntax
Description
The Mount-DiskImage cmdlet mounts a previously created disk image (virtual hard disk or ISO), making it appear as a normal disk.This cmdlet requires the full path of the VHD or ISO file.If the file is already mounted, then the cmdlet will display the following error.
-- 'The process cannot access the file because it is being used by another process.'
To mount a VHD file, administrator privileges is required.Administrator privileges are not needed to mount an ISO file on Windows® 8.On Windows Server® 2012, only an administrator is allowed to mount or eject an ISO file.

To create and mount a VHD on a computer running Hyper-V, use the New-VHD and Mount-VHD cmdlets in the Hyper-V module (which is included in Windows 8 and Windows Server 2012 but not enabled by default).Alternatively, open Disk Management and then choose Create VHD from the Action menu.
Examples
Example 1: Mounting an ISO
This example mounts an ISO by specifying the image path.
Parameters
Mounts the VHD file in read-only or read-write mode.If this parameter is not used or you specify the Unknown parameter value for the VHD file, the VHD file is mounted in read-write mode.
ISO files are mounted in read-only mode regardless of what parameter value you provide.
Type: | Access |
Accepted values: | Unknown, ReadWrite, ReadOnly |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the cmdlet in a remote session or on a remote computer.Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet.The default is the current session on the local computer.
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Dmg To Vhd
Specifies the path of the VHD or ISO file.
Dmg To Vhd
Type: | String[] |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the input object that is used in a pipeline command.
Type: | CimInstance[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies that no drive letter should be assigned to the VHD or ISO file after mounting.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Returns an object representing the item with which you are working.By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the storage type of a file: ISO, VHD, VHDx, or Unknown.If the StorageType parameter is not specified or the Unknown type is provided, then the storage type is determined by file extension.
Type: | StorageType |
Accepted values: | Unknown, ISO, VHD, VHDX, VHDSet |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs.The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
You can pipe a DiskImage object to the InputObject parameter.
Outputs
If you specify the Passthru parameter, this cmdlet outputs an object that represents the disk image that you mounted.
Notes
- When used in Failover Cluster, cmdlets from the Storage module operate on cluster level (all servers in the cluster).