VBoxManage modifyhd usage?

Discussions about using Windows guests in VirtualBox.
Post Reply
EricLeBouffon
Posts: 7
Joined: 25. Nov 2011, 13:06
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win Server 2008 R2, Win 7 Ultimate 32

VBoxManage modifyhd usage?

Post 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
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage modifyhd usage?

Post 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".
EricLeBouffon
Posts: 7
Joined: 25. Nov 2011, 13:06
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win Server 2008 R2, Win 7 Ultimate 32

Re: VBoxManage modifyhd usage?

Post by EricLeBouffon »

I thought about that but the guest does not seem to see the extra space...

I'll try the CloneVDI option.

Thanks
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage modifyhd usage?

Post by mpack »

If you have used snapshots then resizing the base VDI will not work.
EricLeBouffon
Posts: 7
Joined: 25. Nov 2011, 13:06
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win Server 2008 R2, Win 7 Ultimate 32

Re: VBoxManage modifyhd usage?

Post 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 :(
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage modifyhd usage?

Post 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.
EricLeBouffon
Posts: 7
Joined: 25. Nov 2011, 13:06
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win Server 2008 R2, Win 7 Ultimate 32

Re: VBoxManage modifyhd usage?

Post 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
EricLeBouffon
Posts: 7
Joined: 25. Nov 2011, 13:06
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win Server 2008 R2, Win 7 Ultimate 32

Re: VBoxManage modifyhd usage?

Post by EricLeBouffon »

I just discovered the Guest Additions for Windows...

Sweet! :)
Post Reply