Page 1 of 1

VDI too small, oops! Please help!

Posted: 1. Sep 2008, 06:54
by Kissell
Okay, I started off my first VirtualBox with a Windows XP guest host install of a 2GB dynamic vdi image... now I've decided that's too small for all the apps I want to load up in it.

I really don't want to reinstall XP and all the apps I've loaded so far, can I get the VDI to change the maximum size it can expand too? or am I just screwed and have to start over?

I know I can create another VDI and add it to the VM as a second hard disk... but this is not ideal either... what would be great, what I want, is to increase the max size the VDI will dynamically expand to... but I'm not seeing how to do this in the menus.

Posted: 1. Sep 2008, 07:19
by stefan.becker
http://forums.virtualbox.org/viewtopic.php?t=2517

You need a Live CD like GPARTED.

gparted

Posted: 1. Sep 2008, 07:23
by Kissell
that link isn't in english... :(

I have gparted, but when I attempt to use it all I see is my physical hard disk in the machine... what i want is to be able to expand the VDI image, but don't have the option to load it in gparted as a disk.

AH, CLONEZILLA

Posted: 1. Sep 2008, 07:31
by Kissell
I hadn't heard of this yet, but a program called clonezilla looks like it will work.

What you do is create a new VDI hard disk, then set your virtual machine to boot to the clonezilla iso image which is a live CD and then use it to clone the old VDI hard disk to the new (larger) VDI image. Then remove the old VDI disk and make the new VDI your primary drive and boot to it. very nice... although it'd be nicer if the menu in virtualbox just gave an option to expand the size, but oh well, this is a viable solution.

http://ubuntuforums.org/archive/index.php/t-634880.html

Posted: 1. Sep 2008, 07:35
by stefan.becker
There is no direct option. You have to create a new disc and copy guest from first to second vdi. Translation:

1. create a new, greater vdi-File with VirtualBox, assign it to the VM
2. download gparted iso, assign it to the vm as cdrom and boot from this (boot order in vm-settins)!
now in the gparted command line:
3. dd if=/dev/hda bs=512 count=1 of=/XPmbr
4. dd if=/dev/hda of=/dev/hdb
5. dd if=/XPmbr of=/dev/hdb
6. Stop live-cd, boot again with xp in the guest, start "chkdsk D: /F" and then reboot xp 2 times (tip from gparted)
7. delete the small vdi from the VM
8. Again bbot the VM with gaprted
9. In Gparted make the partition size from hda1 greater

Download gparted: http://sourceforge.net/project/showfile ... _id=115843

Posted: 1. Sep 2008, 15:45
by Sasquatch
Please also see the Forum FAQ for how to clone your install to a larger vdi.

Posted: 6. Sep 2008, 16:33
by s0c9
stefan.becker wrote:There is no direct option. You have to create a new disc and copy guest from first to second vdi. Translation:

1. create a new, greater vdi-File with VirtualBox, assign it to the VM
2. download gparted iso, assign it to the vm as cdrom and boot from this (boot order in vm-settins)!
now in the gparted command line:
3. dd if=/dev/hda bs=512 count=1 of=/XPmbr
4. dd if=/dev/hda of=/dev/hdb
5. dd if=/XPmbr of=/dev/hdb
6. Stop live-cd, boot again with xp in the guest, start "chkdsk D: /F" and then reboot xp 2 times (tip from gparted)
7. delete the small vdi from the VM
8. Again bbot the VM with gaprted
9. In Gparted make the partition size from hda1 greater

Download gparted: http://sourceforge.net/project/showfile ... _id=115843
With all due credit to stefan,
there's an easier way to do this.. for the "not so experienced"... :roll:
[by using the GUI version - not command line - of gparted]

Complete steps 1 and 2 above.
3. Boot to the GUI version of gparted.
4. Use the copy/paste feature to copy your old vdi partition contents to your newly sized vdi. See http://gparted.sourceforge.net/larry/move/move.htm for details on how to do this.
5. Once the copy is complete, select the new vdi partiton, right click on it and select "Manage Flags". If it's not checked, check the "Boot" flag.
This will make your new vdi partition boot-able. Click OK.
6. Shut down the VM, go into the Virtual Disk Manager and "release" the old vdi and "select" the new vdi to bind it to your VM.
7. Start up the VM.

Windows will go thru an automatic "CHKDSK /F" - due to the new size of the partition, then [automagically] restart once complete.

Windows logon should now come up and you should be all set...