Increase/Expand the Size of Windows 7 vdi File on VirtualBox Mac

Host OS: Mac OS X: Version:10.6.4
Guest OS: Windows 7 X64
Mac app: Virtualbox Mac


6 months ago, I Installed Windows 7 on my Mac using VirtualBox. I made a bad decision when creating the Windows virtual machine (VM). I chose to create VirtualBox VDI file of fixed-size storage of 20GB. It didn't take long before Windows started alerting me there is not enough space for update and paging.  This afternoon, When there was only 20MB space left in Windows system, I finally decided to try to expand the disk size of Windows volume. Here is how I changed the Fixed-sized Windows 7 Virtualbox VDI from 20GB to a dynamically expanding VDI file. It it actually much easier than I thought.

Create a new dynamically expending Virtual Disk Image (VDI) using virtualBox Mac

  1. Open VirtualBox (VB), choose menu File–>Virtual Media Manager virtual media manager
  2. In "Create New Virtual Disk Wizard" choose "Dynamically expanding storage"
  3. Choose VDI file location and specify the maximum size for this VDI, If you specify 60GB as the maximum size, then maximum windows disk space will be 60GB. Here, I choose 60GB for the maximum storage size and 'Win7X64.vdi' as the file name.

Use clonehd to 'copy' old VDI to the new VDI file (in my case:Win7X64.vdi) you just created

We need to transfer the Windows system installed on the old VDI file to the new virtual disk image We just created. In  order to do this, We need to use the VBoxManage clonehd command. Here is the usage of clonehd. Open Terminal,  go the directory where your virtual machine files(old vid files and the new vdi file just created) are and type: VBoxManage clonehd OldVidFile.vdi newDynamicallyExpandingVidFile.vdi --existing The clone process should begin and you should see output similar to  this:

Attach the new dynamically expending VDI and extend the Windows volume

In VB–>Settings–>Storage, attach the new VDI and de-attach the old VDI. You may need to open the Virtual Media Manager. Boot into Windows 7 on the newly attached VDI. Go to Start–>Control Panel–>Administrative Tools–>Computer Management In Computer Management–>Disk Management, choose your system drive(Boot), right click on it and choose "Extend Volume" That's it, Now you should have your Windows virtual machine expanded.

GD Star Rating
loading...
Increase/Expand the Size of Windows 7 vdi File on VirtualBox Mac, 10.0 out of 10 based on 1 rating
Be Sociable, Share!

Related posts:

  1. Windows “Show Desktop” on Mac

12 Responses to Increase/Expand the Size of Windows 7 vdi File on VirtualBox Mac

  1. Peter says:

    Thanks heaps, was the simplest thing to do.

    GD Star Rating
    loading...
  2. Fredrik says:

    Great tip!
    Only thing I stumbled on was “de-attach the old VDI”.
    Why is it so hard to read and follow instructions carefully?

    Thanks!

    GD Star Rating
    loading...
  3. Rob says:

    What an excellent tip. It does what it says and took me about ten minutes to add 40GB to the boot drive of my Windows 7 VM.

    Thank you.

    GD Star Rating
    loading...
  4. uhebeisen says:

    same situation here (I need a bigger virtual HD) but my guest system is WinXP, do you know the Windows XP equivalents to the “Disk Management” function? Is this even possible with WinXP or is this a function of Win7 only?

    GD Star Rating
    loading...
    • Chase says:

      For Win XP, download this “EaseUS Partition Master” software, and merge the unused disk space. The software is free and #1 rated, so no need to worry much. I just had to do this myself, and it worked successfully. Took forever researching, thought I share. FYI, i also tried DiskPart windows utility (another proposed solution) and it failed.

      GD Star Rating
      loading...
  5. przemoc says:

    It looks that my previous comment was filtered. I add only that my tool, vidma – Virtual Disks Manipulator, since version 0.0.3 supports resizing dynamic VDI files (fixed ones were supported from the beginning).

    GD Star Rating
    loading...
  6. User40 says:

    Many thx for that great howto. It saves my live ;-)

    GD Star Rating
    loading...
  7. Steen says:

    Eamon, did you succeed?
    You may be having the same problem I had. It was resolved by removing (but keeping!) both harddisks from VirtualBox while doing the actual cloning. I.e:
    1. Remove the old/small harddisk from virtual box.
    2. Creat the new/large harddisk in virtual box.
    3. Remove but keep the new harddisk.
    4. Perform the VBoxManage clonehd command.
    5. Attach the new/large harddisk.
    6. Start the virtual machine and exted the volume in windows.

    I have performed the above steps on 3 harddisks succesfully.
    All 3 times on OSX 10.6, 2 different iMacs and one MacBook. All 3 virtual machines win7.

    Thanks a million, TIgernt :o )

    GD Star Rating
    loading...
  8. Erik says:

    Worked like a charm, thanks!

    GD Star Rating
    loading...
  9. Eamon O Doherty says:

    ~Solved (re previous comment). I used the UUID of the xp.vdi instead of the vdi filename and it worked fine

    GD Star Rating
    loading...
    • uhebeisen says:

      Eamon,
      can explain me the difference between UUID and a vdi filename please? I have got the same error message after restoring everything from yesterdays backup.
      I have issued a similar command (modifyhd) today and it worked. At least I saw the increased HD-size in the VB Manger. But then things get mixed up and I have to restore the whole thing from my TimeMachine.

      Also I wonder how to create a new virtual disk from just the Menu (VB) File -> Virtual Media Manger. In the window that opens on my computer there is no command to create a new virtual disk.

      GD Star Rating
      loading...
  10. Eamon says:

    I get to step 2. But this fails. I tried copying the original xp.vdi to OLDxp.vdi but the UUID is registered somewhere.

    ERROR: Cannot register the hard disk ‘/Users/eamon/Desktop/Eamon/virtual box/OLDxp.vdi’ with UUID {447a6705-e94f-44da-8acb-2ab56e3096a9} because a hard disk ‘/Users/eamon/Desktop/Eamon/virtual box/xp.vdi’ with UUID {447a6705-e94f-44da-8acb-2ab56e3096a9} already exists in the media registry (‘/Users/eamon/Library/VirtualBox/VirtualBox.xml’)
    Details: code NS_ERROR_INVALID_ARG (0×80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
    Context: “OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr(“”), false, Bstr(“”), srcDisk.asOutParam())” at line 633 of file VBoxManageDisk.cpp

    GD Star Rating
    loading...

Leave a Reply

Your email address will not be published. Required fields are marked *

*


× 2 = eight

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>