1

I'm familiar with shrinking the total space of a virtual disk on Oracle VirtualBox using their vboxmanage.exe command line tool for shrinking.  Now I have a VMware multi-volume disk (vmdk), and I've defragmented and zeroed the free space of the OS/disk, but now I don't know how to proceed to shrink the total virtual-disk space to its real size like in VirtualBox.

Which tool I need to use?

Alternative to Workstation in case of that program is needed for shrinking, I'm using the VMware free player.

(I've seen this solution, but it uses the huge and paid Workstation program.)

I really don't want to depend on a program of that measures to accomplish this task.

1
  • Have you tried using the command "vmware-vdiskmanager -k myDisk.vmdk" to shrink the vmdk file? and also noticed that this command already available in the link you have mentioned.
    – BDRSuite
    Commented Nov 17, 2014 at 19:39

1 Answer 1

0

Ok I just did a trick and worked perfectlly.

1) Install VMWare Workstation in a VirtualMachine (to avoid installing all the trash of uneeded registry keys, drivers, connections, and services that this huge program install in the SO...)

2) Copy these files from the VMWare Workstation installation in the virtual OS to the host OS:

libeay32.dll
ssleay32.dll
vmware-vdiskmanager.exe

At this point we have a working standalone vmware-vdiskmanager.exe that does not require the VMWare Workstation application installed to shrink a virtual-disk :), so we can store those files in a folder and call the application from commandline to shrink a disk:

".\vmware-vdiskmanager.exe" -k ".\Disk.vmdk"

Note: Those dll libraries are related to OpenSSL and are required to run the app, maybe other features of vmware-vdiskmanager.exe will require to copy other libraries.

3) Plus we can add some registry keys in our OS to shrink an VMWare virtual-disk (disk.vmdk) by doing mouse right-click on the file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.VMDK\Shell\VMWare]
"MUIVerb"="VMWare"
"SubCommands"="VMWare.Compact"
"icon"="C:\\VMWare.ico"
"Position"="Top"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\VMWare.Compact]
@="Shrink Disk"
"icon"="C:\\VMWare.ico"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\VMWare.Compact\command]
@="\"C:\\vmware-vdiskmanager.exe\" -k \"%1\""

Note: Change the filepaths on the registry script.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .