September 23, 2015
Combine multiple virtual disk files into single vmdk with VMware Player
The information in this post is based on VMware Player 7 running on a Windows 7 64 bit host. It may or may not be valid for other versions and platforms.
I recently received a virtual machine that I did not get to install myself. I’m as picky as most older nerds *cough* about how my stuff is set up, and one thing that particularly annoyed me about this VM was that the person who had installed it had opted to have the virtual disk stored in multiple smaller files instead of one large. On modern file systems with no practical upper file size limit I really can’t see the advantage of this.
Anyway, I decided to see if I could get the virtual disk files (with vmdk extension) merged into one. Unfortunately, VMware Player does not come with an option to do this, you need one of the “bigger” VMware products, such as Workstation.
Fortunately, I discovered that a small command line utility exists and you can download it for free from VMware’s website (search for KB article 1023856 in their Support section). Unzip the utility to the folder where you have VMware Player installed.
Now, let’s assume you have a virtual machine where the disks are stored as virtualdisk.vmdk, virtualdisk-s001.vmdk, virtualdisk-s002.vmdk, virtualdisk-s003.vmdk, etc. which you wish to merge into a single large file instead. To do this, make sure the virtual machine is shut down, then open a command prompt on the host and execute the following command (obviously replacing paths and filenames for those valid on your system):
"C:\Program Files (x86)\VMware\VMware Player\vmware-vdiskmanager.exe" -r "D:\VM\virtualdisk.vmdk" -t 0 virtualdisk-combined.vmdk
After the utility finishes, move all the old vmdk files to a separate folder (as backup until you’re sure the new file works), then rename the virtualdisk-combined.vmdk file to virtualdisk.vmdk (again, use the actual names of files on your system instead) and attempt to start up the virtual machine in VMware Player. For me it worked without a hitch :-)
Once you have verified that it works, you can delete the old vmdk files to save some disk space.