I would like to re-size a vm under virtualbox 4.3.10
I have seen a command VBoxManage modifyhd filename.vdi --resize 30720
Virtualbox does not have a .vdi file extension so I presume it has to be converted ?
I have also read that the physical hdd must be increased as well - and I don’t have any idea of how to do that
Is there any relevant howto for this. I have searched the opensuse forum and don’t find anything.
And what extension does it have?
A virtualbox virtual hard disk does have a .vdi extension, but VB does support other image types as well like vmware’s .vmdk (you can choose the type when creating a new virtual hard disk).
I do not know whether VB supports resizing of other image types though.
I have also read that the physical hdd must be increased as well - and I don’t have any idea of how to do that
No. Why should that be necessary? A virtual hard disk is just a file on your physical hard disk, like any other file.
Unless your physical partition is too small to hold your new hard disk image of course. Then you would indeed have to enlarge the physical partition.
Or copy the image file to a different, bigger physical partition.
Yes it has .vmdk I just went with the flow when I created the machine. I have read that a .vmdk can be converted to a .vdi
I have just moved to a larger hdd so have plenty of space.
When creating the virtual machine it asked if you wanted a dynamically increasing machine, to which I replied yes. It seems that this doesn’t mean what it says - as I ran out of space yet still had hdd space left.
The dynamic size means that you’ve set a maximum limit for the drive (for example 20GB) and it will take more space from the host drive as you use more room in the VM but will still cap it at 20GB.
The opposite of dynamic in this case is reserving the 20GB from the host drive instantly.
No, you didn’t.
For VirtualBox, .vdi is the default, this is VirtualBox’s native format.
As I wrote already, .vmdk are VMware’s virtual hard disk images.
I have read that a .vmdk can be converted to a .vdi
Yes, I think so.
But I would have to look that up.
Edit: See here: How to convert VirtualBox VDI to VMware VMDK disks
But have you tried to just specify the .vmdk file in VBoxManage?
I have just moved to a larger hdd so have plenty of space.
Good.
When creating the virtual machine it asked if you wanted a dynamically increasing machine, to which I replied yes. It seems that this doesn’t mean what it says - as I ran out of space yet still had hdd space left.
It means, that image is not as big as you set it to be, but only takes the space actually used, and expands itself as necessary until it has the maximum size.
F.e. an 8GiB image would need 8GiB disk space, although it is empty. With dynamically sized files, it would not need any space at all as long as it’s empty. If you fill one GiB (in the VM), the image file will grow to 1 GiB, and so on.
Maybe something to do with the fact that I created it on one machine and then exported to .ova image to use on this machine.
???
Sorry, I don’t follow you there.
With what program did you create it in the first place and export to .ova?
I don’t think exporting/importing it would change the file format.
But again: you can use/create .vmdk images with VirtualBox. It’s just not the default…
Just checked on home machine - it was created as a .vdi and exported with a tick on the “Write legacy OVF 0.9” box. These things happen when you aren’t sure of what to do. Now I know.
On Mon, 04 Aug 2014 14:36:01 +0000, wolfi323 wrote:
> I do not know whether VB supports resizing of other image types though.
It doesn’t - you have to convert it to a VDI and then increase the size.
Jim
–
Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C
For those who might want to do the same thing
I had a virtual machine that needed to be made bigger. It was in .vmdk format, due to me exporting it incorrectly - but it worked.
Firstly I cloned the physical drive onto a bigger one, giving me a lot more space.
In terminal, I couldn’t get to the folder as the directory where virtualbox saves the vms which was called VirtualBox VMs by default and bash doesn’t like spaces. So I renamed the folder VirtualBox_VMs and that worked. I then changed permissions for the file I wished to work with.
I used
VBoxManage clonehd source.vmdk target.vdi --format VDI
as shown in http://www.dedoimedo.com/computers/virtualbox-convert.html and got a .vdi file.
Next I had to enlarge the file and used
VBoxManage modifyhd target.vdi --resize 15360
and it worked very quickly. At this stage I set the name for the folder back to VirtualBox VMs.
I then had to get the .vdi into virtualbox and did this by creating a new vm in virtualbox (xp in my case) and in the creation could use a file, which was my enlarged .vdi file.
The vm started up fine, but my troubles weren’t over yet. Windows didn’t see the vm as enlarged. So I powered down the virtual machine, went to its settings and set it to boot from cd. I put in my parted magic disk and rebooted. Parted magic booted up and using gparted managed to resize the virtual disk. I powered down again and set the vm to boot from (virtual) hdd and started it. It worked !
On 08/05/2014 02:56 PM, Alastairo wrote:
>
> -For those who might want to do the same thing-
> I had a virtual machine that needed to be made bigger. It was in .vmdk
> format, due to me exporting it incorrectly - but it worked.
> Firstly I cloned the physical drive onto a bigger one, giving me a lot
> more space.
> In terminal, I couldn’t get to the folder as the directory where
> virtualbox saves the vms which was called VirtualBox VMs by default
> and bash doesn’t like spaces. So I renamed the folder VirtualBox_VMs
> and that worked. I then changed permissions for the file I wished to
> work with.
> I used
> Code:
> --------------------
> VBoxManage clonehd source.vmdk target.vdi --format VDI
> --------------------
> as shown in http://www.dedoimedo.com/computers/virtualbox-convert.html
> and got a .vdi file.
> Next I had to enlarge the file and used
> Code:
> --------------------
> VBoxManage modifyhd target.vdi --resize 15360
> --------------------
> and it worked very quickly. At this stage I set the name for the folder
> back to VirtualBox VMs.
> I then had to get the .vdi into virtualbox and did this by creating a
> new vm in virtualbox (xp in my case) and in the creation could use a
> file, which was my enlarged .vdi file.
> The vm started up fine, but my troubles weren’t over yet. Windows didn’t
> see the vm as enlarged. So I powered down the virtual machine, went to
> its settings and set it to boot from cd. I put in my parted magic disk
> and rebooted. Parted magic booted up and using gparted managed to resize
> the virtual disk. I powered down again and set the vm to boot from
> (virtual) hdd and started it. It worked !
FYI, spaces and other special characters in file names can be handled by Linux.
You do need, however, to “escape” them. Thus you could have referred to
VirtualBox\ VMs. The backslash character () says not to interpret the following
character in the usual way.
On Tue, 05 Aug 2014 19:56:02 +0000, Alastairo wrote:
> Windows didn’t see the vm as enlarged.
As you discovered, it won’t - extending the VDI file does not modify the
partition table (because to do so would be to assume the user’s
intention). As you found, you have to extend it after you boot the VM,
either with parted or with some other partitioning tool.
Jim
–
Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C
Seems to me simple alternative if anyone wants to avoid converting disk formats is to investigate whether a res-sizing utility exists for that format.
So, in this case it exists but is normally distributed with VMware Workstation but is always the case on the Internet you could probably find the file available somewhere.
This would be more of a problem when using the various disk file formats available when using QEMU/KVM, etc. I don’t remember all the details but I frequently found various disk formats didn’t support certain features natively, re-sizing being one.
On bit of advice, although not as critical as when you are shrinking the disk file, but it’s always a good idea to empty the trash, clear the temp directories and then zero out the empty disk space and defrag/compact the files inside before actually doing the shrinking or enlarging.
TSU
FYI, spaces and other special characters in file names can be handled by Linux.
You do need, however, to “escape” them. Thus you could have referred to
VirtualBox\ VMs. The backslash character () says not to interpret the following
character in the usual way.
Thanks - another useful tip.
On Wed, 06 Aug 2014 05:56:02 +0000, Alastairo wrote:
>> FYI, spaces and other special characters in file names can be handled
>> by Linux.
>> You do need, however, to “escape” them. Thus you could have referred to
>> VirtualBox\ VMs. The backslash character () says not to interpret the
>> following character in the usual way.
>
> Thanks - another useful tip.
Or enclose the filename/path in quotes.
Jim
–
Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C