To convert multiple VMDKs into a single file, I used the following command (LinuxVM.vmdk is the name of the first VMDK file – i.e. the one attached to the VM):

$ vmware-vdiskmanager -r LinuxVM.vmdk -t 0 LinuxVMSingleDisk.vmdk

Note that vmware-vdiskmanager is bundled as part of VMware Workstation. I couldn’t locate that as a separate download, so I ended up downloading the trial version of Workstation.

The above operation takes a while, but not too long. It shows its progress as it completes.

Next, I had to modify the VM settings so that it would use the new disk. I couldn’t find this option in the GUI, so I had to modify the vmx file manually (use an appropriate editor on a Windows system):

$ vi LinuxVM.vmx

I modified the scsi0:0.fileName property to point to the new disk:

scsi0:0.fileName = "LinuxVMSingleDisk.vmdk"

Next, I double checked the VM settings in the GUI to check if the disk had changed, and then booted it up to confirm everything is fine. I then deleted all the old, multiple vmdk files.

The Motivation for Doing This

I’d been using a few heavy applications in my VM: an HTTP server, an Application Server behind it running a couple of large applications, and a database. When doing intensive work, my hard disk would make grinding noises and my Ubuntu host would suddenly exit to the login screen. I’d lose all data in my current session, though oddly, some background applications would continue to run.

So I decided to implement VMware’s suggestion to use a single file for better performance:

VMware Workstation - Creating a virtual disk

Did it really work? The host did crash once, but that was when another heavy application was running on the host itself. In my entirely subjective assessment, I do think there’s been an improvement in performance – though I still need to be a little careful with certain applications.

One thought on “Converting Multiple VMDK (Virtual Machine Disk) files into one

  1. vsap says:

    Hello, It did the work for me. But I lost the all applications I have installed in the vm . Is there any way I could restore to my previous point?

Leave a Reply

Your email address will not be published. Required fields are marked *