Microsoft Dynamics AX Developer Center Headlines

My Card

Saturday, February 27, 2010

Virtual Box (.vdi) image optimization

About Virtual Box:

Virtual box is a virtualization product developed by sun micro system. You can create a 64 bit guest machine and host it on a 32 bit OS using virtual box. For more information on virtual box visit: http://www.virtualbox.org/

Optimize Image

Below steps explain the required procedure to compact the size of a virtual box image (.vdi).

  1. Zero free space in .vdi image:

    The first step in the optimization process is to free up the unallocated space from the image. You need to follow below mentioned steps for the same:

    1. Start the virtual box image.
    2. Download the SDelete tool from http://download.sysinternals.com/Files/SDelete.zip & extract it to a folder say C:\SDelete drive in the image.
    3. Run the command prompt and type following command to run the SDelete utility:

      sdelete –p 3 –c C:

      Note: If you have multiple drives then run the utility for both of the drives. For more information on SDelete utility visit: http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx

    4. Shut down the virtual box image.
  2. Compact Virtual Box image:

    Second & final step in optimization process is to compact the virtual box image size using VBoxManage utility. VBoxManage utility can be found at the installation folder of virtual box usually "C:\Program Files\Sun\VirtualBox".

    1. Run the command prompt and run the following command:

      C:\Program Files\Sun\VirtualBox\VBoxManage modifyhd "D:\Virtual Box\Server.vdi" –-compact

    2. You will get the optimized virtual box image after this step. Notice that you will be able to free up some good amount of space from the imageJ.