I usually have one Windows available in hand in a VM. Knowing windows, it would eat all the hard drive you dedicate to it. So at the setup time I decided to give it a flexible size but maximum of 25GB, which seemed fair for Windows 7. But now that I have had it for a while it got quite big and when I wanted to install a new application, I was running out of space.
Extending an existing drive is not possible, but the whole process to achieve what’s needed is very very simple. All you need to is:
- Go to VM’s setting / storage and create a new bigger storage, which would be your only HDD
- clone the hard drive from the old one to the new one. Here is the VirtualBox’s command:
$VBoxManage clonehd /Path/to/old/Windows7.vdi /path/to/new/Win7_30GB.vdi --existing
- Now remove the HDD from your existing VM. (VM/Setting/Storage)
- Add your new HDD to the VM.
- Boot the VM
- In the guest OS, go to “Control Panel/ Administrative Tools/ Computer Management/ Storage” and you should be able to see the extra space as unallocated. Just extend the existing drive to the maximum to use it
Enjoy your extended HDD.