Page 1 of 1
Shrinking Windows VM
Posted: 20. Jun 2014, 11:39
by Sagypt
Hi, these are steps I follow to shrink a Windows XP VM(*)
1) Defrag the hard disk (of VM) with Piriform Defraggler
2) Fill with 0 the free space of the hard disk (of VM) with the command SysInternals sdelete
3) Shrink the VM with the command VBoxManage modifyhd --compact "/PATH/VMNAME/VMNAME.vdi"
Is this a correct way? There's a better way?
Thanks
(*) the VM is a template for others VMs which I use for testing software
Re: Shrinking Windows VM
Posted: 20. Jun 2014, 12:51
by mpack
If you compacted with
CloneVDI then you could skip the zero-fill and VBoxManage steps. This would make it much, much faster. CloneVDI will also reorder the image blocks into linear order.
Defragging the disk probably isn't worthwhile either. It probably gets you an additional few percent the first time you did it, and even less thereafter. Occasional defragging is a good thing, but I wouldn't do it for this purpose. Perhaps you should do a comparison next time, my suggestion vs your current method.
Re: Shrinking Windows VM
Posted: 20. Jun 2014, 13:05
by Sagypt
Thank you for your suggestion
mpack wrote:
... Perhaps you should do a comparison next time, my suggestion vs your current method ...
I'm not interested to benchmarking. I shrink the template VM occasionally.
Re: Shrinking Windows VM
Posted: 20. Jun 2014, 15:25
by mpack
Benchmarking was not mentioned. The suggestion was about how you might go about testing whether your additional steps bring sufficient rewards in terms of compaction, in case you doubted my hypothesis that they don't.
Are you saying that you perform this task so rarely that you don't care about efficiency? If so then why ask the question?
Re: Shrinking Windows VM
Posted: 20. Jun 2014, 16:35
by Sagypt
mpack wrote:
Benchmarking was not mentioned
It's true, I have not been precise
mpack wrote:
Are you saying that you perform this task so rarely that you don't care about efficiency? If so then why ask the question?
Only curiosity!
Thank you again