Increase the size of a Virtualbox hard drive (.vdi)
The following entry is based on this post.
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?
.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
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.