Page 1 of 1

VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 13:11
by EricLeBouffon
Dear all,

I am new to Virtual Box and tried to increase the size of a Windows 7 guest disk by using a command like
VBoxManage MyHardDriveFileName.vdi --resize 35000

My guest OS was shutdown and I was expecting to see a bigger hard drive once booting but nothing seems to have changed from the guest perspective.
My virtual disc was declared to dynamically allocate storage.

Am I missing something? :?:

Thanks

Eric

Re: VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 13:47
by mpack
"--resize" only changes the size of the disk, not the size of the guest OS partition. The extra space will be visible as unallocated in My Computer|Manage|Disk management. I don't have any Win7 guests, but I believe Win7 disk manager allows you to enlarge your partition to fill the larger drive. Users of XP and earlier can use the freeware gparted live CD ISO.

In future you may want to consider using the CloneVDI tool to enlarge your drive, as CloneVDI can do the enlarge disk and enlarge NTFS partition steps in a single pass. See the CloneVDI sticky in "Windows Hosts".

Re: VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 14:02
by EricLeBouffon
I thought about that but the guest does not seem to see the extra space...

I'll try the CloneVDI option.

Thanks

Re: VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 14:03
by mpack
If you have used snapshots then resizing the base VDI will not work.

Re: VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 20:43
by EricLeBouffon
Panic!

I tried to make a clone of the disk using the Virtual Box Manager
I could make the disk bigger and when rebooting with the new Virtual Disk, I was effectively able to increase my partition... BUT!!!

For some reason (which I don't quite understand as you can guess), this virtual machine was using the snapshot feature and it looks like my disk (either old or new) reverted me back to a few days ago, probably when I created the snapshot...

I am now a bit in a pickle...

How can I retrieve the situation where I had a smaller disk but all my updates for the last few days?

Is there a way to say "forget the snapshot" and carry on as normal?

Thanks

Eric :(

Re: VBoxManage modifyhd usage?

Posted: 14. Dec 2011, 21:16
by mpack
I suspect you haven't told me everything you did, obviously the info that you were using snapshots was certainly missing from your earlier message. The VM reverting to a few days back is a classic sign that someone has been messing with either the VBox files or has mounted a new disk image in the VM.

Normally, getting rid of a snapshot is easy - you just highlight it in the GUI and delete it. However since you have been manipulating the base VDI in unknown ways using the command line, that move would now be a risky one. What I would do now is use the CloneVDI tool to clone the most recent snapshot file (do NOT clone the base vdi, do NOT use VBoxManage for this). The snapshot files are in the /Snapshots subfolder of the VM folder, they have names similar to {1234.ab35.etc}.vdi, and by sorting them into date order you can see the most recent one. The clone will be a merge of all the data in the snapshot chain, and can be used as the foundation of a new VM. Do not attempt to mount this clone in the old VM.

This is assuming that the snapshot data is still available to be copied. If you already deleted it then its gone, unless you made a backup.

Re: VBoxManage modifyhd usage?

Posted: 15. Dec 2011, 01:34
by EricLeBouffon
Pfew...

The last snapshot was very small an not inretsting but the previous snapshot had everything I was hoping for.

Thanks a lot for your help.

This is VERY much appreciated!

Eric :D

Re: VBoxManage modifyhd usage?

Posted: 15. Dec 2011, 01:37
by EricLeBouffon
I just discovered the Guest Additions for Windows...

Sweet! :)