[Solved] How to make a virtual disk bigger?

Discussions related to using VirtualBox on Linux hosts.

[Solved] How to make a virtual disk bigger?

Postby chamstar » 21. Jun 2007, 09:52

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.
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby sable683 » 22. Jun 2007, 01:30

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
sable683
 
Posts: 2
Joined: 22. Jun 2007, 01:25

Postby chamstar » 22. Jun 2007, 09:40

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.
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby JusTiCe8 » 22. Jun 2007, 10:24

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 !
JusTiCe8
 
Posts: 37
Joined: 13. May 2007, 10:19
Location: Paris

Postby chamstar » 22. Jun 2007, 12:33

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.
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby JusTiCe8 » 22. Jun 2007, 15:30

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.
JusTiCe8
 
Posts: 37
Joined: 13. May 2007, 10:19
Location: Paris

Postby chamstar » 22. Jun 2007, 16:19

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...
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby gushy » 11. Jul 2007, 15:40

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....
Last edited by gushy on 12. Jul 2007, 13:10, edited 3 times in total.
--
Gushy
gushy
 
Posts: 7
Joined: 11. Jul 2007, 13:30

Postby chamstar » 11. Jul 2007, 16:25

Perfect but failed on step one. Whats up with the link, looks like the binary is getting rendered as text!
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby gushy » 11. Jul 2007, 16:29

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.
--
Gushy
gushy
 
Posts: 7
Joined: 11. Jul 2007, 13:30

Postby chamstar » 12. Jul 2007, 12:02

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...
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby gushy » 12. Jul 2007, 12:24

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   Expand viewCollapse view
wget -c http://www.virtualbox.org/download/testcase/vditool
--
Gushy
gushy
 
Posts: 7
Joined: 11. Jul 2007, 13:30

Postby chamstar » 12. Jul 2007, 12:47

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...
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Postby gushy » 12. Jul 2007, 12:49

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
--
Gushy
gushy
 
Posts: 7
Joined: 11. Jul 2007, 13:30

Postby chamstar » 12. Jul 2007, 12:52

Oh right, thanks. And as I have just found out you can use the Virtual Disk Manager GUI from Virtual Box's File menu :)
chamstar
 
Posts: 21
Joined: 20. Jun 2007, 18:09

Next

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 21 guests