Howto increase hard disk size after installing a guest OS

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

Re: Howto increase hard disk size after installing a guest OS

Postby pattimichelle » 18. Jul 2010, 18:18

I know this might seem moot - but I needed more working space for editing video files and didn't want to clone my existing VM. So all I did was add another SATA controller to the existing VM, then I added a virtual hard drive to the new controller, then went through the (OpenSuSE) Partitioner to format it and add an fstab entry for me, and presto! Plenty of room to edit videos as long as I edit them on the added hard drive. Linux tends to use drives this way - even setting up separate home and root partitions.

One thing that seems curious - if I add a big *shared* folder, some linux apps only see the size of the virtual hard drive to which guest is installed, even though the shared folder is on a *huge* drive. Is this a Linux thing or a VB thing?

Patti
pattimichelle
 
Posts: 25
Joined: 29. May 2010, 22:05
Primary OS: openSUSE
VBox Version: PUEL
Guest OSses: WinXP

Re: Howto increase hard disk size after installing a guest OS

Postby yonas » 5. Aug 2010, 17:07

sunbod wrote:I ran into this same problem myself a little while back.

....
Firstly create a new vdi, under ~/.VirtualBox/HardDisks
#VBoxManage createhd -filename new.vdi --size 10000 --remember
#VBoxManage clonehd old.vdi new.vdi --existing

....
Cheers Steve


This worked for me!
yonas
 
Posts: 2
Joined: 5. Aug 2010, 06:21
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: xx

Re: Howto increase hard disk size after installing a guest OS

Postby gmchenry » 5. Oct 2010, 11:04

I managed to do it before I came across this forum & registered.

My host is Linux Mint 64 bit and my troubled guest was Windows XP (32 bit) with a 10GB VDI at full capacity.

I wanted to extend it to 20GB. So this is what I did:

1. Attached a newly created 20GB VDI as the primary slave.
2. Boot into XP to initialise it, but leave it unpartitioned & formatted. Shut down or reboot.
3. Mount Clonezilla (I used clonezilla-live-1.2.3-27.iso but there are newer versions available) to the optical drive in the settings. Restart the VM.
4. Boot into Clonezilla & choose language, then "don't touch keymapping", "Start_Clonzilla", "device-device" (2nd option), "Beginner", "disk_to_local_disk".
5. It will ask you to choose source - select your smaller VDI (/dev/sda or /dev/hda - the size is shown too). Select destination - the only selection left.
6. Select Yes to everything, even the capital Y for copying the boot sector.
7. Cloning will start and will even create the partition for you on the new VDI.
8. Once finished, select 1 for reboot. Clonzilla will give you the time to unmount - richt-click the CD icon on the bottom of your VM and select unmount. Press enter.
9. Boot in XP again on the original VDI. Just to prove a point, right-click My Computer and select manage, then disk management. You will see your new cloned partition & unallocated space after it. If you want to make another volume, right-click and make one and finish there.
10. Since I wanted to make the whole disk 1 volume, I opened command prompt and entered "diskpart"
11. Type "list volume" to display the existing volumes on the computer.
12. Type "Select volume {volume number}" where {volume number} is number of the volume that you want to extend. Mine was 2.
13. Type "extend". If you still have disk management open, you will see the volume increase quickly.
14. Type "exit" to leave diskpart.
15. Poweroff then remove your original VDI and change your new VDI to Primary Master then reboot.
16. Enjoy! :-)
gmchenry
 
Posts: 3
Joined: 5. Oct 2010, 10:23
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows XP, Open Solaris

Re: Howto increase hard disk size after installing a guest OS

Postby wilgert » 21. Oct 2010, 18:32

gmchenry wrote:I managed to do it before I came across this forum & registered.
[...]


Worked like a charm, you are my hero!
wilgert
 
Posts: 1
Joined: 21. Oct 2010, 18:23
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Howto increase hard disk size after installing a guest OS

Postby fuhrj » 21. Oct 2010, 21:55

gmchenry wrote:I managed to do it before I came across this forum & registered.


Many thanks for the detailed steps!

My guest OS was Windows 7 64-bit and I had to do two additional steps to get this to work.

Just before step 10, running diskpart, I had to bring the new volume online before it would show in diskpart's list volumes. To do this, right click on the icon that says "Disk 1" and select Online.

Lastly, after I de-selected the original VDI and made the new VDI primary, the VM would not boot. I got the device not bootable error. To fix this, I booted into Windows 7 installation disk and chose Repair Disk. It found the missing boot sector (I assume) and fixed it.
fuhrj
 
Posts: 1
Joined: 21. Oct 2010, 21:44
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows 7 64

Re: Howto increase hard disk size after installing a guest OS

Postby odoyle81 » 18. Nov 2010, 07:58

Hi I'm hoping someone can help..I'm trying to follow the instructions posted here and elsewhere to increase the size of my vdi, but gparted won't recognize my "old" disk..it just says unallocated space..
I've searched online for a solution and tried both clonevdi and vboxmanage to make clones but I can't get this to work and I'm pretty frustrated.. any help would be appreciated.

Thanks!
odoyle81
 
Posts: 24
Joined: 18. Nov 2010, 07:55
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Howto increase hard disk size after installing a guest OS

Postby mpack » 18. Nov 2010, 14:52

odoyle81 wrote:Hi I'm hoping someone can help..

I would suggest that here is not the place for a complex discussion about one users problems - you should start a new thread for that.
mpack
Site Moderator
 
Posts: 31463
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Howto increase hard disk size after installing a guest OS

Postby Talley123 » 19. Dec 2010, 01:09

Try this link.Easy to follow.

http://www.my-guides.net/en/content/view/122/26/


Talley
Talley123
 
Posts: 2
Joined: 7. Nov 2010, 19:44
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: windows 7

Re: Howto increase hard disk size after installing a guest OS

Postby trondhuso » 19. Dec 2010, 14:41

I have used the how-to/tutorial in before mentioned post twice with great success, so I can definitely recommend it.
trondhuso
 
Posts: 1
Joined: 19. Dec 2010, 14:38
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: WindowsXP

Re: Howto increase hard disk size after installing a guest OS

Postby stefan.becker » 19. Dec 2010, 14:46

That are all very complex ways.

With Windows Vista and 7 guests its quite easier:

- Cloning image with CloneVDI, check resize option
- Start Guest, resize partition in the system control / disk manager
stefan.becker
Volunteer
 
Posts: 7603
Joined: 7. Jun 2007, 21:53

Re: Howto increase hard disk size after installing a guest OS

Postby AlamyLiu » 11. Apr 2011, 07:20

1. Change guest OS H.D. size
VBoxManage modifyhd <filename> --resize <size>
2. Use GParted tool to resize partition size.
(download GParted from http://sourceforge.net/projects/gparted/, boot from CD.)
Attachments
ResizeVBox_08.GParted_ResizePartition.jpg
ResizeVBox_08.GParted_ResizePartition.jpg (106.07 KiB) Viewed 53480 times
ResizeVBox_01.ModifyHD.jpg
ResizeVBox_01.ModifyHD.jpg (65 KiB) Viewed 53474 times
AlamyLiu
 
Posts: 1
Joined: 11. Apr 2011, 07:08
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: 4.0.4 r70112

Re: Howto increase hard disk size after installing a guest OS

Postby deegowd » 14. May 2011, 00:31

I had a 4G XP guest and wanted to extend the size. I just cloned the existing partition to a newly created 10G partition and booted from the new one. However, the guest was still showing only 4G for the C drive, and another 6G as unallocated. Just downloaded a partition manager from download.com and extended the C drive. Viola! I had 7G of free space.
deegowd
 
Posts: 1
Joined: 14. May 2011, 00:28
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: XP

Re: Howto increase hard disk size after installing a guest OS

Postby Firetrue » 1. Jun 2011, 04:59

I am brand-new to VirtualBox and after setting up a clean OS install and getting all the updates and misc prep installs so that it would make for a good clone, then searched and found the commands for cloning the vdi.... Made my clone, and then was going to install a server on one of my clones and surprise! Not enough disk space! (I thought dynamically expanding meant I'd always have enough space - maybe I'm missing something). SOOOO I was looking for a solution tonight to this problem and after some frustration a simple idea popped into my head that I thought might let me squeeze what I needed onto the disk...

I noticed in the Virtual Media Manager that the Actual size of the vdi was about 16.5 GB while the guest OS showed only .99 GB of 20 GB free. So I just copied a 990 MB file onto a temp folder on the Guest OS from a CD, then rebooted and once again I had a new free GB on the guest os HDD (foced the Page file on it if I'm guessing right). I did this several times until I had expanded the actual disk size to 20 GB. Then I deleted the temp files on the guest os, which left my disk with about 3.5 GB free (what I needed at the time) and installed the software that I previously didn't have space for. Not a real fix or even much of a work-around, but also not terribly time consuming and possibly gets you out of reinstalling a new OS and everything else you might have running on it already (worked for what I needed in this one instance). Honestly in my case I'm going to start from Scratch for the rest of my clones and build a new standard with a larger hard disk (I've got a lot of additional clones I want to make for the test-lab). It just happened to get me by for this one server since I don't have to worry about it growing much. Take it for what it's worth.
Firetrue
 
Posts: 1
Joined: 1. Jun 2011, 04:12
Primary OS: MS Windows 7
VBox Version: OSE self-compiled
Guest OSses: W2K8R2

Re: Howto increase hard disk size after installing a guest OS

Postby mpack » 1. Jun 2011, 12:08

Firetrue wrote:So I just copied a 990 MB file onto a temp folder on the Guest OS from a CD, then rebooted and once again I had a new free GB on the guest os HDD (foced the Page file on it if I'm guessing right).

Total nonsense I'm afraid. Copying 1MB of data onto a dynamic expanding drive does not increase the drive size, it only expands the space taken by the file on the host - taking it somewhat closer to the maximum size set at creation. This will not make it possible to put even one byte extra onto the drive.

I think what you really need to do is read the user manual, particularly the section on virtual storage. Understand what a dynamic drive is.
mpack
Site Moderator
 
Posts: 31463
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Howto increase hard disk size after installing a guest OS

Postby TimHerb » 4. Jun 2011, 20:51

FWIW here's another vote for gparted (forgot how to use the VB clone command). I just used the method here <http://www.modhul.com/2008/10/21/re-sizing-a-virtualbox-virtual-disk-image-file/>
to double the .vdi size on laptops and a desktop with three different linux host and VB versions. Of note, WinXP did insist on a chkdsk on the first boot with the new drive, but that was uneventful. Also, it's not necessary to burn a gparted start disk - just temporarily set the CD .iso as your boot device for the virtual machine and let 'er rip.
TimHerb
 
Posts: 11
Joined: 7. Feb 2009, 23:44
Primary OS: Mandriva
VBox Version: PUEL
Guest OSses: WinXP

PreviousNext

Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 22 guests