Easy way to increase Virtualbox VM size?

I have a few VMs set up with virtualbox but am finding that I’m now running out of space in some of the VMs. I really don’t fancy creating new VMs and reinstalling and configuring them so is there an easy way to increase the size of the virtual disks? I googled and couldn’t find a simple solution so was wondering if anyone here had a tried and tested method.

No, it’s exactly the same problem as with physical disks since the guest OS can’t “know” that it’s using a virtual disk. Depending on the OS, it may be easy, or difficult.

With Linux partitions, you could do some sort of copy onto a larger “disk” and then expand the “partitions”.

On 27/07/10 16:06, suse tpx60s wrote:
>
> I have a few VMs set up with virtualbox but am finding that I’m now
> running out of space in some of the VMs. I really don’t fancy creating
> new VMs and reinstalling and configuring them so is there an easy way to
> increase the size of the virtual disks? I googled and couldn’t find a
> simple solution so was wondering if anyone here had a tried and tested
> method.
>
>

Not needed to do that, but what would you do with physical disks?

Probably use TrueImage (or similar) on CD to copy from disk 1 to disk 2
and then use disk 2? (CD = ISO file, disk n = virtual disk n)


PeeGee

Asus m/b M2V-MX SE, AMD LE1640, 2GB, openSUSE 11.2/11.0 x86_64 dual boot

  • XP Home in VBox
    Asus m/b M2NPV-VM, AMD 64X2 3800+, 2GB, openSUSE 10.3 x86_64/XP Home
    dual boot
    Acer Aspire 1350, AMD (M)XP2400+, 768MB, openSUSE 11.2/XP Home dual boot
    Asus eeePC 4G (701), Celeron M353, 2GB, openSUSE 11.2 on SSD

It depends on why your’re running out of space and what OS you’re running.

The good thing about large physical drives and virtual machines is that you can create a larger virtual HD and use the same utilities to move your space handicapped VM to the larger virtual HD. Or if you’re running LVM add to the volume group? There’s documentation on google somewhere but basically just create another larger virtual disk,

something like but not exactly so do not use


### on real machine terminal  
cp -p  /var/lib/xen/images/windowsxpsp2/disk0  ~/disk0.bkp
sudo dd if=/dev/zero of=/var/lib/xen/images/windowsxpsp2/disk1  count=1  seek=12G

then in/on the VM move to the larger virtual disk or simply use is it as additional space. For Windows VMs (Linux), I suppose you could run Partition Magic running on the VM to copy or clone the VM to the larger virtual disk. When you completely move to the new virtual disk you’ll need to change /var/lib/xen/images/.disk-list to point to the new virtual disk.

If you’re running out of space because your physical HD is running out space that’s a different story.

Apology tstorms starting and I’d too tired to search history for links. Do not follow my cryptic informational notes without doing a google search for documentation on adding/expanding space for virtual machines.

It’s a good question. I’ve got Windows XP Pro in VirtualBox container, unfortunately it’s too small (10Gb). Maybe some software like Acronis Disk Director will help? or - like somebody mentioned - copying to larger virtual HDD and extend partition then.

On 28/07/10 01:06, tararpharazon wrote:
>
[snip]
> SOMETHING LIKE BUT NOT EXACTLY SO DO NOT USE
> Code:
> --------------------
>
> ### on real machine terminal
> cp -p /var/lib/xen/images/windowsxpsp2/disk0 ~/disk0.bkp
> sudo dd if=/dev/zero of=/var/lib/xen/images/windowsxpsp2/disk1 count=1 seek=12G
>
> --------------------
[snip]

… not too much use for virtualbox users - I don’t have a “xen”
directory :slight_smile:


PeeGee

Asus m/b M2V-MX SE, AMD LE1640, 2GB, openSUSE 11.2/11.0 x86_64 dual boot

  • XP Home in VBox
    Asus m/b M2NPV-VM, AMD 64X2 3800+, 2GB, openSUSE 10.3 x86_64/XP Home
    dual boot
    Acer Aspire 1350, AMD (M)XP2400+, 768MB, openSUSE 11.2/XP Home dual boot
    Asus eeePC 4G (701), Celeron M353, 2GB, openSUSE 11.2 on SSD

Ok, a little confusing but I think I understand the principle now. Like ksx4system, I have a Windows XP VM which has now run out of space.I don’t have Partition Magic or any other Windows disk partitoning / imaging software so will have to see what I can find for free.

I’m still not 100% clear how they would work though as in my experience disk imaging tasks are usually done outside the OS after a reboot. So if it reboots the guest OS in the VM would the software still start within the VM but outside the OS?I guess I’ll need to experiment a little.

On 28/07/10 10:06, suse tpx60s wrote:
>
> Ok, a little confusing but I think I understand the principle now. Like
> ksx4system, I have a Windows XP VM which has now run out of space.I
> don’t have Partition Magic or any other Windows disk partitoning /
> imaging software so will have to see what I can find for free.
>
> I’m still not 100% clear how they would work though as in my experience
> disk imaging tasks are usually done outside the OS after a reboot. So if
> it reboots the guest OS in the VM would the software still start within
> the VM but outside the OS?I guess I’ll need to experiment a little.
>
>

I would attach an ISO image as the CD in Virtualbox and set it to boot
from CD. You could probably attach the physical CD on your system and do
the same thing. That way, the task is carried out “outside” the Guest
(XP) OS (not outside the host). You also need to attach the “new” drive
as a second drive for the VM (and format/partition with XP if you wish)
to receive the copy.

The point is that Virtualbox is “the hardware” and operates as such - a
reboot of the guest only restarts the VM.

As mentioned elsewhere, you could attach a “new” drive for the overflow
(or move your my Documents to it via the “right click” option).

HTH


PeeGee

Asus m/b M2V-MX SE, AMD LE1640, 2GB, openSUSE 11.2/11.0 x86_64 dual boot

  • XP Home in VBox
    Asus m/b M2NPV-VM, AMD 64X2 3800+, 2GB, openSUSE 10.3 x86_64/XP Home
    dual boot
    Acer Aspire 1350, AMD (M)XP2400+, 768MB, openSUSE 11.2/XP Home dual boot
    Asus eeePC 4G (701), Celeron M353, 2GB, openSUSE 11.2 on SSD

I’ll try as you suggest and boot from a CD in the VM…

[QUOTE=PeeGee;2197402]On 28/07/10 01:06, tararpharazon wrote:
>
[snip]

> SOMETHING LIKE BUT NOT EXACTLY SO DO NOT USE
> Code:
> --------------------
>
> ### on real machine terminal
> cp -p /var/lib/xen/images/windowsxpsp2/disk0 ~/disk0.bkp
> sudo dd if=/dev/zero of=/var/lib/xen/images/windowsxpsp2/disk1 count=1 seek=12G
>
> --------------------
[snip]

… not too much use for virtualbox users - I don’t have a “xen”
directory :slight_smile:

Well that’s why I added “something like” and “do not use”!!

Google should be able to find documentation on expanding disk space for Virtual Box.

IIRC, Xen not VirtualBox, you use a CD or ISO as the source for the OS.
Then you can create virtual HD space and or use an existing virtual HD space.
Then install the OS to the virtual HD space/file.

Hmm, your idea is to boot/install an OS using a Partition Magic CD with the old vHD file and the new larger vHD file might allow you to clone the old system to its newer larger space to my feeble mind sounds plausible.

One thing that shouldn’t change between openSUSE Hypervisor (Xen) and Virtual Box is backing up your virtual system before you lose it.

On 29/07/10 01:06, tararpharazon wrote:
>
> PeeGee;2197402 Wrote:
>> On 28/07/10 01:06, tararpharazon wrote:
>>>
>> [snip]
>>>>>> SOMETHING LIKE BUT NOT EXACTLY SO DO NOT USE
>>>> Code:
>>>> --------------------
>>>>
>>>> ### on real machine terminal
>>>> cp -p /var/lib/xen/images/windowsxpsp2/disk0 ~/disk0.bkp
>>>> sudo dd if=/dev/zero of=/var/lib/xen/images/windowsxpsp2/disk1
>>> count=1 seek=12G
>>>>
>>>> --------------------
>>> [snip]
>>>
>>> … not too much use for virtualbox users - I don’t have a “xen”
>>> directory :slight_smile:
>>>>>
>>
>> Well that’s why I added “something like” and “do not use”!!
>
>

Unfortunately, it is “nothing like” rather than “something like” - the
“do not use” is a definite :slight_smile:

I have not used xen, so haven’t read up on it, but I use Virtualbox on a
reasonably frequent basis for a few apps which don’t appear to have
suitable equivalents or to work under wine.


PeeGee

Asus m/b M2V-MX SE, AMD LE1640, 2GB, openSUSE 11.2/11.0 x86_64 dual boot

  • XP Home in VBox
    Asus m/b M2NPV-VM, AMD 64X2 3800+, 2GB, openSUSE 10.3 x86_64/XP Home
    dual boot
    Acer Aspire 1350, AMD (M)XP2400+, 768MB, openSUSE 11.2/XP Home dual boot
    Asus eeePC 4G (701), Celeron M353, 2GB, openSUSE 11.2 on SSD