April 18, 2008

Compact VHD (Virtual Hard Disk) of your Virtual PC

  1. Install dirms-s (http://www.dirms.com/home/download/dirms_service.asp) and run the "Compact" Command (get rid of the empty spaces between your data on HDD) alternative disk defragmenting software can also be used.
  2. Backup any critical data in the guest OS.
  3. Download Eraser, (http://www.tolvanen.com/eraser/) and install it in the guest OS. Alternative disk 'zeroing' software can also be used.
  4. Defragment the guest OS hard drive.
  5. Run Eraser in the virtual machine.
  6. Click Edit, then Preferences, then Erasing
  7. Select Unused Disk Space
  8. Select New
  9. Enter the description Blank
  10. Click Add
  11. Create a 3-byte pattern of zeros
  12. Click Save
  13. Select Blank under Unused disk space
  14. Click OK.
  15. Click File, then New Task
  16. Select Unused space on drive
  17. Select Local Hard Drives
  18. Click OK
  19. Select Task, then Run on the previously created task
  20. Wait for completion
  21. Close the report
  22. Exit Eraser.
  23. From your Virtual PC window, click CD -> Capture ISO Image.
  24. In the "Select CD Image to Capture" dialog, navigate to C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions and select "Virtual Disk Precompactor.iso".
  25. A popup window will show up asking you if you would you like to prepare the virtual hard disk(s) for compaction, select yes and let it finish. Note: if you don't see any popups, go to "My Computer" and double click your CD Drive.
  26. Wait for it to finish then Shut down your virtual machine.
  27. Open "Virtual PC Console (the one you use to manage all your virtual PCs).
  28. Click File-> Virtual Disk Wizard.
  29. In wizard, Click Next -> Edit an existing virtual disk -> select the VHD we just compacted and click Next -> Compact It -> Save the File As (just in case the compaction fails) and select a location for your VHD.
  30. Click Finish and it will compact your VHD.
  31. After process is done, make sure your settings file is pointing to the new VHD.


No comments:

Post a Comment