Procedures to clean up/shrink a Snow Leopard VM under Fusion versions 5, 8 & 10

Procedures to clean up/shrink a Snow Leopard VM under Fusion versions 5, 8 & 10

**** VMware Fusion 8 & 10 procedure **

 

Backup the existing Mac OS X Snow Leopard virtual machine

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

If there are a number of Virtual Disk files then Fusion is allocating space for the virtual machine in 2 GB segments

Close the Package Contents folder

 

If the Snow Leopard virtual machine is segmented then convert it to a single Virtual Disk.vmdk as follows:

Start VMware Fusion

Select the Mac OS X Snow Leopard virtual machine

Click Settings > Hard Disk (SCSI)

Click the Advanced options disclosure triangle

Click Apply

This process will take a few minutes to complete. After the conversion is done, continue with the next step of this procedure.

 

Start the Mac OS X Snow Leopard virtual machine

 

Start Terminal

Type "mount" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

The mount command will display the root device which looks like: /dev/disk0s2

(The important thing is to determine the root device. (disk0s1, disk0s2, disk0s3 etc.)

 

In the following command, if necessary, change disk0s2 to the root device that the mount command returned.

    

Type "sudo diskutil secureErase freespace 0 /dev/disk0s2" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

 

If a message is displayed stating: "Your startup disk is almost full", click OK

When the erasure completes, quit Terminal

Shut Down the Snow Leopard virtual machine

 

Quit VMware Fusion

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

Select the Virtual Disk.vmdk file

Click Edit > Copy "Virtual Disk.vmdk"

Open a new Finder window for the ~/Virtual Machines folder

Click Edit > Paste Item

 

Rename the "Virtual Disk.vmdk" file in the ~/Virtual Machines folder to "Original Disk.vmdk"

 

Start Terminal

Type "cd ~/" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

Type "ls" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

The ls command will display a listing of folders in your account home folder

In the listing, find the Virtual Machines folder to determine if .localized is appended to it (i.e. "Virtual Machines.localized")

 

Change "xxxxxxxx" in the following Terminal command to your short account name.

 

Use this command if the Virtual Machines folder does not have .localized appended to it:

 

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r "/Users/xxxxxxxx/Virtual Machines/Original Disk.vmdk" -t 0 "/Users/xxxxxxxx/Virtual Machines/Virtual Disk.vmdk"

 

Use this command if the Virtual Machines folder does have .localized appended to it:

 

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r "/Users/xxxxxxxx/Virtual Machines.localized/Original Disk.vmdk" -t 0 "/Users/xxxxxxxx/Virtual Machines.localized/Virtual Disk.vmdk"

 

Paste the appropriate Terminal command (including the leading and trailing quotation marks) into the Terminal window

Press the return (enter) key

After the process completes and the Terminal input prompt is displayed, quit Terminal

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

Right click the Virtual Disk.vmdk file and select Move to Trash

Move the Virtual Disk.vmdk file from the ~/Virtual Machines folder to the Mac OS X Snow Leopard package folder

Close the Package Contents folder

 

Start the Mac OS X Snow Leopard virtual machine to confirm that it runs correctly

 

Shut Down the Snow Leopard virtual machine

 

Right click the "Original Disk.vmdk" file in the ~/Virtual Machines folder and select Move to Trash

 

**** VMware Fusion 5 procedure **

 

Backup the existing Mac OS X Snow Leopard virtual machine

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

If there are a number of Virtual Disk files then Fusion is allocating space for the virtual machine in 2 GB segments

Close the Package Contents folder

 

If the Snow Leopard virtual machine is segmented then convert it to a single Virtual Disk.vmdk as follows:

Start VMware Fusion

Select the Mac OS X Snow Leopard virtual machine

Click Settings > Hard Disk (SCSI)

Click the Advanced options disclosure triangle

Clear 'Split into 2 GB files'

Click Apply

This process will take a few minutes to complete. After the conversion is done, continue with the next step of this procedure.

 

Start the Mac OS X Snow Leopard virtual machine

 

Start Disk Utility

Select Macintosh HD

Click Erase

Click Erase Free Space

Select Zero Out Deleted Files

Click Erase Free Space

If a message is displayed stating: "Your startup disk is almost full", click OK

When the erasure completes, quit Disk Utility

Shut Down the Snow Leopard virtual machine

 

Quit VMware Fusion

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

Select the Virtual Disk.vmdk file

Click Edit > Copy "Virtual Disk.vmdk"

Select the ~/Documents/Virtual Machines folder

Click Edit > Paste Item

 

Rename the "Virtual Disk.vmdk" file in the ~/Documents/Virtual Machines folder to "Original Disk.vmdk"

 

Start Terminal

Type "cd Documents" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

Type "ls" (without the quotation marks) at the Terminal command prompt and press the return (enter) key

The ls command will display a listing of folders in your Documents folder

In the listing, find the Virtual Machines folder to determine if .localized is appended to it (i.e. "Virtual Machines.localized")

 

Change "xxxxxxxx" in the following Terminal command to your short account name.

 

Use this command if the Virtual Machines folder does not have .localized appended to it:

 

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r "/Users/xxxxxxxx/Documents/Virtual Machines/Original Disk.vmdk" -t 0 "/Users/xxxxxxxx/Documents/Virtual Machines/Virtual Disk.vmdk"

 

Use this command if the Virtual Machines folder does have .localized appended to it:

 

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r "/Users/xxxxxxxx/Documents/Virtual Machines.localized/Original Disk.vmdk" -t 0 "/Users/xxxxxxxx/Documents/Virtual Machines.localized/Virtual Disk.vmdk"

 

Paste the appropriate Terminal command (including the leading and trailing quotation marks) into the Terminal window

Press the return (enter) key

After the process completes and the Terminal input prompt is displayed, quit Terminal

 

Right click the Mac OS X Snow Leopard virtual machine

Click Show Package Contents

Right click the Virtual Disk.vmdk file and select Move to Trash

Move the Virtual Disk.vmdk file from the ~/Documents/Virtual Machines folder to the Mac OS X Snow Leopard package folder

Close the Package Contents folder

 

Start the Mac OS X Snow Leopard virtual machine to confirm that it runs correctly

 

Right click the "Original Disk.vmdk" file in the ~/Documents/Virtual Machines folder and select Move to Trash

 

Comments

Works on 10.8.4 Mountain Lion as well. From 14.9GB to 7.6GB after completion.

Thanks LeoRegius!

To clean up (shrink) an OS X 10.8.5 Mountain Lion virtual machine use the VMware Fusion 8 & 10 procedure.

Version history
Revision #:
3 of 3
Last update:
‎07-06-2021 06:12 PM
Updated by:
 
Contributors