Archive

Posts Tagged ‘partition manager’

Increase the size of a Virtualbox hard drive (.vdi)

August 3, 2012 Leave a comment

The following entry is based on this post.

Problem
I have a Linux host with a Windows 7 guest. The hard disk of the Windows guest was set to 30 GB but it got full. How could I extend its size to 40 GB for instance?

Solution
Locate the .vdi file of the virtual system. To be safe, make a backup copy of it. After that you can increase its size:

sudo VBoxManage modifyhd Windows7.vdi --resize 40000

Here Windows7.vdi is the name of my .vdi file and 40000 is given in megabytes, which is roughly 40 GB.

Now, if you boot the system and you verify the size of the C: drive, it will still be the old value. The increased size appears as a new unformatted and unused partition. You can join it with the C: partition the following way:

Go to the Control Panel, then System and Security, then Administrative Tools. Here you will see an icon called Computer Management. Start it. Choose Disk Management on the left side. Right click on drive C: and choose “extend volume“. It will be extended in a second. Done.

Update (20140427)
You can also start the Disk Management tool with the command diskmgmt.msc .

Update (20200415)
Under Windows 10 I ran into an issue. With VBoxManage I could increase the size of the virtual hard drive, and the extra space appeared as a new partition. However, Windows 10 has a recovery partition that was between the C: partition and the newly created free partition, thus I couldn’t join them.

I found the solution here: https://www.diskpart.com/windows-10/windows-10-move-recovery-partition-4348.html . In short: install the AOMEI Partition Assistant, which is a free partition manager. With this you can move the recovery partition after the newly created free partition, and then the C: partition and the newly created free partition can be merged. It worked flawlessly, but I highly suggest that you make a backup before this operation.