分类: Oracle
2015-05-26 16:31:57
After performing a quick search on how to manipulate an existing VDI file, I found a bunch of lengthy guides, all pretty much saying the exact same thing… create a new VDI, load the old and new VDI disk images into a Virtual Machine as a master and slave drive, boot with a gParted or equivalent BootCD image, and then clone the old disk to the new one… or in short: do a lot of steps that take forever, but not what I want: Resize VirtualBox Disk Image.
After flipping through the 10th or so guide, I realized that pretty much all of them were written in 2008… very unusual as bloggers usually write about the same subject on a yearly basis. That in mind, I search a bit more and… BINGO! Since VirtualBox 4 is out, there is a simple command line tool to resize VDI images. Man, those extra 5 minutes of searching just saved me from a lot of hassle and a huge waste of time.
Since I want to pass on this crucial bit of information, I hope mentioning that this article is about how to resize VirtualBox Disk Image in 1 Minute! will help to put this post up on the first page in google for people searching for this simple solution, and don't think they have to go through all those steps mentioned in other guides on how to change the size of a vdi disk image file… your help in spreading the word about this article featuring a super easy way to resize VirtualBox disk image is very much appreciated
This is for VirtualBox running on Linux, Mac, and Windows. I found the Mac solution in the comments, and there may be some more tips I may have missed to add here.
HERE WE GO:
Using Windows as a Host
Open the command prompt and enter:
# C:\Program Files\Oracle\VirtualBox\VboxManage.exe modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
Using Mac as a Host
open a Terminal session (not sure if that is what it is called in Mac, hehe) and type:
# /Applications/VirtualBox.app/Contents/MacOS/VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
Using Linux as a Host
open a Terminal session and type:
# VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
And that's already all there is to it… I just wish they would include this in the GUI.
Should you be using a VirtualBox version older than VirtualBox 4 and are looking for a way to resize a VDI VirtualBox Harddisk file, here are the articles I flipped through but luckily did not have to follow:
http://blog.markloiseau.com/2010/05/expand-vdi-virtualbox/
Source of the easy way:
This post has been viewed 118031 times!