Page 1 of 3

[Solved] How to make a virtual disk bigger?

Posted: 21. Jun 2007, 09:52
by chamstar
Hi I am using Ubuntu and have successfully installed WinXP in VirtualBox (first time using it, great bit of kit). The only issue is I created a 2GB disk and now its full. I did set it to dynamic size but it has not expanded, so what should I do? Is there a way to manually expand it? I could not find anything in the manual or poking around in the disk manager.

Thanks, Cham.

Posted: 22. Jun 2007, 01:30
by sable683
Chamstar, I am in the same boat... sort of. I am running Ubuntu Feisty Fawn and Virtual Box windows xp on a fixed 5 GB hdd size. I would like to enlarge the size by 3 GB. I would realy hate to do all of the xp updates again!

~John

Posted: 22. Jun 2007, 09:40
by chamstar
I thought I would have the answer by now, maybe you cannot resize disks?
I would find this a bit strange, and I don't know if to file my problem as a bug since I actually have a dynamic disk and its not re-sizing... There is plenty of room on the real disk for a file increase.

Posted: 22. Jun 2007, 10:24
by JusTiCe8
Hi,

dynamic disk are in fact disk with specified size (eg.: 2GB) which are not fully allocated when created, so it could have size of 15 KB (just an example), then you'll format it and add a 500 KB file, size become now 584 KB (always an example), and so on until it reach it's max size: 2GB. It is not a disk which will grows and grows as needed !

Posted: 22. Jun 2007, 12:33
by chamstar
Oh right I see, I must have mis-read the description. So basically to get the effect I wanted I would create a dynamic disk of say 50GB and it would expand right up to 50GB... okay great!

So is there anyway to resize the existing disk I have or do I need to start again?

Many thanks, Cham.

Posted: 22. Jun 2007, 15:30
by JusTiCe8
There is 2 options: the most reliable is to create a bigger disk and copy content from the first to this one (with something like backup tool), the other one is a bit tricky, you'll have to modify the geometry of virtual disk and resize partition with a partition tool like parted on Linux.
I succeed with 2nd solution with a WinXP system disk (I was bored to use 1st solution ;) ), I have twice the size now, but the inside size of vdi is still the older. It's work, no error at all.
To do this I have just write a little patch for vditool. I'll send it soon to dev.

Posted: 22. Jun 2007, 16:19
by chamstar
Ive used qparted before to resize real partitions, so it also works for virtual disks? Something built in to VirtualBox would be the best option in terms of user freindlyness...

Posted: 11. Jul 2007, 15:40
by gushy
JusTiCe8 is right, I've just done this by creating a bigger disk and then copying the contents.
  • Create a new disk using Virtual Disk Manager (in VirtualBox goto File -> Virtual Disk Manager)
  • download System Rescue CD
  • set your current VM to have the new disk image as it's second hard disk and the System Rescue CD iso file as it's CD
  • boot the vm from the CD
  • at the command prompt type startx
  • when X Windows starts, type gparted in the terminal that is open on screen
  • in gparted select the windows partition and choose copy
  • select the second hard disk
  • right click on the representation of the disk and click paste
  • gparted will prompt you for the size of the disk, drag the slider to the max size
  • click apply
  • wait .......
  • when it's done right click on the disk and choose Manage Flags, and select Boot
  • exit gparted and power off the VM
  • change the VM settings to only have one disk (the new bigger disk) and deselect the iso as the CD.
  • boot the VM into your windows install on it's new bigger disk!
I don't think I've missed any steps out....

Posted: 11. Jul 2007, 16:25
by chamstar
Perfect but failed on step one. Whats up with the link, looks like the binary is getting rendered as text!

Posted: 11. Jul 2007, 16:29
by gushy
oh yeah, I meant to say right click and Save as on that first link, I stumbled there too! I've amended the list of instructions.

Posted: 12. Jul 2007, 12:02
by chamstar
Whats the file type, it (Ubuntu/Firefox) tries to give it a html extension when I do a 'save as'?
We'll get there in the end!
Thanks for your help...

Posted: 12. Jul 2007, 12:24
by gushy
no extension it's just a binary executable; just save it without and chmod it to be executable

If firefox doesn't want to play nicely use wget:

Code: Select all

wget -c http://www.virtualbox.org/download/testcase/vditool

Posted: 12. Jul 2007, 12:47
by chamstar
Thanks and you prob. think I'm a bit daft but I still cannot get it to work, tried downloading with ff and wget and I just get 'command not found' when I try vditool from the command line, I can see it when I do ls (its on my Desktop).

If I type vdi then hit tab it does not autocomplete, I get vdir instead!! Sorry I know this is hardly related to the issue of resizing a vdi...

Posted: 12. Jul 2007, 12:49
by gushy
no problem.

To run it as vidtool you need to have it in a location that's in your path - for instance I put mine in /usr/local/bin

To run it where you have it you need to call it using the full path:
/home/username/Desktop/vditool

Posted: 12. Jul 2007, 12:52
by chamstar
Oh right, thanks. And as I have just found out you can use the Virtual Disk Manager GUI from Virtual Box's File menu :)