Stuck with your small virtual disk partition for VirtualBox? You created for some testing & practicing, now it needs space. I also stuck with same problem; researched many forums, and here is the gist.
[Note: This procedure won't work for VM with snapshots. So, please take note about your system beforehand.]
- Download Gparted, disk manager for Linux. It'll come as an ISO file.
- Boot into your guest OS, check, with df command, which partition you need to grow. Take note of that specific mounted HD, such as /dev/hdb/sda3
- Take backup of your existing data, as I WILL NOT TAKE ANY RESPONSIBILITY IF YOU DAMAGE YOUR DATA.
- In host OS, Goto the command prompt by running, cmd.exe
- Navigate to the Virtualbox installation folder
- Execute command:
VBoxManage modifyhd X:\yourVM_DiskPath_InHost\yourVM_Disk.vdi --resize 40960
you will see progress as below:
If you fail with message like
"VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!"
you need to use this tool CloneVDI.exe from this VirtualBox forum-post. If using this tool, remember to check "Increase virtual drive size to " with your desired size.
- Now, Load the ISO file to the CD/DVD drive of your virtual Linux.
- Boot the Guest OS; from the boot menu, select CD/DVD drive, then it will be booted in GParted tiny OS. Now the PartitionManager tool will come up automatically, like below:
- Now "shrink/Grow" or "Move" your desired partion, but be careful. Don't rename any of them. Be careful about your data.
- Don't worry, unless you clicked Apply, nothing has happened really. When you are done with moving and resizing, you have to click
Applyto commit the change
- when completed, close Gparted, and then shutdown the OS
- Unload the ISO aka virtual CD from virtual OS
- Boot into the virtual OS again
- Now, check that if the desired partition grew or not by df command
Thanks for visiting my blog. If it just helped it, please feel free to "Like" or "share". Also, your suggestion or comment would be greatly inspiring.
You may also like to encourage me by buying me a coffee.