Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

Products and Accounts

Support

Knowledge

Communities

Success

Learning

My Subscriptions

Loading

Knowledge Base

Defragmenting, shrinking, and cleaning up VMware Fusion virtual machine disks (1001934)

Last Updated: 3/2/2021Categories: Best PracticesTotal Views: 221816Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

22 like this article

Subscribe to get an email
newsletter with new updates

22 people found this helpful Please provide article feedback:

Details

You may be able to reduce the size of a VMware Fusion virtual machine's sparse disk if it does not have any snapshots. This article provides information on defragmenting the virtual hard drive from within Windows, shrinking the virtual disk from within Windows and Linux, and cleaning up (defragmenting) the virtual disk in Mac OS.

Note: It is not possible to reduce the size of a Fusion virtual machine's pre-allocated disk. The size of a pre-allocated disk is always approximately equal to the size allocated to the virtual machine's operating system.

A sparse disk is equal in size to the space the guest operating system has used. This size is not necessarily the same as the space that the guest operating system is currently using. This is because, when you tell an operating system to delete a file, it does not actually delete the file instead it stops remembering what is stored in the space that was used by the file. This is similar to having an unlabeled VCR tape or rewritable CD/DVD. If there is no label, the presumption is that you are free to record on it. So, when a file is deleted, the guest operating system stops marking that space as used. However, the data is not removed from the disk and so Fusion still counts it. Defragmenting and then shrinking the disk is necessary to free up this space that's no longer being used.

Solution

Fusion virtual machines can be pre-allocated or sparse. In a pre-allocated virtual machine, the size of the virtual disk file (or files, if you have chosen to split the virtual machine into 2 GB files) is equal to the size of the virtual machine. In a sparse virtual machine, the size of the virtual disk file (or files) is equal to the total used space of the virtual machine.

Your virtual machine bundle is always larger than the size of your virtual disks because the bundle contains snapshots, suspend state files (if the virtual machine is suspended), settings files, and logs. For more information, see Contents of the virtual machine bundle in Fusion (1021016).

However, if the size of your virtual disks is significantly larger than the used space shown in the virtual machine's Operating System, it is possible to reduce this size.

To reduce the size of the disk, you must defragment the disk within Windows, shrink the virtual disk using VMware Tools, and then clean up the virtual disk from within Mac OS using the built-in Fusion utility.

Notes:

This process does not apply to pre-allocated disks. To make a pre-allocated disk sparse, see Making a Fusion virtual disk pre-allocated or sparse (1021565).

You cannot perform a Clean up or Clean up option would not be available for an Encrypted VM. You must Decrypt the VM to perform a Clean up

To determine if your disk is sparse or pre-allocated, check the virtual disk settings:

Launch Fusion.

From the menu bar, go to Virtual Machine > Settings.

Click Hard Disk section.

Under Advanced, look for the Pre-allocated check box.

If Pre-allocated is selected, then your virtual disk is pre-allocated. If Pre-allocated is not selected, your virtual disk is sparse.

If your disk has snapshots, you need to delete the snapshots before trying to reduce the size of the disk. For more information, see Deleting snapshots in VMware Fusion (1020245).

Defragmenting within Windows

In a Windows virtual machine, you must first run a disk defragment from within Windows. Defragmenting within Windows ensures that all of the used spaces are contiguous. You can then reduce the size of the virtual disk.

To run a disk defragment within Windows, follow the instructions from Microsoft:

Windows XP: How to Defragment Your Disk Drive Volumes in Windows XP

Windows Vista: Improve performance by defragmenting your hard disk

Windows 7: Improve performance by defragmenting your hard disk

Windows 10: Improve performance by defragmenting your hard disk

Note: The preceding links were correct as of September 9, 2013. If you find that a link is broken, provide feedback and a VMware employee will update the link.

Shrinking the virtual disk

After defragmenting the virtual disk, use VMware Tools to erase empty disk sectors at the end of the disk, so that and the space is freed up.

Note: In Fusion 5.x and above, shrinking is automatically done while Cleaning up the disk. Therefore, this option is removed from VMware Tools Panel.

To shrink the virtual disk in VMware Fusion 4.x and earlier:

Open the VMware Tools Control Panel / Toolbox:

In Windows: Double click the VMware Tools icon in the system tray, or go to Start > Control Panel > VMware Tools.

In Linux:

Open a command prompt. For more information, see Opening a command or shell prompt (1003892).

Run this command:

vmware-toolbox

Click the Shrink tab.

Ensure that your boot drive is selected.

Click Prepare to Shrink and then follow the prompts.

Caution: Do not shutdown your virtual machine or the Mac while the disk is shrinking. Do not try to cancel the process. Interrupting this process can cause irreparable damage to your virtual disk and you may not be able to start your virtual machine again.

Cleaning up the disk

After shrinking your virtual disk, Fusion ensures that the virtual disk is optimized for Mac OS X. Mac OS X does this automatically for smaller files. However, virtual machine files are too large and you must manually clean up the disk.

To clean up your virtual disk:

In Fusion 4.x and above:

Shut down your virtual machine.

Go to Virtual Machine > Settings > General.

Select Clean Up Virtual Machine.

Note: For Fusion 10.x, To enable auto clean up check the box for " Clean up disks after shutting down the virtual machine “.

In Fusion 3.x and earlier:

Shut down your virtual machine.

Go to Virtual Machine > Settings > Hard Disks.

Select Clean Up Disk.

Additional Information

For translated versions of this article, see:

Español: Desfragmentar y comprimir discos de máquina virtual Fusion (2034917)

Português: Como desfragmentar e reduzir os discos da máquina virtual Fusion (2036614)

日本語: Fusion 仮想マシン ディスクの最適化、圧縮、クリーン アップ (2078415)

简体中文: 对 VMware Fusion 虚拟机磁盘进行碎片整理、压缩和清理 (2086167)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware Fusion Pro

VMware Fusion

Related Versions:

VMware Fusion Pro 8.x

VMware Fusion Pro 11.x

VMware Fusion Pro 10.x

VMware Fusion 8.x

VMware Fusion 7.x

VMware Fusion 6.x

VMware Fusion 5.x

VMware Fusion 4.x

VMware Fusion 3.x

VMware Fusion 2.x

VMware Fusion 11.x

VMware Fusion 10.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant