However, this trick won’t work with fixed size disks.
In order to expand the disk you need to perform the following actions:
Stop virtual machine, go to its properties. Go to Media and add new hard disk. You must select Dynamic virtual disk, set the size you need.
After hard disk is created make it second during boot (i.e. Windows should boot from the old disk) and then turn the VirtualBox back on.
Install a great freeware program SelfImage in virtual environment and launch it. Select type Drive in Input field and in drop-down list select the first hard disk (on which Windows is installed), should look something like this “DeviceHarddisk0 (entire disk).” Then in Output field select type Drive and in drop-down list select the second disk (the one we have just created), should look something like this “DeviceHarddisk1 (entire disk)” and then press Start.
Program will copy the first hard disk to the second byte-by-byte. After copy is over turn on virtual machine, go to its properties, go to media and remove old hard drive from the list and, just in case, set port to 0 for the new hard disk (for SATA).
After that, turn on the virtual machine. If everything was done correctly, Windows will boot properly but will show old size of hard disk. The only thing left now is to expand partition size. For that launch cmd, type diskpart. Then type the following:
DISKPART> list volume – see the partition you need
DISKPART> select volume 1 – select the partition with Windows (mine was 1)
DISKPART> extend – give command to expand
DISKPART> list volume – make sure everything is OK
After that, hard disk size will become the size you need.
Next time when you need to change disk size, simply type the following in the host machine:
% VBoxManage modifyhd PathtoImage.vdi --resize 100000
indicate size in Megabytes.
Then boot and again repeat actions with diskpart.