Howto increase hard disk size after installing a guest OS

This is for discussing general topics about how to use VirtualBox.
Post Reply
usmanaziz
Posts: 1
Joined: 8. Jun 2007, 09:53
Location: London

Howto increase hard disk size after installing a guest OS

Post by usmanaziz »

Hi, I created a hard disk with 2.5GB and installed Windows XP guest on an Ubuntu host.

However I have used up all the 2.5GB space. Is there a way I can increase the 2.5GB easily?

Thank you
Usman
klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Post by klaus »

No. Just like a real hard disk cannot be extended easily just because it's full. Eventually we'll implement increasing (and decreasing) the size of a disk image, but that's quite some (tedious) work and currently has no particularly high priority. Help is always welcome.
gusgan
Posts: 4
Joined: 6. Jun 2007, 12:43

Increase harddisk space

Post by gusgan »

Maybe this is a solution:
Add another virtual harddisk with increased space, install a disk-cloning software (e.g. TRUEIMAGE) on the first, clone this to the new one, delete the first and boot from the new one.
Don't know, if this would work, was just an idea.
reiki
Posts: 17
Joined: 8. Jun 2007, 13:40

Post by reiki »

I just cloned a vdi yesterday. Couldn't you use cloning to do this?

VBoxManage clonevdi oldimage newimage

Then create a new machine, give it the same specs as the old machine but with more disk space, and use newimage as the .... image... and start it up.

Would that work?
klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Post by klaus »

Cloning produces a VDI with exactly the same size as the original. No solution.
flox
Posts: 3
Joined: 8. Jun 2007, 01:28

Post by flox »

Another solution (not tested).

- Get an ISO of GParted LiveCD (or any liveCD with GParted).
- Create a larger VDI image (empty)
- Attach the ISO and the new VDI to the VM
- Boot the VM on the LiveCD with both VDI attached (small and large)
- Launch GParted
- Copy partition to new disk
- Increase the new partition to match all the VDI space
- Then stop the VM and re-arrange the VDI attached.

Maybe it could work...

--
Florent
AndreGeek
Posts: 6
Joined: 10. Jun 2007, 22:19

Post by AndreGeek »

Right now you can just add one or two additional hard drives to the Virtual Machine. I would like to know if using something like GParted works. That would be beneficial to many.
bitseeker
Posts: 16
Joined: 21. Jun 2007, 22:19

Post by bitseeker »

I would treat this as if it was a physical machine with physical drives and you were upgrading the boot drive to a bigger one:

1. Back up existing OS & files (this could be to an external drive, file server or another disk image)
2. Create and register new big disk image
3. Mount big disk image as secondary drive
4. Restore OS & files to big disk image
5. Shut down VM and mount big disk image as primary drive
vdal
Posts: 2
Joined: 24. Jun 2007, 21:33

Changing vdi size

Post by vdal »

Just to confirm that GusGan's approach works just fine for XP, at least.

I managed to clone a physical machine to VirtualBox with the help of TrueImage, but found 10GB was far more than I really needed once I had cleared out a load of unneeded applications.
So after closing down, I unhooked the 10GB image from its VM and attached it as a first slave to an XP VM on which TrueImage is installed, and then created and attached a 6GB vdi as a second slave.
I then used TrueImage to clone the contents of the 1st slave "down" to the 2nd slave.
"Powered down", unhooked the 6GB from the XP VM and attached it to the previously 10GB VM. Done!

I would think the same technique ought to work for a Linux vdi. It's also possible other imaging/partitioning programs could be used. Ranish, perhaps?

Oddly, TrueImage wouldn't "restore" directly from a .tib image on a USB drive attached to a VM. However, I restored from the .tib to a normal partition on the same drive (on a physical XP setup), after which TrueImage happily cloned from the restored partition to a .vdi.

A word of warning - cloning from a physical machine is not necessarily straightforward: I had to remove some drivers (AGP and processor), and do a repair install.
vdal
Posts: 2
Joined: 24. Jun 2007, 21:33

Post by vdal »

Just thought I'd also try flox's idea: bit scary because I'm not a Linux maven, but the GParted LiveCD happily "upcloned" a 4GB Win2k to a 5GB dynamic vdi - and even produced a slightly smaller file in the process.
There's no help on the liveCD, but the documentation on the GParted site almost walks you through the process, except it doesn't mention that you have to commit each pending operation as you go along!
Not as slick as TrueImage, but does the job - and it's free.
ubub
Posts: 1
Joined: 19. Aug 2007, 22:27

Norton ghost // true image // Debian 4.0 // 2.6.18-4-amd64

Post by ubub »

Hello

For sake of complete informations

I tried to clone a hardrive with norton ghost 8.0 under a xp guest machine.

It did not work..

When i reboot it starts xp when i log on it will immediatly log off.
I tried it twice.

I tried the suggested method for cloning harddrives in order to increase or decrease harddrive space with true image and it did work.

Debian 4.0 // 2.6.18-4-amd64 // VirtualBox1.4.0
reptile
Posts: 22
Joined: 21. Jul 2007, 13:53

Post by reptile »

I did this ages ago using acronis disk manager partition software.

I created a new dynamic disc and added it to the machine.

i opened up the disk manager sofware and chose to copy the partition and mbr

then it asked if i wanted it resized to fit the space and i said yes.

it worked perfectly.
de.linux.user
Posts: 20
Joined: 10. Aug 2007, 20:02

Post by de.linux.user »

another thing you could do is to just assign another disk-image as second harddrive to the VM. not the smoothest solution but should help.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

Make a new install with a big vdi.

costs not so much time as trying all these workarounds.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

stefan.becker wrote:Make a new install with a big vdi.

costs not so much time as trying all these workarounds.
We are looking for solutions, not for time.
Post Reply