Share via


How to compact my virtual disk?

Steps at guest machine:

1. Empty ddlcache folder

sfc.exe /cachesize=1

reboot machine

sfc.exe /purgecache

2. Delete log files

Del *.log /s

3. Empty Update folder

C:\Program Files\WindowsUpdate

4. Empty Services Pack folders

%windir%

5.  Empty Drivers.cab folder

%windir%\Driver Cache\i386

6.  Empty %temp% folder

7. Empty Recylcle bin

8. Turn off System Restore, hibernation,

9. Disable prefetcher

run "regedit"
goto [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters\EnablePrefetcher];
Set the value to either 0-Disable.

10. Empty recycle bin

11. Disable pagefile

My computer à Properties à click ‘Advance’ tab à under performance, click ‘Settings’ à click ‘Advance’ tab à under Virtual Memory, click ‘Change’ à select ‘no paging file’ à click ‘OK’

12. Defragment your virtual disk

All Program Files à Accessories à System Tools à Disk Defragmenter

13. Run Virtual Disk Precompactor

At Virtual Machine window, go to menu bar, CD à capture ISO image à browse to “C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions” select Virtual Disk Precompactor.iso

14. Close your virtual machine [remember to save the changes and commit to your virtual disk]

Steps at host machine - Run virtual disk wizard

1. Launch Virtual PC console

2. Select the virtual machine

3. Click ‘Settings’

4. Select ‘Hard Disk’ at the left panel

5. Click ‘Virtual Disk Wizard’, this will launch the wizard

6. Click ‘Next’

7. Select ‘ Edit an existing virtual disk’

8. Click ‘Next’ and browse to the virtual disk you want to compact, click ‘Open’

9. Click ‘Next’

10. Select ‘Compact it’ and click ‘Next’

11. You have the option whether to replace original virtual disk or save it in another file

12. Click ‘Next’

13. Click ‘Finish’ and start the compaction

14. After compaction, just use any zip tool to zip your virtual disk for storage