One of the major problems users of Virtual Machines face is how to expand the hard disk of their machines when it gets filled up. For this write up, we will be referencing VirtualBox
Please note that the hard disk must have been created dynamically.
- Shut down your Virtual Machine.
- Locate the installation folder for Virtualbox on your system, usually C:\Program Files\Oracle
- Hold down the SHIFT button and right-click on the Virtualbox folder, select “Open Command Window Here”
- Copy the following line of code into the command line window;
VBoxManage modifyhd “Windows 7.vdi” —resize 50000
- replace Windows 7 with the name of your virtual Machine and 50000 with the desired size (in MB) that you want your VM size to be.
- The above command assumes your VM is in the following folder; C:\Program Files\Oracle\VirtualBox\. If you are like me and you store your VMs in a different location, you need to specify the exact location like so;
VBoxManage modifyhd “C:\Users\Wale\Documents\VMs\Windows 7\Windows 7.vdi” —resize 50000
- You will see the following on your screen;
- The additional space is not yet visible. So far, what you have done is to add an adjoining unallocated hard disk space to your VM hard disk space. To have access to the additional hard disk space;
- Boot up your VM, go to your control panel – Administrative tools – Computer Management
- In the left pane, under Storage, click Disk Management
- Right Click on your drive, Select “Extend Volume”. Wait for a few seconds, then you are done.
- Your VM hard disk is now 50,000 MB (50GB)