JonMifsud
Web Developer & Consultant

Increase VirtualBox Disk Size

11 August 2012

I've recently had the need to increase my VirtualBox Disk size, and I thought it would be useful for others to share my experience and provide a tutorial of how to increase your VirtualBox Hard Drive size; this way you spend less time searching around.

Having migrated from my Windows Setup to a brand new machine running Ubuntu, I've still needed to run some Windows Applications. Primarily Internet Explorer for website compatibility testing and run other applicaitons that are not supported on Linux such as Photoshop. For this reason I installed a copy of VirtualBox and popped in my previous Windows7 Disk for installation.

As is common practice I tried to put this the lowest size possible so it does not consume much of my SSD space - and I left the setting as recommended with 25GB. However as time went by I installed some apps and saved some stuff I soon noticed that this was hardly enough, so I needed to increase the size of the drive - as you probably want to do.

I've had a quick look online - first option was create another drive which is larger and clone... seemed too many steps for just a resize. So I dug into the VirtualBox manual and find a function that suits our needs, called modifyhd.

So now finally we can modify the options of our virtual hard drive and resize it to our needs. Note that this method only supports VDI and VHD drive formats.

Note: The below VirtualBox disk expansion steps were last tested on 20th August 2013, and works perfectly fine on Linux when your virtual box is a windows machine. Note that the steps might be slightly different if you have a different setup. I'd recommend doing a backup just in case, following this tutorial is at your own risk as I give no guarantees.

Steps to Increase your VirtualBox Hard Disk Size

  1. cd into the directory where your virtual drive is found (usually ~/VirtualBox VMs/{Your VirtualBox PC name})

    cd ~/VirtualBox VMs/Win7
    
  2. run the modify hd function with the new size (in MB) I choose 50GB (50 * 1024mb = 51200MB)

    VBoxManage modifyhd Win7.vdi --resize 51200
    
  3. VirtualBox will resize your hard drive and you will see the following output from the system indicating that the process is complete

    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    
  4. Now start up your Virtual Windows Machine. Right Click on 'My Computer' ('Computer' in newer versions) and choose Manage.

  5. Click on the Disk Management option on the left panel. You will notice some black space next to your C drive (this means the space addition was successful.)

  6. Right Click on the C drive and choose Extend Volume. Follow the wizard and you have successfully increased the size of your VirtualBox disk.

Once complete you have successfully Increased your VirtualBox Disk Size, and can now continue installing applications and software on your VirtualBox OS.

Written by Jonathan Mifsud

Jonathan Mifsud is a web developer by day and an SEO enthusiast by night. He provides freelance web development and consultancy services and is available for hire. You can get in touch with him on twitter and Google+

Comments

Leave a Comment
Nemo

Great tut! Thx :D

Reply

20 Jul 2014 @4:23pm

Mohamed

Awesome thanks.

Reply

25 Jun 2014 @11:08am

CaptainPackers

Thanks a lot. Saved me a lot of time.

Reply

19 Jun 2014 @10:16pm

Hamed

Thank you. Very helpful and easy to follow instructions.

Reply

05 Jun 2014 @10:21pm

Rahul

thanks a lot, it was very very helpful

Reply

28 May 2014 @10:37pm

Robert

I tried this on a Windows 8.1 machine. It appeared to run correctly, but when I launched the VortualBox and checked the disk, it did not show any additional disk capacity was available. I was not able to Extend the drive. Has anyone else found any issues with this on Windows 8.1?

Reply

09 May 2014 @3:40pm

Robert

Good News. After restarting everything. I created a new clone and attempted this again. I tried only 50 GB like your example and it worked. Not sure why it did not work on my initial attempts?

Reply

15 May 2014 @8:09pm

Eric

Great Help, much thanks. Had to use other procedure for OS X but still had to use the extension procedure in this page.

Reply

03 May 2014 @9:01am

Amit

When I go to my VirtualBox Settings >Storage it indeed shows that my vdi size is 20GB which is what I increased it to. However in my computer's disk management there is no black (unallocated) space next to my C drive, and thus I do not have the "Extend Volume" option... What should I do? I still can not work in my ubuntu environment because it gives me the same: memory usage at 100% issues... (OS = windows 7)

Reply

08 Apr 2014 @8:31pm

dhanas

Thanks! It worked fine without any problem on my iMac.

Reply

18 Mar 2014 @7:09pm

Tim

I did not have a great deal of luck with this even though the process is correct. I wound up exceeding hardware changes and invalidating windows7 as a guest on my linux box.;)

Reply

16 Mar 2014 @12:59am

Poppy

Great! Thanks for the writeup! Worked without a hitch!

Reply

15 Mar 2014 @11:26am

olpe

thanks a lot

Reply

24 Feb 2014 @10:58am

Samir

Just for the record, this works on Windows too. Another bit you should not miss is the fact that modifyhd only works on "dynamic format variant". It does not work on the "fixed format variant". If you are like me and you have a "fixed" format variant, then you will have to clone it first with the "clonehd" function. Only then will you be able to resize it (the clone, not the original) using the "modifyhd" function.

Complicated? Yes! Indeed! I'm just getting started with VirtualBox and I'm really frustrated. I'm not sure what to think about it. It has great looks and feel, considering the graphical style, layout, menus and navigation. But functionality is totally broken. Using it is a real struggle. It doesn't do fundamental things like clipboard sharing and drag & drop between a Windows host and a Windows guest.

So you have to install the Guest Additions first, and create a dedicated network share and then auto-mount it "permanently" (so it's mounted after a VM power down) to be able to exchange any type of data between the host and the guest. The drag & drop feature has been requested and is still in development for Windows for ages now. Right now I have a Windows 7 guest and it's not recognizing my Kingston USB flash drive. It doesn't find the drivers. It works effoertlessly on the host, and it's exactly the same Windows version and edition.

So VirtualBox may not be a good solution for the Windows guy. For Linux? Maybe... I haven't tested it yet. Resizing a virtual disk drive in this time and age should be a child's play. It should not be this complicated. VirtualBox needs a lot of improvement before it can compete with the big boys.

Reply

20 Feb 2014 @9:50pm

Peter Berkhout

Thanks for the pointer to clonehd. That worked for me too.

Reply

08 Apr 2014 @8:16pm

NewUser VM

Thank you very much!!!!!

Reply

19 Feb 2014 @2:22pm

Russ

This is the best (most clear, concise and complete) of several articles I read on this topic. Thank you!

Reply

15 Feb 2014 @6:20pm

Rick

2014 likes your blog from 2012 Immediately useful.

Reply

07 Feb 2014 @3:22pm

timoteo

but, in case when the virtual disk is ubuntu, i don't know how to let the system know that the disk is now extended, just like extending the volume with diskmanage on windows.

Reply

06 Feb 2014 @3:58am

Hellen

YOU ARE AMAZING!! this was so easy!! THANKS!!!!

Reply

03 Feb 2014 @4:59am

Dale

Nice to see a help file from someone that knows what he is talking about. Keep up the good work.

Reply

28 Jan 2014 @9:16pm

Junyoung Son

Thank you So Much!, I was having trouble for my dynamic virtual disk not growing without a reason.

Reply

21 Jan 2014 @11:03am

Rajinikanth

wow! the steps are cakewalk! so easy as breeze! i resized my virtual drive size just like that! it is really my cup of tea! thanks, thank a lot!

Reply

21 Jan 2014 @2:24am

Hugo

Nice, Just what I was looking for, Thanks!!!

Reply

17 Jan 2014 @8:35am

Suleman

Great just what I needed and needed it fast..!! Works like a charm.

Reply

16 Jan 2014 @7:47pm

lradnai

Good and useful article, but resizing VHD virtual disks this way may lead to CORRUPT VHD file. (no bootable media after resizing)

Reply

04 Jan 2014 @7:55pm

Martin F

Works great! Nice! Just to be on the safe side, I first copied my *.vdi to another HD. Thanks.

Reply

02 Jan 2014 @10:43pm

George Varghese

If you have multiple snapshots you have to first clone your VM with only the current state and then apply the VBoxManage modifyhd command to the cloned VM

Reply

30 Dec 2013 @5:50pm

Diego Munoz

Gracias de nuevo Jonathan!!!!

Reply

24 Dec 2013 @11:29am

marie

thanks, you rock. saved me a tonne of time!

Reply

22 Dec 2013 @6:02am

stanley baker

Great job! I had to copy the following files to the c:usersyourprofilenameVirtualBox VMsyour virtual machine name directory VBoxDDU.dll VBoxManage.exe VBoxRT.dll from the virtualbox installation directory - for me it was the following in Windows 7 Pro 64 bit c:Program FilesOracleVirtualBox Then the vboxmanage command successfully executed. Also remember to enclose your virtualbox image name in " " if you have characters that the command prompt (shell) doesn't like. I had to use the following 'cause I chose to create a name with periods in it (duh!) vboxmanage modifyhd "Windows 8.1 64 bit.vdi" --resize 51200

Reply

20 Dec 2013 @3:39am

Ashley

Brilliant - thank you - extra Karma points for you!

Reply

20 Nov 2013 @2:02pm

Andy

Awesome. Many thanks that I don't have to go through lengthy steps

Reply

13 Nov 2013 @3:53pm

Sands

Are the commands run on the Host or the VM's OS?

Reply

11 Nov 2013 @12:06am

dbldub

just under 2 minutes to follow this. over a year later and this is still helpful - thanks!

Reply

05 Nov 2013 @3:51pm

paran

what shoud i do if the guest is ubuntu?

Reply

05 Nov 2013 @11:06am

Lorenzo

I had a problem with Linux host and Win 7 (64) guest: The resizing operation would work, but Windows wouldn’t show the new unformatted space. After removing all snapshots, detaching the virtual disk in the Virtual Media Manager, doing the described steps and reattaching the disk it worked.

(The detaching step might or might not be necessary)

Reply

02 Nov 2013 @12:20am

Diego

thank you for share.

Reply

10 Oct 2013 @5:39pm

Kelvin

Awesome thank you!

Reply

29 Sep 2013 @8:56pm

Brian

Thanks for posting this and adding to Internet knowledge! You might want to note that it works best for Windows 7 and 8, though. When XP is the guest OS, the "Extend Volume" option is not there (according to my experience and several posters' comments). It looks like you can allocate the new space to a new partition, though. So XP guest users have the option of doing that, using gparted, or just making a new VM. In my case it's easiest to do the latter.

Reply

26 Sep 2013 @7:30pm

João Carvalho

Many Many Thanks Jonathan, help me a lot!

Reply

24 Sep 2013 @11:21pm

charith

Thanks works as same in OSX .

Reply

22 Sep 2013 @3:55pm

John

Perfect, even I don't find a solution in VirtualBox forum, but it is here. Super.

Reply

14 Sep 2013 @1:20pm

Svetoslav Pandeliev

Thank you very much! This tutorial was really helpful. Just to mention I use windows 7 64bit as a host and windows 7 32bit as the VM operating system. The steps work perfectly except I had to change the path to the Virtual Box installation folder ( OracleVirtualBox) and I also had to replace the vdi's name with its UUID. Everything else was exact. Regards

Reply

14 Sep 2013 @2:41am

Goliathuy

With the next command this works for vmdk, before you resize. VBoxManage clonehd "source.vmdk" "cloned.vdi" --format vdi Also remember as Adam said above, to release the hard drive before all this.

Reply

10 Sep 2013 @8:39pm

Sohaib Shaheen

Thanks a lot!

Reply

08 Sep 2013 @11:38pm

George

It worked great on Windows 7 host, Windows 7 guest. Thanks.

Reply

03 Sep 2013 @9:15pm

Weedov

Thank you, It helped a lot

Reply

24 Aug 2013 @9:08pm

Gopal

Thank you! It worked very well.

Reply

21 Aug 2013 @2:49pm

ramarao

it worked good

Reply

05 Aug 2013 @9:43pm

ali

On XP, I don't see "extend volume" option after right clicking C. Do I miss something in here? Thanks

Reply

28 Jul 2013 @3:32am

Kiren

I mounted the GParted iso, and resized the disk. This worked except I need to reactivate Windows now:/

Reply

25 Jul 2013 @10:54pm

Bruce Armstrong

Worked great with a Windows 8 image. Thanks!

Reply

20 Jul 2013 @6:22am

pcguru

Glad you don't take responsibility but you should at least WARN users that this procedure will not work on system drives (ie: C: drive) as it will create a non-bootable system.

Use procedure with caution!

Reply

17 Jul 2013 @12:26pm

Jon

Just to clarify when I've used this; I was on my ubuntu with an SSD, main drive, and extended a C partition for my Windows which could not take any more software.

I did not have issues; at the time, otherwise I would have noted this issue. It seems in some cases it throws errors, whilst I'd like to say exactly why I've never had to extend again since... otherwise I'd show a work-around.

Reply

17 Jul 2013 @8:06pm

phani

thanks, it worked after searching all blogs, this article guided me with right instructions.

Reply

16 Jul 2013 @1:31am

Alex

Thank you for great tutorial, it works fine!

Reply

14 Jul 2013 @1:58pm

Mike Irwin

Great tutorial - very clearly explained. However, you missed one point. If the drive being enlarged is the system volume then it will refuse to enlarge it.

Reply

14 Jul 2013 @2:26am

Scott

Worked great! I've tried several other guides and they all failed... Thanks!

Reply

11 Jul 2013 @1:59am

Dario Palumbo

Thank you man :)

Reply

09 Jul 2013 @10:32am

Andre Pakes

Thanks! This saved me a lot of time!

Reply

23 Jun 2013 @4:04pm

Sjoerd

This is indeed great. Managed to execute the commandline and the manager show that the drive on sata port 0 is bigger than before the action but in diskmanagement "Extend Volume" is grayed out. Any idea's

Reply

21 Jun 2013 @6:47pm

chris

THANKYOU!!!

Reply

18 Jun 2013 @4:30pm

Desmond

I discovered that if the resize parameter specified is smaller than original virtual size, it will gave error below which is misleading--resize XX

VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!

Pls take note.

Reply

18 Jun 2013 @8:51am

Jonathan Clough

Thanks, worked great for me. A quick way to get to disk management is Start-Run and diskmgmt.msc

Reply

16 Jun 2013 @11:34pm

bikermikem

Easy-Peasy. Thanks

Reply

05 Jun 2013 @8:50am

Paul

Second link on Google, worked like a charm, thanks a million.

Reply

03 Jun 2013 @5:17pm

Ducato

You are the man!

Reply

22 May 2013 @10:48pm

seunsmooth

Hello guys, thanks for sharing this . I know it is suppose to be a simple fix but some how I can get to run VboxManage on my Host (window 7 64bit) any idea on how I can fix this? thanks. error message is this : 'Vboxmanage' is not recognized as an internal or external command, operable program or batch file.

Reply

15 May 2013 @7:55am

Ed Tew

set path=%PATH;"c:Program FilesOracleVirtualBox"

Reply

21 May 2013 @11:49pm

Jacques

Thanks

Reply

14 May 2013 @6:28pm

John O

Thanks simple and Fast

Reply

13 May 2013 @5:35pm

Chris Strasser

Couldn't have been easier! After expansion, Windows 8 gave me the green light for disk space

Reply

03 May 2013 @10:21pm

vipin

thanks man

Reply

01 May 2013 @10:56am

Justin

Thanks for the info. Saved me a lot of time.

Reply

23 Apr 2013 @6:19pm

Beau Lebens

This is perfect, thanks for the super simple solution. My VM was basically unusable because Windows had eaten all the space, but now I can just add enough to keep it going, without eating into my main machine too much. Cheers!

Reply

20 Apr 2013 @12:03am

jay

absolutely brilliant and simple, thanks a ton!

Reply

15 Apr 2013 @8:37pm

SR

Thanks, this was very helpful.

Reply

02 Apr 2013 @5:31am

Marcus Smeeth

Thanks so much. It worked great on my mac running XP over virtualbox. Like the user above I then added a gparted ISO to the virtual CD drive which handled extending the active partition. Thank you for making it so straightforward.

Reply

30 Mar 2013 @12:08am

Bill

Great! Can't wait to try it, but I will have to srart over because I chose the hdd format (thinking it would save me a step when I try Parallels...

How did you find out that this method only works on vdi or vhd formats? I would like to find out why that is.

Thanks for a great article.

Reply

14 Mar 2013 @1:36pm

Joe

Simple guide, very effective! Worked perfectly for me thanks :)

Reply

12 Mar 2013 @6:36am

Ben

Thanks, very helpful!

Reply

27 Feb 2013 @6:51am

name...

if anyone runs into problems like this: VBoxManage.exe: error: Could not get the storage format of the medium 'C:blablabladisc.vdi' (VERRINVALIDNAME) VBoxManage.exe: error: Details: code VBOXEIPRT_ERROR (0x80bb0005), component Medium, interface IMedium, callee IUnknown VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp

Then I fixed it by supplying UUID instead of vdi's name and path. So the command "VBoxManage modifyhd Win7.vdi --resize 51200" would become "VBoxManage modifyhd UUID --resize 51200" To find out the UUID of the virtual disc I used command: "VBoxManage list hdds"

Reply

21 Feb 2013 @3:38pm

Mauricio

This tip is brilliant. I previously increased the size of my VM by using the trick of copying the whole partition to a new VM.

It saved me considerable time. Thanks.

Reply

20 Feb 2013 @2:18am

siva

Thanks worked as mentioned. This was on the host windows 2008 server with a windows 7 64bit VM. Note: 1) was required to add VBoxManage to path otherwise windows did not understand the command line. 2) was required to add full file path to the vdi file within quotes ( i think because my file name had spaces) e.g

VBoxManage modifyhd "C:UsersstVirtualBox VMsEEC-windows7 (64bit)EEC-windows7 (64bit).vdi" --resize 51200

Reply

18 Feb 2013 @12:19pm

seunsmooth

Thanks ! I remembered I changed the directory location of Virtual box installation. I have been able to resolve the issue by changing the path. Regards.

Reply

15 May 2013 @1:12pm

Adam

Following I got the error:

VBoxManage: error: Cannot register the hard disk '/home/adder/VMs/WinTest/WinTest.vdi' {09181a4d-9949-4f77-92dc-b3e5e187d1a3} because a hard disk '/home/adder/VMs/WinTest/WinTest.vdi' with UUID {09181a4d-9949-4f77-92dc-b3e5e187d1a3} already exists

Before running the VBoxManage command I needed to go into the "Virtual Media Manager" and release the hard drive and remove it from the list. Once I had done that and run the VBoxManage command I just needed to add the attachment again from the storage settings for the actual VirtualBox client

Reply

05 Feb 2013 @12:00pm

Jeff

I had to do this as well. Thanks for this info.

Reply

07 Jul 2014 @9:49pm

Alf

Very good advice, saved me sheds loads of time

Reply

05 Feb 2013 @10:02am

Keith G

This worked perfectly on Mac OSX 10.8 host with Win7 32bit VM. I first copied my .vmdk to .vdi, then used these steps. Thank you!

Reply

01 Feb 2013 @9:25pm

Murilo Alan Koprovski

Thank's. There are a lot of "tips" to do the same, but what you share is simple and fast.

Reply

25 Jan 2013 @6:48pm

Anjou

Same error message as Deepak - Error: "FATAL: No bootable medium found! System halted". Cannot resize back to smaller size. Lucky I can delete and start again. Make a backup just in case you have the same problem! This was with Win7 host and Win8 Release Preview guest OS.

Reply

08 Jan 2013 @3:49am

Curtis

You are the king! Thanks!

Reply

03 Jan 2013 @12:21am

Steve

It is worthwhile noting that if you have any snapshots it is best to clone the current state before increasing the size of the hard drive as otherwise you will find the size of the hard drive misreported.

Reply

02 Jan 2013 @2:47pm

Deepak

with Win7 after 3rd step it looses the booting sectors Error: "FATAL: No bootable medium found! System halted" Please advice

Reply

28 Dec 2012 @7:36am

Jon Mifsud

Did you make sure that your drive is larger then it was & that you have enough space? Also you were using Win7 as the VM or your main operating system? if so what is your OS

Reply

31 Dec 2012 @12:44pm

daniel

thanks, fast and clean!

Reply

27 Dec 2012 @9:49pm

Christopher

Thanks. I had to boot Linux and use GParted to extend the partition, though. I was running Windows XP as the guest.

Reply

19 Nov 2012 @8:54pm

Post a new Comment

Please write your name.
Please enter your comment
Please enter your email address.