Recently I ran out of space on one of my Windows virtual machines. I needed to increase the size of the disk to allow me to install some new software. When creating the VM I had created the disks as VMDK. Yes I know now that is not the best format to use 😦 VMDK disks/files do not allow you to dynamically change their size 😦 So what can you do? Is it possible in any way? If so how? Well this is what I did (after a bit of research using the google and StackOverFlow.
- Make a copy of the vmdk file on the OS. Just in case anything happens! (always have a backup)
- Clone the vmdk disk file into vdi format. To do this you need to use the VBoxManage command/app to clone the file into a vdi formatted file. For example this is what I ran.
VBoxManage clonehd “Win7-188.8.131.52-ORE-03-Jan-14-disk1.vmdk” “cloned.vdi” –format vdi
- There was some suggestions that you could then clone the vdi file back into vmdk format. This did not work for me. It kept on giving me errors when the cloning process was nearly finished. After a bit of time researching this I wasn’t able to find a solution to fix this. Instead I did the following
- Replace the vodka disk/file with the vdi disk/file in my VirtualBox VM. Open VirtualBox, select the VM and then click on the Storage section. In this I was able to add the new vdi disk/file and then removed the old vodka disk/file.
- Start up the VM. The VM starts up as normal and everything works OK.
- To allocate and make the extract space useable you need to allocated the new space to the c:\ drive. To do this I did the following:
- Click on Start Button, then right click on Computer and select Manage from the drop down menu.
- In the Computer Management console select Disk Management. A screen something like the following appears shows the amount of allocated and unallocated disk.
- Right click on the area for the c:\ drive and select Extend Volume from the drop down menu.
- Select all the defaults are you go through the Wizard to Extend the Volume. When you are finished the c:\ drive will be extended with all the extra space, as shown below.
- All done. You now have a larger disk/drive for your Windows VM.