misheska / basebox-packer

Packer templates for vagrant baseboxes
286 stars 80 forks source link

Compact and defrag Windows baseboxes #63

Closed misheska closed 10 years ago

misheska commented 10 years ago

Good tip: https://github.com/joefitzgerald/packer-windows/pull/53 Because Windows defrag.exe can't be used usefully in a script, using ultradefrag instead, plus Sysinternals sdelete tool to zero free disk space

rasa commented 10 years ago

I can tackle this, OK?

misheska commented 10 years ago

Awesome - thanks!

On May 4, 2014, at 11:01 PM, Ross Smith II notifications@github.com wrote:

I can tackle this, OK?

— Reply to this email directly or view it on GitHub.

rasa commented 10 years ago

Not much of a savings, but I will push the PR anyway:

Type compression level defrag/sdelete Box size Savings Savings %
Virtualbox 9 No 3,461,576,057
  9 Yes 3,440,302,615 21,273,442 0.6%
VMWare 9 No 3,649,477,183
  9 Yes 3,512,013,554 137,463,629 3.8%

For comparision:

Type compression level defrag/sdelete Box size Savings Savings %
VMWare 0 No 8,251,264,512
  0 Yes 8,122,551,808 128,712,704 1.6%
rasa commented 10 years ago

BTW, I added

      "vboxmanage_post": [
        ["modifyhd", "output-virtualbox-iso/win7x64-enterprise-disk1.vmdk", "--compact"]
      ]

during testing, but it didn't seem to affect the output much, if at all, so I didn't include it in the PR.

misheska commented 10 years ago

Thanks for putting the effort into testing the compression level scenarios - that's really helpful. Looks like VMware/VirtualBox are doing a much better job at minimizing disk space. I normally do a clean up, defrag inside VM, then defrag outside the VM by habit. Looks like the most bang for the buck will be to automate the "clean up" step (where it deletes all the temporary files and stuff), instead of focusing on defragging and zeroing out free disk space.

misheska commented 10 years ago

And in a similar vein, making lite images - low hanging fruit is RTSe7enLite for Windows 7: http://www.rt7lite.com/