Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to resize a Virtual Hard Disk in VirtualBox


16 Mar 2012   #1
TE7

Microsoft Windows 7 Home Premium 64-bit SP1
 
 
How to resize a Virtual Hard Disk in VirtualBox

You can use the following link to resize your virtual hard disk:

Trivial Proof: Resizing a VirtualBox Virtual Hard Disk

Tips:

1. For a dynamic size virtual hard disk, you can just use the VBoxManage modifyhd --resize command, as explained in the link.

2. For a fixed size virtual hard disk, you must first clone the virtual hard disk, and then resize the clone, as explained in the link. When you clone a fixed disk, the clone is a dynamic sized disk by default.

Emphasize: You cannot just resize a FIXED size virtual disk.

2a. You can then replace the original virtual hard disk with the clone in the settings for the virtual machine in:

In the VirtualBox settings for the virtual machine (Settings --> Storage --> Controller for the .vdi file --> click the round disks button in the top right to choose which .vdi to boot from).

2b. You can then go to:

In the main VirtualBox window, File --> Virtual Media Manager, and delete the old .vdi file (Remove option).

Note: When you resize, the number you give to the command is in megabytes, so in my case I wanted to resize from 8 GB to 12 GB, so I used --resize 12288.

3. If the host is Windows, here are some tips:

- Use Windows Explorer to go to the folder that contains the .vdi file to work on.

- Hold down the shift key, right click, and choose Open Cammand Window Here.

- When using VBoxManage, all paths and file names that contain spaces must be enclosed in quotations.

- For example, in my case I had to use:

- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd "Ubuntu 11.10 64 bit.vdi" "Ubuntu 11.10 64 bit clone.vdi" --existing

- The same applies for the VBoxManage modifyhd --resize command.

4. If you are cloning linux, and then resizing, and then using GParted afterward, as explained in the link, here are some tips:

- In my case, I had a swap partition. What I did was to delete the swap partition, resize my cloned partition (leaving enough space to add the swap back again afterwards), and then added a new swap partition at the end of the virtual hard drive. I found this the easiest way to do it.

5. For cloning, there's an option for it in the Virtual Media Manager (Copy option, I guess), but I didn't try it yet. That might be easier, as I've read online.

I hope these tips are helpful.

My System SpecsSystem Spec
.

16 Mar 2012   #2

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

There is a utility that can do this sort of thing via a GUI. CloneVDI
My System SpecsSystem Spec
16 Mar 2012   #3
TE7

Microsoft Windows 7 Home Premium 64-bit SP1
 
 

I checked out the link. Looks good. After the clone I think you still might need to use GParted, though. I'm not sure. Any thoughts on that?
My System SpecsSystem Spec
.


16 Mar 2012   #4

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Yes you would have to resize the partitions but I guess you would have to do that with VboxManage. How successful that would be would depend on the OS. I have had problems with Linux not recognizing that a disk had increased in size.
My System SpecsSystem Spec
16 Mar 2012   #5
TE7

Microsoft Windows 7 Home Premium 64-bit SP1
 
 

I think that's what using GParted does. After I had cloned, then resized the clone, I used GParted to increase the new clone size in the partition within the virtual disk. When you clone, and then resize, it just increases the size of the virtual disk, not the partition containing the virtual OS. GParted lets you increase the size of the OS partition inside the virtual disk. Before using GParted, when I booted the clone, System Monitor showed the same size as the original. But after using GParted, the new size was reflected in the clone.
My System SpecsSystem Spec
17 Mar 2012   #6

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Yes. I think the problem I had was that I moved a partition and Linux didn't like it, but then I'm not an expert on either partitioning or Linux.
My System SpecsSystem Spec
17 Mar 2012   #7
TE7

Microsoft Windows 7 Home Premium 64-bit SP1
 
 

I tried the CloneVDI tool to increase the size of a Linux (Lubuntu) virtual drive. It cloned and gave me a new DYNAMIC sized .vdi file. I chose to increase the partition size, along with the virtual disk size, but the result was no OS partition increase. I think the presence of the swap file may have confused that aspect of it. I still had to use GParted to increase the size of the the OS partition to max out the size of the new cloned virtual disk.
My System SpecsSystem Spec
17 Mar 2012   #8

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

If I remember correctly I didn't ask it to increase the partition size and then when I tried to resize the partition in openSUSE it showed no room for expansion and the old disk size. I think the problem lay in the default partition layout in openSUSE. Swap, System partition, Data partition. When I tried with a bootable GParted I increased both the system and data partition which of course involved moving the data partition. openSUSI wouldn't boot so at that point since it was a new install I just reinstalled with the new partition sizes.
My System SpecsSystem Spec
17 Mar 2012   #9
TE7

Microsoft Windows 7 Home Premium 64-bit SP1
 
 

I haven't tried the process with a separate data partition. I've just tried once with the command line (Ubuntu) and once with CloneVDI (Lubuntu). Both of those virtual machines didn't have a separate data partition. I can see how that gets tricky if you move the partitions instead of just resizing from end of one partition.
My System SpecsSystem Spec
17 Mar 2012   #10

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

It's an interesting setup. Although I called it a data partition it also holds any programs you have installed just leaving the first partition entirely for the OS.
My System SpecsSystem Spec
Reply

 How to resize a Virtual Hard Disk in VirtualBox




Thread Tools



Similar help and support threads for2: How to resize a Virtual Hard Disk in VirtualBox
Thread Forum
Host disk is running out of room, can't shrink virtual hard disk? Virtualization
Windows Virtual PC: "Cannot attach the virtual hard disk ..." error Virtualization
Virtual Hard Disk - Unattach and Delete VHD Tutorials
Solved Virtual Hard Disk Virtualization
Virtual Hard Disk error Virtualization
Win Virtual Hard Disk Performance Whitepaper from MS. News
partition vs virtual hard disk - VHD Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:42 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33