Page 1 of 2

Resize Win7 guest?

Posted: 10. Feb 2011, 23:25
by jcenter
Hi,

I was able to resize my Win7 vdi from 20GB to 40GB in Ubuntu w/o a problem, but Win7 still sees only 20GB. I brought up Win7 Disk Management in the VM, but I can't expand the partition to use the additional space. Is there some trick to doing this that I'm not aware of?

Thanks.

-John

Re: Resize Win7 guest?

Posted: 10. Feb 2011, 23:43
by Perryg
Use gparted. boot the VM with it in the vm CD/DVD as iso and expand the partition.

Re: Resize Win7 guest?

Posted: 14. Feb 2011, 18:31
by jcenter
Hi,

I'm not sure I understand. I made a CD from the Gparted Live ISO & I mounted it from within the Win7 VM. But, how do I use it from there? I don't see any Windows executables.

Thanks.

-John

Re: Resize Win7 guest?

Posted: 15. Feb 2011, 03:00
by BillG
Umm.. if you are fiddling with the partition which contains your OS you are not in Windows!

Re: Resize Win7 guest?

Posted: 15. Feb 2011, 17:38
by jcenter
Hi,

No, I'm trying to change the size of the partition of the Win7 guest. When I couldn't run gparted within the VM, I restarted it with the Gparted Live ISO mounted. The VM then booted off of the ISO, but I was still unable to resize it. Gparted only saw the old partition size, not the additional space added by modifying the VDI. Am I missing some step here?

Thanks.

-John

Re: Resize Win7 guest?

Posted: 16. Feb 2011, 16:29
by mpack
You need to learn the difference between "disk size" and "partition size". The former is a hardware limit (though the hardware might be virtual), the latter says how much of your hardware limit your OS is actually using. VBox is a hardware simulator, so its tool changes the former, not the latter. Gparted changes the latter.

So now we can look at what you said.
jcenter wrote:Gparted only saw the old partition size, not the additional space added by modifying the VDI
Well of course Gparted sees the old partition size, you are running gparted in order to change it! If you are saying that gparted still sees the old disk size then you do not have the right disk mounted in the VM, or you have not actually enlarged it.

Speaking of which, please explain what steps you used to resize the disk, and how you know that it worked (info from first sentence of your OP).

Re: Resize Win7 guest?

Posted: 23. Feb 2011, 15:51
by jcenter
Hi,

What I meant was, I first increased the virtual hard disk size from the Ubuntu host:

# vboxmanage modifyhd Win7-64VM.vdi --resize 40000

When I booted the VM with the Gparted Live CD, I expected Gparted to show me the Win7 partition now as a fraction of the virtual hard disk size. In my case, half the size since I went from 20GB to 40GB. Instead, it indicated that the Win7 partition was the same size as the disk, so I couldn't resize the partition.

HTH

-John

Re: Resize Win7 guest?

Posted: 23. Feb 2011, 19:03
by mpack
jcenter wrote:When I booted the VM with the Gparted Live CD, I expected Gparted to show me the Win7 partition now as a fraction of the virtual hard disk size. In my case, half the size since I went from 20GB to 40GB. Instead, it indicated that the Win7 partition was the same size as the disk, so I couldn't resize the partition.
Thank you, it's now much clearer (to me) what you have done.

That does sound odd... and you are not the first to report this (though I didn't really believe the other reports either... :-) ). Could you please do me a favour:
  • post a screenshot of the VM summary which the GUI shows you when that VM is selected (i.e. I mean the summary given in the panel on the right, I don't want you to go into settings. I'm particularly interested in seeing the Storage summary since it includes a statement of disk capacity.
  • Post a screenshot of that gparted partition map which you mentioned, so I can see for myself that gparted running in that same VM does not recognize the additional space.
  • Since there have now been 3 versions of VBox which support that disk resize feature (v4.0.4 is current as I write), please confirm which version you are using.

Re: Resize Win7 guest?

Posted: 25. Feb 2011, 00:24
by l3575
I'm new to the forum, just joined for the very issue. I've just successfully resized my Win 7 vdi, virtual manager shows virtual size of 29.30GB / actual size of 15.55GB. Booting PMagic and running gparted indicates a total disk space of 19.12 GB, so the partition cannot be grown. It appears that virtual size reported by the manager is separate from the reported disk size to the guest os. I'm using release 4.40rc70122 on ubuntu 10.10 64bit.
Rick

Re: Resize Win7 guest?

Posted: 25. Feb 2011, 01:28
by Perryg
Windows-7 started at 30GB and increased to 40GB

perry@perry-desktop:~$ VBoxManage modifyhd /drive/tara1/VirtualBox-VMs/Windows-7/Windows-7.vdi --resize 40000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
perry@perry-desktop:~$

Put the Gparted iso or CD in the guests virtual drive and boot the guest.

You should now see something like this.
Gparted-Windows-7-1.png
Gparted-Windows-7-1.png (105.27 KiB) Viewed 10976 times
Increase the primary drive to use the unallocated portion
Gparted-Windows-7-2.png
Gparted-Windows-7-2.png (121.73 KiB) Viewed 10974 times
Shutdown the guest and remove the Gparted iso or CD form the guests virtual drive.

Start the guest and Windows is going to do a disk check at first boot.
Once this is done you are finished

Re: Resize Win7 guest?

Posted: 27. Feb 2011, 22:46
by billyox
thank you. this was very helpful. If you have problems with re size the partition with G :) parted, remember to suspend the antivirus software on your guest system.

Re: Resize Win7 guest?

Posted: 28. Feb 2011, 12:12
by mpack
billyox wrote:thank you. this was very helpful. If you have problems with resize the partition with Gparted, remember to suspend the antivirus software on your guest system.
Eh? Gparted is run from a live CD, so there is no way the guest antivirus stuff could be running at the time. And given that the guest is Win7 and Gparted is a Linux app, there's also no way to run Gparted without the live CD.

Re: Resize Win7 guest?

Posted: 28. Feb 2011, 20:22
by stefan.becker
Since Vista this not necessary. After resizing the image start Vista / Windows 7 and open System Control. In the Disc-Devices snapin there can be partitions resized.

Re: Resize Win7 guest?

Posted: 28. Feb 2011, 20:41
by mpack
stefan.becker wrote:Since Vista this not necessary. After resizing the image start Vista / Windows 7 and open System Control. In the Disc-Devices snapin there can be partitions resized.
Well, it used to be the case that you couldn't resize your boot partition while Windows was running, but perhaps that has changed. I think Perry knows more about this than I do (I don't use Vista or Win7 for serious work).

Re: Resize Win7 guest?

Posted: 28. Feb 2011, 21:23
by Perryg
Yes it is doable with Windows Vista and Windows 7 using the disk manager. I prefer to use Gparted myself but that is by choice as I like to have better control and I use it on other OSes, so it is an all-in-one solution for me.