Friday, 22 May 2015 00:00

Expanding fixed virtual hard drive in VirtualBox

Rate this item
(0 votes)

b2ap3_thumbnail_iStock_000016678434XSmall.jpgThis article explains how to increase a virtual hard disk size in VirtualBox with guest OS Windows Server 2008.

Perhaps many of you are aware that dynamically expanding hard disk can be easily expanded:

% VBoxManage modifyhd PathtoImage.vdi --resize 50000

But sometimes it is not as easy as it would look like...---->

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.

Last modified on Friday, 22 May 2015 12:49
Data Recovery Expert

Viktor S., Ph.D. (Electrical/Computer Engineering), was hired by DataRecoup, the international data recovery corporation, in 2012. Promoted to Engineering Senior Manager in 2010 and then to his current position, as C.I.O. of DataRecoup, in 2014. Responsible for the management of critical, high-priority RAID data recovery cases and the application of his expert, comprehensive knowledge in database data retrieval. He is also responsible for planning and implementing SEO/SEM and other internet-based marketing strategies. Currently, Viktor S., Ph.D., is focusing on the further development and expansion of DataRecoup’s major internet marketing campaign for their already successful proprietary software application “Data Recovery for Windows” (an application which he developed).

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.