Increase Virtual Box VDI disk size on MAC or Windows

Need more space on your Virtual Box disc? I installed Windows 7 on Oracle Virtual Box but didn’t estimate the size of disk correctly. The drive is now nearing it’s capacity, how do you extend the size? It will take the following steps to achieve an extended disk capacity:Рудбекия

Let’s go each step in a bit of detail now.

2. Clone the old disk to this new disk – the idea is that the bigger new disk receives a disc copy of the old one. Use the following command for this (assuming Oracle VirtualBox is installed at C:\VirtualBox on your machine, otherwise navigate to the appropriate directory first):

Note: Use full path with [OldHDDFile.vdi] and [NewHDDFile.vdi]. It can take few minutes for the Clone process to complete.

3. Disconnect the old disk via storage settings in Virtual Box

Rating:
52.0
326 votes
1 2 3 4 5

77 Responses to “Increase Virtual Box VDI disk size on MAC or Windows”

  1. Mike said:

    Sep 25, 15 at 9:25 pm

    Hi, many have struggled with this, so I created a video tutorial that shows step by step how to successfully resize a Fixed .vdi drive. Here is a summary of each step I walk you through.

    http://apptutor.com/courses/how-to-virtualbox-video-training-course/lectures/413794

    01 Introduction – Yes you can re-size a fixed VDI drive
    02 Review 6 Steps to re-size successfully
    03 Release and remove (don’t delete!) the Fixed VDI Drive you want to re-size.
    04 Use command line CMD (run as administrator) Navigate to VboxManage Directory.
    05 Clone the drive with VBoxManage clonehd.
    06 Resize the VDI Drive with modifyhd.
    07 Start Virtualbox, add new cloned VDI drive and extend partition.
    08 If your OS does not have a Partition tool what can you do?

    Thanks,
    Mike

  2. I.G. Romov said:

    Mar 13, 15 at 2:03 am

    Followed the directions and it worked justa fine. @apu well, maybe for MACers but not yet implemented for Windows so clone is only way to go and is just about as easy.

  3. Masoud said:

    Mar 01, 15 at 10:12 pm

    You are fantastic. Very helpful.
    Note that for fixed size VDI disks, as I tried many ways, theres is no way working except the way described here.
    Thanks again.

  4. Masoud said:

    Mar 01, 15 at 10:11 pm

    You are fantastic. Very helpful.
    Note that for fixed size VDI disks, as I tried other ways, theres is no way but just the way described here.
    Thanks again.

  5. Apu said:

    Jan 14, 15 at 9:58 pm

    There’s actually an even easier way:
    VBoxManage modifyhd [myvm.vdi] –resize 50000

    See here for details:
    http://www.dracata.net/2013/04/resizing-a-virtualbox-vhd-or-vdi-file-on-mac-os-x/

  6. weight loss solutions said:

    Oct 17, 14 at 11:48 am

    Pretty! This was an extremely wonderful post.

    Thank you for providing this information.

  7. arif ahemad said:

    Jul 14, 14 at 6:27 am

    I have to make a part at I on of my d disk then I delete the volume when I try to create a new volume they said there is not enough space available in disk
    Please help me how can I do

  8. Peter G said:

    Jun 04, 14 at 8:18 pm

    Worked just as described. Thanks!

  9. Kostas said:

    Feb 26, 14 at 1:25 pm

    Thanks you for this information. However I would not have been able to complete the operation without this last step:
    http://derekmolloy.ie/resize-a-virtualbox-disk/#comment-27639

  10. Sathyavrathan PK said:

    Dec 12, 13 at 5:02 am

    Thank you very much, it worked well for me.

  11. Hanz said:

    Dec 03, 13 at 12:41 pm

    Hi, I was following step above, it worked perfectly. But when I boot the Virtual Machine, again it popped out Low Disk Space. I was wondering how the step 6 can be done?

  12. Mike Scott said:

    Nov 14, 13 at 5:17 pm

    FWIW:

    I just resized my .vdi successfully. Host is Win 7 and the CMD window was too narrow to let my type in the longish paths of both the vboxmanage parameters, so I put this

    ***
    “c:\program files\Oracle\VirtualBox\vboxmanage.exe” modifyhd “c:\Users\Mike\VirtualBox VMs\Win 8\Win 8.vdi” –resize 50000
    pause
    ***
    into a batch file I named batch.bat and ran it simply by double-clicking. The advantage of “pause” is that you get to see any error messages.

  13. Finn Virtualizer said:

    Nov 13, 13 at 6:40 pm

    I tried a video on youtube but it didn’t worked for me. Your advise worked perfectly!!!

  14. Khalid said:

    Oct 31, 13 at 5:32 pm

    This worked. Many thanks.

  15. knng said:

    Oct 29, 13 at 10:03 pm

    Gunter Meynen is perfect replier :)) did like he mentioned. thankss

  16. Leon said:

    Oct 07, 13 at 7:15 pm

    Great note!
    Thank you very much

  17. Wey Asey said:

    Sep 26, 13 at 8:03 am

    This was successful for me using a Linux(Fedora) host and Windows 7 virtual machine.

    Done everything as in tutorial but the HDD clone was done with the commands below:

    Find your Virtualbox folder type in root terminal: locate virtualbox | grep -i VBoxManage

    cd /usr/lib/virtualbox

    [root@mylinux virtualbox]# VBoxManage clonehd /OldHDDFile.vdi /NewHDDFile.vdi –existing

    Find path to virtual disks type: locate Win-7 | grep -i .vdi

    Win-7 being the name of my Virtual Machine change that to the name of yours [] or “” was not need for the paths to virtual disks.

    Hope this helps you with your issues, good luck.

  18. Padraig said:

    Sep 23, 13 at 6:18 pm

    Great help, thanks!

  19. Javi said:

    Sep 12, 13 at 5:56 pm

    Y-o-u a-r-e t-h-e b-o-s-s. In spanish: E-r-e-s e-l p-u-t-o a-m-o. You’ve saved a lot of time for me! Thanks from Spain.

  20. Kevin said:

    Aug 22, 13 at 9:03 pm

    XP wouldn’t let me resize the drive. didn’t think about it at the time but this may have been because it was active and in use? either way, my solution to combining the extra space with the current partition was to attach the bigger vdi to a linux OS (slitaz) and use gparted to resize the main partition. (had to unmount it first though).

    thanks for the post!

  21. Kanzler DE said:

    Aug 17, 13 at 12:03 am

    It didn’t work for me. Maybe because my disk was not dynamically allocated.

    So I did the following:

    1. I’ve created another virtual disk as mentioned above
    2. Started the machine (Windows 7, in my case)
    3. Clicked on Panel Control > Administrative Tools > Computer Management.
    4. Activated the new found virtual drive. So it’s like a second partition.

    That’s the only way it works for me.

  22. Foon said:

    Aug 15, 13 at 5:17 am

    In the command line, you need to enclose the path and name of the old and new .vdi filenames in double quotation marks, not square brackets as shown in the example.

  23. Brad said:

    Aug 09, 13 at 11:45 pm

    Perfect!

    Note that the script should be WITHOUT the brackets, this worked for me:

    “VBoxManage clonehd W7.vdi NewDrive.vdi –existing”

  24. HeyAdmin said:

    Aug 02, 13 at 12:48 am

    Perfect. Thanks.

  25. Gunter Meynen said:

    Jul 18, 13 at 6:02 am

    There is a 2nd (and easier) way to do it.

    http://www.youtube.com/watch?v=VqK3cDLiMJU

    Grtz

    Gunter

  26. Petr said:

    Jul 17, 13 at 2:25 pm

    Worked for Centos 6.4. and VBox 4.2.16.

  27. Mirco said:

    Jul 16, 13 at 5:08 pm

    Thanks man, saved my day(s)!

  28. Adrian said:

    Jul 11, 13 at 11:46 am

    I created the new VDI (100gb), clonehd’d the old to the new, removed the old, added the new, booted Ubuntu. All my files were gone. Haven’t got a single one of them on the clones HD 🙁

  29. Sandip said:

    Jul 08, 13 at 10:49 pm

    This doesn’t work!! In the last step, when I attach the new cloned VDI image and boot Ubuntu, it uses the old size and not the extended disk size. When I go to Windows Disk MAnagement, there is no option to find and “expand” the newly created partition. I’m using Windows 7 host and Ubuntu guest (latest version).

  30. Virtual Box Resize HD | Wills Blog said:

    Jun 30, 13 at 12:41 pm

    […] http://tips.kaali.co.uk/2012/03/16/expand-or-increase-the-size-of-virtual-box-vdi-dis/ […]

  31. Joe Poniatowski said:

    Jun 20, 13 at 7:02 pm

    Thanks – this worked great. The ‘resize’ option in VirtualBox doesn’t work with snapshots, but this method did work.

  32. dmitry said:

    Jun 20, 13 at 7:26 am

    Great thanx to you! You’ve saved a lot of time for me! I wonder why this functionality is not implemented in the Virtual Box from user interface. I think, this is a common issue.

  33. Bob Listerene said:

    Jun 16, 13 at 10:30 am

    By far the simplest explanation of how to do this, other websites complicate matters when it is really quite a simple process.

  34. Ric said:

    Jun 09, 13 at 11:17 am

    I found this article after VBox ran out of disk space during a SQL server install. I used the –resize command as suggested by Jonas in the earlier comments but kept getting an error. For those who suffer the same then you might find the issue is with the privs of CLI. I usually run mine with admin privs and it was in that environment I was getting the errors, however they were solved by calling VBoxmanage from within a CLI without (yup, without) admin privs.

    This might or might not solve your problem if it’s similar, but I thought I would add it to the comments for people who ran into the same problem and I did.

  35. Naijaecash said:

    Jun 05, 13 at 3:26 pm

    Thanks. The tutorial is simple enough and it works. I just increased my virtual disk from 40gb to 80gb following your instructions above. Cheers.

  36. Victor Hugo Molinar said:

    May 08, 13 at 7:35 pm

    That perfectly solved my problem!
    Thanks!

  37. Bruno Mateus said:

    Apr 23, 13 at 2:33 pm

    If the system to increase is ubuntu, you should use Arvind’s instructions. Then load your system with a Ubuntu LIVE CD, load Gparted, and move the swap partition to the right in order to attach the unused space with the system partition.

    Guess it shouldn’t be too different with other linux’es 🙂

  38. review of food4wealth said:

    Apr 23, 13 at 6:39 am

    Hurrah, that’s what I was seeking for, what a stuff! existing here at this weblog, thanks admin of this website.

  39. kalpa said:

    Apr 15, 13 at 6:23 am

    You made my day..A BIG thanks for this 🙂

  40. Francesco said:

    Mar 25, 13 at 7:44 am

    Hi, I receive an error in doing the clone action. The error is this:
    0%…
    Progress state: VBOX_E_FILE_ERROR
    VBoxManage.exe: error: Failed to clone hard disk
    VBoxManage.exe: error: Could not create the clone medium ‘C:\Users\myName\Virt
    ualBox VMs\Ubuntu 12.10c\Ubu8GB.vdi’.
    VBoxManage.exe: error: VDI: cannot create image ‘C:\Users\myName\VirtualBox VM
    s\Ubuntu 12.10c\Ubu8GB.vdi’ (VERR_ALREADY_EXISTS)
    VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component M
    edium, interface IMedium
    VBoxManage.exe: error: Context: “int __cdecl handleCloneHardDisk(struct HandlerA
    rg *)” at line 682 of file VBoxManageDisk.cpp

  41. Virtual Box – How to extend the capacity of a VB disc? | El Blog de Fabian Tapia said:

    Mar 19, 13 at 9:33 pm

    […] 4. Connect/Attach the new disk to the Virtual Machine 5. Boot/Start the Virtual Machine 6. Go to Windows Computer Management –> Disk/Storage management and Extend the disk space on C drive to use the newly created/unallocated disk space That’s all enjoy the extended sized disk!! souce: Tips and Tricks […]

  42. Thomas Eitzenberger said:

    Mar 14, 13 at 1:45 pm

    Easier way todo :

    VBoxManage modifyhd file.vdi –resize 12000

    whereas 12000 stands for 12GB 😉

  43. Arvind said:

    Mar 07, 13 at 9:55 pm

    After Step 4 is done, start the virtual machine as usual. The machine should use the new cloned/bigger disk to boot which you then extend as per Step 6.

  44. bob said:

    Mar 07, 13 at 8:43 pm

    How do you do step 5 in windows XP

  45. Arvind said:

    Feb 18, 13 at 11:32 pm

    Did you use the cloned disk to boot up? You may have to remove the original disk from Virtual Machine via the Settings interface.

  46. Mark said:

    Feb 18, 13 at 10:48 pm

    used vboxmanage resize and doubled the capacity from 10GB to 20GB, and the showinfo does show the increased size. however, the vm itself is still showing 10GB and the OS (windows xp) in the manage tool doesn’t show me able to resize. Further, booting in the VM with knoppix 7 allows me to use gparted, but this doesn’t show the unallocated space and doesn’t allow me to expand the partition. What am I missing

  47. Noe Nieto said:

    Feb 12, 13 at 2:34 pm

    Thanks a lot. You saved my day!

  48. thrylos said:

    Feb 06, 13 at 1:50 pm

    I installed Backtrack 5 R3 on mac via virtual box and I am trying to install Nessus vulnerability scanner on that virtual box.
    I do everything right but when i visit the page via this ip address 127.0.0.1:8834/ after a while i get a message: not enough disk space.

    I have allocated 45GB for the virtual box and 2048MB for the video card.

    do you know where is the problem?

  49. Abbas said:

    Jan 22, 13 at 4:24 am

    Thanks for the tip, it helped me as –resize option isn’t there with VBoxManager anymore

  50. Expanding VirtualBox Hard Disk Without Cloning | The Greener Awakening said:

    Dec 26, 12 at 5:25 pm

    […] If your host is windows or all the above explained didn’t do, this might be of help: http://tips.kaali.co.uk/2012/03/16/expand-or-increase-the-size-of-virtual-box-vdi-dis/ […]

  51. Salvo said:

    Dec 22, 12 at 4:31 pm

    Thanks for the guide. Like Jonas said, “Vboxmanage modifyhd xxxxx.vdi –resize xxxxx” is a lot more simple. Although it only works for VDI & VHD formats and only dynamically allocated drives.

    From the manual:
    The –resize x option (where x is the desired new total space in megabytes) allows you to change the capacity of an existing image; this adjusts the logical size of a virtual disk without affecting the physical size much.[37] This currently works only for VDI and VHD formats, and only for the dynamically allocated variants, and can only be used to expand (not shrink) the capacity. For example, if you originally created a 10G disk which is now full, you can use the –resize 15360 command to change the capacity to 15G (15,360MB) without having to create a new image and copy all data from within a virtual machine. Note however that this only changes the drive capacity; you will typically next need to use a partition management tool inside the guest to adjust the main partition to fill the drive.

  52. Mohammed Ali said:

    Dec 10, 12 at 4:25 pm

    Thank you very much for the information you have provided, which has been very useful.

  53. Jonas said:

    Dec 06, 12 at 11:49 am

    Check out ‘VBoxManage modifyhd .vdi –resize ‘. Then proceed with step 5.

  54. Alessandro said:

    Dec 02, 12 at 2:36 am

    Thank you man!!! Great post! You solved me a big problem!

  55. Arvind said:

    Nov 29, 12 at 12:36 am

    You can get this via Windows Control Panel. Administrative Tools -> Computer Management or by typing compmgmt.msc on a dos prompt or in Start -> Run

  56. Felipe MC said:

    Nov 23, 12 at 1:25 am

    Thanks for your post!
    I just don’t get the last step. Where I find “Windows Computer Management –> Disk/Storage management” on Windows xp?

  57. János Szili said:

    Nov 20, 12 at 5:13 pm

    Excellent! Works perfectly!
    Many thanks!

  58. Ryan Harvey said:

    Nov 15, 12 at 5:25 pm

    Thanks for saving me hours of reloading time!

  59. Jim Hurly said:

    Nov 14, 12 at 4:40 am

    Worked perfectly as described. Much appreciated!

  60. Paul M Edwards said:

    Nov 09, 12 at 11:25 pm

    I was having the same problem as Mark above when trying to resize the VDI for a CentOS Guest on my Win7 work PC.
    I found the article below which mentions that all snapshots must be deleted/merged into the base VDI.
    http://trivialproof.blogspot.com/2011/01/resizing-virtualbox-virtual-hard-disk.html

    After doing so, I was finally able to successfully enlarge the VDI.

  61. tien nguyen said:

    Oct 29, 12 at 3:47 pm

    Great tips. I would like to add this, if the disk has been “snapshot” then you would need to repeat the hdclone operation again over the each of those snapshots image in reverse order i.e. from older to the latest snapshot. You can find the snapshots info by open up the Virtual Media dialog and lick on the disk to see more snapshot info.

  62. Bahadır said:

    Oct 26, 12 at 10:30 pm

    Thx so much 🙂

  63. A Smattering of Selenium #123 « Official Selenium Blog said:

    Oct 17, 12 at 3:10 pm

    […] Increase Virtual Box VDI disk size on MAC or Windows — amazing how much faster a vm runs when you give it enough disk to breathe […]

  64. Turtle said:

    Oct 17, 12 at 11:06 am

    As usual, a wonderful solution for people who never use anything but MS crap. Research this better in your next life, OK? Thanks.

  65. Justin Obney said:

    Oct 12, 12 at 5:15 am

    Much props sir..

  66. Feroze said:

    Oct 06, 12 at 2:32 pm

    You Rock!!!! Helped me a lot…. worked as you said….

  67. Jason said:

    Sep 20, 12 at 7:40 pm

    This worked, simple as that. Many thanks!!

  68. luqies said:

    Sep 06, 12 at 10:07 am

    worked like a charm.

  69. Mike M said:

    Aug 11, 12 at 6:08 am

    This is by far the best/simplest way to do it. I’ve spent the past 4 hours dealing with unbootable copies of windows, and all other sorts of issues with the terrible steps other blogs post. Just so its clear:
    VirtualBox v 4.1.4
    20GB Fixed –> 35gb Dynamic
    Host: MacOSX Lion
    Guest VM: Windows 7

    This works. Thank you, now I can go to sleep

  70. navneet said:

    Jul 20, 12 at 7:25 am

    Just found out after “–resize” virtualbox shows updated size for the vdi however its not updated in the VM os 🙁

  71. navneet said:

    Jul 20, 12 at 6:34 am

    I had tried “vboxmanage modifyhd VDI_FILE_PATH –resize 15360” for same issue and it worked.

  72. navneet said:

    Jul 20, 12 at 6:33 am

    I had same issue with on linux. I tried “vboxmanage modifyhd VDI_FILE_PATH –resize 15360” and it worked for me.

  73. Mark said:

    Jul 07, 12 at 7:56 pm

    Thanks for the work here. I tried this on Linux but in my special case it didn’t work. All the steps works as documented above. However I think the problem is that the instructions above don’t take into account snapshots. By cloning the hard drive that I see mounted in the SATA Controller settings I seem to be cloning the original install and not the current snapshot. When I boot most everything is missing. Virus protection is out-of-date, default Windows desktop, etc.

    I’m not sure exactly how to handle cloning a snapshot when the purpose is to get larger storage. First, the name of the snapshot probably needs to be the same. In my case:

    mark@c2stable /VirtualMachines/Virtualbox/Builder VM $ ls -al Snapshots/
    total 31100232
    drwxr-xr-x 2 mark users 4096 Jul 7 11:42 .
    drwxr-xr-x 4 mark users 4096 Jul 7 11:46 ..
    -rw——- 1 mark users 459407360 Jul 7 11:46 {53f024f6-2e7d-43a7-af5a-d94a44786b40}.vdi
    -rw——- 1 mark users 1246887936 Jan 17 2011 {8c962824-76ed-4b74-a04b-6d0fffac3ce3}.vdi
    -rw——- 1 mark users 3844210688 Jan 18 2011 {945305a9-29cb-42bf-ae89-bd9baee2e49e}.vdi
    -rw——- 1 mark users 2596405248 Feb 5 2011 {9ba7920f-3181-4245-9b37-ab995a18745d}.vdi
    -rw——- 1 mark users 23668588544 Jul 7 09:43 {a66f103b-f3b1-4931-b085-9a46637ff14a}.vdi

    I could just keep the name the same, doing the clone in a different directory, and then move the clone in with the same name. However I’m not sure VBox is going to be happy if the VDI is trying to represent 60GB instead of 30GB.

    Ideas or comments?

    Thanks!

  74. Arvind said:

    Jun 24, 12 at 3:25 pm

    The clone should make an exact copy of your current VM, so if your current VM boots up ok then the cloned one should also do the same. It may be worth cloning the current disk again just to make sure the cloning process hasn’t created the issues that you are experiencing.

  75. Joe said:

    Jun 24, 12 at 5:52 am

    having trouble attaching to the new vdi. for some reason, my Windows7 VM boots with some of my files missing, but I can’t seem to boot into the new VM. do I need to create a Bootable VM or just clone as described in your article

    Thanks

  76. Arvind said:

    Jun 18, 12 at 4:10 pm

    Thanks Ryan. Have made the correction…

  77. Ryan said:

    Jun 18, 12 at 3:58 pm

    Thanks this helped!

    Reminder to everyone: it should be vdi not vid when typing in [OldHDDFile.vid] and [NewHDDFile.vid].


Leave a Reply