(They get bloated and consume more space than necessary)
Now I'm using VirtualBox for a personal SQL Server test environment, here is how to do the same for VirtualBox drives.
Compacting a VirtualBox Drive
- Delete rubbish from your virtual machine (clear temporary internet files, windows installer files, unwanted data, empty recycle bin etc)
- Defragment the drive (Use the OS’s defragmenter or third party FREE tool Defraggler)
- Zero out the unused data space in the guest OS
You have 2 options here -
i. Use Precompact.exe (details in Hyper-V post) or
ii. Use Microsoft’s SDelete e.g. SDELETE –c C: (a lot simpler)
- Shrink the hard drive file from the host OS using VboxManage.exe
vboxmanage modifyhd filename.vdi compact
I found that Vboxmanage only runs from it’s install directory (dependency on DLL files) hence run it from there, e.g.
C:\> cd C:\Program Files\Oracle\VirtualBox
C:\Program Files\Oracle\VirtualBox> VBoxManage modifyhd c:\!RD\Virtualbox\w2003.vdi compact
Resources
http://www.dedoimedo.com/computers/virtualbox-shrink-expand-disks.html
http://www.plinky.it/blog/2009/05/18/virtualbox-compact-the-vdi-hard-disk-file/
No comments:
Post a Comment