Views:

Procedure

  1. Uninstall unnecessary applications and optional Windows components.
  2. Run Disk Cleanup to free up space on the hard disk.
    The utility searches for files and data that you can safely delete, including:
    • Temporary Windows and Internet files
    • ActiveX controls, Java applets, and other downloaded program files
    • Files in the Recycle Bin
  3. Use Deployment Image Servicing and Management (DISM) to free up space on the hard disk.
    DISM is a command-line utility that can be used to free up disk space by managing the Windows Component Store (WinSxS directory).
    1. Open a Command Prompt window.
      Note
      Note
      Depending on the Windows version, not all of the following commands may be supported.
    2. Type dism /Online /Cleanup-Image /SPSuperseded.
    3. Type dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase.
  4. Download SDelete and then zero out the free space on the hard disk.
    SDelete is a free command-line utility that securely deletes existing files and permanently erases file data in unallocated clusters of a disk. The utility can also ensures that even encrypted files cannot be recovered by overwriting all addressable locations with new and random characters.
    1. Download sdelete.zip from the Windows Sysinternals website: https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx
    2. Extract sdelete.exe.
    3. Open a Command Prompt window.
    4. Go to the folder that contains sdelete.exe.
    5. Type sdelete -z [drive letter].
      SDelete zeroes the free space on the hard disk.
  5. Shut down the virtual machine.
  6. Open a Command Prompt window on the host system.
  7. Type "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd [path\[vm_name.vdi] --compact.
    The virtual hard disk drive size is reduced.