Jump to content

How to shrink OS X .vmdk


34 posts in this topic

Recommended Posts

Protégé,

Followed your directions, worked perfectly on Workstation 12.

OS High Sierra Guest Terminal:
sudo diskutil secureErase freespace 0 High\ Sierra

CMD as administrator Win7 Ult 64
C:\"Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k "D:\Virtuais\MacOS High Sierra\macOS High Sierra.vmdk"

The VMDK file was shrinked from 45 to 20,1 Gb.

Tks a lot!
Greets from Brazil.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi, trying to do this on a new Catalina disk image, which has two APFS volumes.

I receive an error "erasing freespace only works on mounted and writable volume". The volumes I have are "macOS" and "macOS Data". Am I doing something wrong?

Annotation 2019-10-01 232748.png

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

It seems that a working solution to shrink a macOS Catalina vmdk is given here: https://communities.vmware.com/message/2897835#2897835.

 

At least for me it worked for macOS Catalina 10.15.2 Beta - running on VMWare Workstation 15.5.0 / Windows 10. The downside ... first it will grow (so you need to have enough space) ... then you can shrink it from outside.

 

1. Inside the running VM open a terminal and give the following command (you can run it as a regular user): cat /dev/zero > wipefile; rm wipefile

2. Shutdown the VM

3. "C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k PATH_TO_MACOS.vmdk

Edited by wii4greatfun
more specific wording
Link to comment
Share on other sites

  • 4 months later...
On 10/1/2019 at 6:58 PM, TANGCLA said:

Hi, trying to do this on a new Catalina disk image, which has two APFS volumes.

I receive an error "erasing freespace only works on mounted and writable volume". The volumes I have are "macOS" and "macOS Data". Am I doing something wrong?

Annotation 2019-10-01 232748.png

 

Hi, Did you find any way to solve this problem, because I am currently facing this same issue? 

 

Please help, As I am currently working on a project that is taking lots of space so I whole-heatedly need this thing done.

 

Thank you in advance.

Link to comment
Share on other sites

On 4/10/2020 at 4:39 PM, harsh_1301 said:

 

Hi, Did you find any way to solve this problem, because I am currently facing this same issue? 

 

Please help, As I am currently working on a project that is taking lots of space so I whole-heatedly need this thing done.

 

Thank you in advance.

Hi, I used this:

 

cat /dev/zero > wipefile; rm wipefile
Edited by TANGCLA
typo on code
Link to comment
Share on other sites

  • 2 weeks later...

I lready 'zeroed out' disk, but when I run

vmware-vdiskmanager -k macOsguest.vmdk

I am getting

Failed to shrink the disk 'macOSguest.vmdk': An error ocurred while writing a file; the disk is full. Data has not been saved. Free some disk space and try again (0x8).

However guest disk is set to take up to 100 GB, and actual vmdk file is only taking 54 GB:

 

Current size: 54,2 GB

Maximum size: 100 GB

System free: 37,3 GB

 

What can I do? How can I proceed?

Edited by Jago
Point out I already zeroed out disk
Link to comment
Share on other sites

I lready 'zeroed out' disk, but when I run
vmware-vdiskmanager -k macOsguest.vmdk

I am getting

Failed to shrink the disk 'macOSguest.vmdk': An error ocurred while writing a file; the disk is full. Data has not been saved. Free some disk space and try again (0x8).

However guest disk is set to take up to 100 GB, and actual vmdk file is only taking 54 GB:
 
Current size: 54,2 GB
Maximum size: 100 GB
System free: 37,3 GB
 
What can I do? How can I proceed?

Have you then shrink it using vmware-diskmanager in Windows?

Sent from my ELE-L29 using Tapatalk

Link to comment
Share on other sites

1 minute ago, TANGCLA said:

Have you then shrink it using vmware-diskmanager in Windows?

Sent from my ELE-L29 using Tapatalk
 

 

Tried vmware-vdiskmanager both in Windows and Linux hosts, getting same error in both cases.

Link to comment
Share on other sites

 Share

×
×
  • Create New...