Fusion

 View Only
  • 1.  how to delete files in windows guest and free storage space

    Posted Mar 26, 2024 07:36 PM

    Hi! I am a beginner of VMware. I installed VMware in my mac and installed windows 11 ARM in the VMware. I empty trash bin in the windows 11. But then I realized the storage space taken up by windows11.iso is even larger in mac. I'm using VMware 13 pro on mac M1 chip.

    What is the correct procedure to delete a file in windows 11(guest) and reduce the storage space of windows11.iso in my mac? Should I input some command lines in terminal in the windows? Thank you for your help!



  • 2.  RE: how to delete files in windows guest and free storage space

    Posted Mar 26, 2024 08:45 PM

    Deleted space doesn't get reflected back to the Mac because of the way virtual disks work. Once space on the Mac is assigned to the virtual machine (that happens when the VM writes information), it doesn't get released when you delete a file in the VM - it merely gets added to a free space in the Windows file system and will be re-used.

    Rule of thumb because of this: you should always assume that when you create a virtual disk of a given size, that it will be filled to that size. Over-provisioning virtual disks is a prescription for problems. It's easier to err on the conservative side and size virtual disks for what you reasonably expect to use. It's easier to expand a virtual disk if you run out of space in the VM than to try to shrink it later on. 

    Here's something easy you can that may help:

    Don't run any more snapshots than you have to. Each snapshot takes up space, and the more snapshots you have, the more space you'll use (and the more problems you could have). If you're running more than 1 snapshot, you really should rethink what you're doing. 

    On a regular basis, highlight the virtual machine in the Virtual Machine Library, then click on the very small circle next to the bar graph at the bottom of the window:

    Technogeezer_0-1711484846584.png

    If you see something like this after the sizing refreshes:

    Technogeezer_1-1711484939163.png

    with an orange indication, click on the "Clean Up Recommended" text. That will open the VM's General settings, and from there click the button marked "Clean Up Virtual Machine"

    Technogeezer_2-1711485050151.png

    That will free up the amount of space that's marked as Reclaimable.

     It's a non-trivial task to further release any unused but allocated space that may exist in the VM. If you really want to take this to the next step, you;ll need to:

    • Run a defragmenter within the Windows virtual machine (not really great if you're storing your VM on SSD).
    • Write a large file of zeros in the VM to fill up the disk. (NOTE this assumes that you have enough space on your Mac to hold the maximum size of the VM).
    • Shut down the VM and run the command line utility vmware-vdiskmanager to shrink the virtual disk (NOTE you need enough disk space on your Mac to hold another copy of your virtual disk).
    • Manipulate the .vmx file to point to the shrunken virtual disk.. or use vmware-vdiskmanager to rename the old virtual disk and rename the new virtual disk to what the old one was.

    I'm not posting the exact steps here - my intent is to persuade you NOT to do this by pointing out the complexity. You can search the forums if you really, really insist that you want to do this.

     

     



  • 3.  RE: how to delete files in windows guest and free storage space

    Posted Mar 27, 2024 01:08 AM

    Even after emptying the Trash bin in Windows 11 the remnants are not really gone (that is why recovery of "deleted" files can still work). To write zeroes into the virtual disk of Windows 10/11 VMs, use the SDelete utility with the -z option. Note sdelete64a.exe is for arm64 so that is the one to use inside a Windows 11 ARM64 VM.
    https://learn.microsoft.com/en-us/sysinternals/downloads/sdelete

    For example:
    sdelete64a -z C:

    After running SDelete inside the Windows VM, the process of "Clean up" from Fusion settings would then work.

    Having said that, this concept of writing zeroes and compacting/reclaiming/cleanup space only works if there is no encryption on the virtual disk; whether inside the guest OS (such as BitLocker with Windows) or on the macOS host. To reclaim the space, the large chunks of zeroes (free space) are the parts that can be compacted/reclaimed; but encryption by definition mean that anything written (even a stream of zeroes) will have to be encrypted (i.e. even a stream of zeroes become non-zero value). Encryption also has the perverse effect of a virtual disk (and the space it occupies on the host) grow larger perpertually without any way to shrink it.

    It is better to use preallocated disk (regardless if there is encryption or not) so there is no regular chore that needs to be done to reclaim space.