1

I installed Windows 10 on VMWare and I set its capacity as 60 gigabytes. Now I only want it to have 30 gigabytes and reclaim those 30 gigabytes for my mac. How do I change that?

8
  • First shrink the Windows aprtiton then the virtual hard disk file. What's the file extension of that virtual hard disk?
    – Biswapriyo
    Commented Jun 16, 2018 at 11:59
  • by default any virtualization software will use a dynamically grown HDD image. Check your vmdk, most certainly it won't be 60GB unless your data inside are almost 60GB or you accidentally set it as fixed size[
    – phuclv
    Commented Jun 16, 2018 at 13:56
  • @phuclv Yes it's dynamically allocates, but it's .vmdk
    – user28603
    Commented Jun 16, 2018 at 14:15
  • @Biswapriyo it's .vmdk
    – user28603
    Commented Jun 16, 2018 at 14:16
  • what do you mean? I asked you to check your vmdk file size. If it's really dynamically sized and already 60GB then there's no way you can reduce it unless you remove files in the VM and run compact
    – phuclv
    Commented Jun 16, 2018 at 14:21

3 Answers 3

0

You could use the free VMware vCenter Converter Standalone to convert from your VMWare image. After conversion disk will be shrinked.

1
0

It seems like there is no easy way to shrink VMware virtual disk. I ended up creating a new dynamic one with a desired size, booting from Ubuntu live CD with both old and new disks attached to a virtual machine and dd if=/dev/sda of=/dev/sdb my way out. sda is an old and sdb is the new disk.

This is terribly slow, but there is no way this could have not worked.

-1

You can use the C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe command line utility to create a new VMDK file with the lower capaacity.

Assuming that the utility is in your path and you are in the directory with the VMDK, make sure that the virtual machine is powered off and then issue a command like this:

vmware-vdiskmanager.exe -r sourceDisk.vmdk -s 30GB -t 0 destinationDisk.vmdk

Then, backup sourceDisk.vmdk, rename destinationDisk.vmdk to sourceDisk.vmd and confirm that everything works. (If it doesn't, you can simply restore the original VMDK file.)


Note that this does not touch the original VMDK file, it's only a VMDK copy that's created.

Also, this is not a sector-by-sector copy. All data is copied from the original, regardless of its location. Therefore, no data will be lost so long as the destination disk size is large enough to accommodate all of it.

In effect, copying the VMDK file to one that's smaller with this tool automatically performs a partition resize and a Compact during the process. This is safe because VMware is aware of its own virtual disk structure. It's the same underlying technology used by VMware Converter when it creates a cloned virtual machine with a differently sized disk.

3
  • 1
    That sounds like a bad idea. Shrinking the physical medium without first shrinking the filesystem can seriously corrupt the filesystem. Just because less than 30 GB are used doesn’t mean all data is physically located on the first 30 GB.
    – Daniel B
    Commented Jun 16, 2018 at 15:05
  • 2
    @DanielB I worked in technical support at VMware for over twelve years, and I assure you that this is safe. :) But in the worst case, you are not actually touching the original file—if anything goes wrong, it's only the copy that will be affected, and it's easily recovered from. When you copy the disk, it's the data that's copied—it's not sector by sector. In effect, a Compact is automatically performed during the process. Commented Jun 16, 2018 at 15:07
  • This command simply doesn't work this way. Commented May 9, 2021 at 16:47

You must log in to answer this question.

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