Howto increase hard disk size after installing a guest OS

This is for discussing general topics about how to use VirtualBox.

Howto increase hard disk size after installing a guest OS

Postby usmanaziz » 8. Jun 2007, 10:01

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
usmanaziz
 
Posts: 1
Joined: 8. Jun 2007, 09:53
Location: London

Postby klaus » 11. Jun 2007, 10:43

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.
klaus
Oracle Corporation
 
Posts: 234
Joined: 10. May 2007, 14:57

Increase harddisk space

Postby gusgan » 11. Jun 2007, 12:53

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.
gusgan
 
Posts: 4
Joined: 6. Jun 2007, 12:43

Postby reiki » 11. Jun 2007, 13:18

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?
reiki
 
Posts: 17
Joined: 8. Jun 2007, 13:40

Postby klaus » 11. Jun 2007, 13:28

Cloning produces a VDI with exactly the same size as the original. No solution.
klaus
Oracle Corporation
 
Posts: 234
Joined: 10. May 2007, 14:57

Postby flox » 11. Jun 2007, 17:41

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
flox
 
Posts: 3
Joined: 8. Jun 2007, 01:28

Postby AndreGeek » 11. Jun 2007, 23:11

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.
AndreGeek
 
Posts: 6
Joined: 10. Jun 2007, 22:19

Postby bitseeker » 21. Jun 2007, 22:35

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
bitseeker
 
Posts: 16
Joined: 21. Jun 2007, 22:19

Changing vdi size

Postby vdal » 24. Jun 2007, 22:09

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

Postby vdal » 24. Jun 2007, 23:28

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.
vdal
 
Posts: 2
Joined: 24. Jun 2007, 21:33

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

Postby ubub » 19. Aug 2007, 22:35

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
ubub
 
Posts: 1
Joined: 19. Aug 2007, 22:27

Postby reptile » 30. Aug 2007, 13:48

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.
reptile
 
Posts: 22
Joined: 21. Jul 2007, 13:53

Postby de.linux.user » 30. Aug 2007, 14:23

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.
de.linux.user
 
Posts: 20
Joined: 10. Aug 2007, 20:02

Postby stefan.becker » 30. Aug 2007, 20:11

Make a new install with a big vdi.

costs not so much time as trying all these workarounds.
stefan.becker
Volunteer
 
Posts: 7046
Joined: 7. Jun 2007, 21:53

Postby Ingo » 30. Aug 2007, 20:23

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.
Ingo
Volunteer
 
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Next

Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 9 guests