Page 1 of 2
Cannot use cloned VDI
Posted: 9. Dec 2013, 03:23
by pepe_gotera
Hi everybody!
I have several virtual machines with fixed size VDI disks which I need to resize. Following the instructions, firstly I need to clone them in order VBoxManage to create dynamic VDIs. After cloning my first disk, I try to use it with the .vbox file and it doesn't run. VB says nothing but researching by myself I deduce it's a problem with the "uuid". I have changed in the VirtualBox.XML the old uuid to the new uuid assigned by VBoxManage to the cloned VDI, but it doesn't work neither.
What do you think it is happening?
Thanks and regards!
Re: Cannot use cloned VDI
Posted: 9. Dec 2013, 18:09
by mpack
Create a new VM around the clone VDI. Or (if the old VM did not use snapshots), use the Storage panel in the guest settings to disconnect the old drive and mount the new one.
For best results, copy the VDI into the VM folder before connecting to the VM. That ensures you follow the convention that all VM related files can be found in the same folder.
Re: Cannot use cloned VDI
Posted: 9. Dec 2013, 21:41
by pepe_gotera
mpack wrote:Create a new VM around the clone VDI. Or (if the old VM did not use snapshots), use the Storage panel in the guest settings to disconnect the old drive and mount the new one.
For best results, copy the VDI into the VM folder before connecting to the VM. That ensures you follow the convention that all VM related files can be found in the same folder.
Thank you.
I did it but two strange things happened:
1. Cloned VDI is so much smaller (from 18GB to 11GB), but if I start the virtual machine and look the properties of the hard disk, it tells me 18GB.
2. Cloned VDI does not save its state.
Are both normal?
Thanks!
Re: Cannot use cloned VDI
Posted: 9. Dec 2013, 21:47
by mpack
It's normal for a disk to get smaller during cloning if it contained lots of zero sectors or you selected "compact", or especially if you converted from fixed size to dynamic.
As for "Cloned VDI does not save it's state", I'm not sure what that means. A VDI doesn't have a state - it's just a container. I assume you understand the distinction between cloning a VDI and cloning a VM?
Re: Cannot use cloned VDI
Posted: 10. Dec 2013, 03:01
by pepe_gotera
mpack wrote:It's normal for a disk to get smaller during cloning if it contained lots of zero sectors or you selected "compact", or especially if you converted from fixed size to dynamic.
As for "Cloned VDI does not save it's state", I'm not sure what that means. A VDI doesn't have a state - it's just a container. I assume you understand the distinction between cloning a VDI and cloning a VM?
Thank you!
I'm not an expert in virtual machines. I understand now what you mean (the difference between cloning a VM and cloning a VDI).
Talking about the first problem... why if the cloned VDI is now 11GB sized, the disk's properties in Windows once the machine has been started, tells me 18GB? Sould not tell it 11GB?
In the other hand, is it possible to resize a VDI file with any tool or similar? My goal is to resize the VDI used in my VM and use it again as if it had not been resized (I don't want to restart the VM, I want to use it saved as usual).
Regards!!!
Re: Cannot use cloned VDI
Posted: 10. Dec 2013, 11:32
by mpack
The capacity of a disk (reported by the guest) is not changed by compaction. The only thing that compaction changes is how much space the file occupies on the host. With dynamically allocated disks the host disk space is allocated on demand (when the guest writes to new areas of the disk. In fixed disks it's all allocated up front, even if the guest will never need it.
It might be worth your while to read up on disk types in the user manual.
Re: Cannot use cloned VDI
Posted: 13. Dec 2013, 05:26
by pepe_gotera
mpack wrote:The capacity of a disk (reported by the guest) is not changed by compaction. The only thing that compaction changes is how much space the file occupies on the host. With dynamically allocated disks the host disk space is allocated on demand (when the guest writes to new areas of the disk. In fixed disks it's all allocated up front, even if the guest will never need it.
It might be worth your while to read up on disk types in the user manual.
So maybe the solution is firstly convert the statics disks into dynamic, isn't it? Is it possible?
Re: Cannot use cloned VDI
Posted: 13. Dec 2013, 11:36
by mpack
You've lost me. The solution to what? Your second post implied that you had solved all problems and only needed to understand the effect of compaction. If the drive was successfully compacted then it's already in dynamic format since you can't compact fixed size drives.
Re: Cannot use cloned VDI
Posted: 14. Dec 2013, 02:42
by pepe_gotera
mpack wrote:You've lost me. The solution to what? Your second post implied that you had solved all problems and only needed to understand the effect of compaction. If the drive was successfully compacted then it's already in dynamic format since you can't compact fixed size drives.
Well, what I meant is to resize (but not by cloning it) the VDI machine in order to it shows the new real new size. Is there any tool to do it? I think that it cannot be done by using VirtualBox tools...
Thanks!
Re: Cannot use cloned VDI
Posted: 14. Dec 2013, 12:52
by mpack
You should probably read the tutorial:
Howto: Resize a Virtual Drive. Read the whole thing.
Re: Cannot use cloned VDI
Posted: 15. Dec 2013, 22:32
by pepe_gotera
First resizing does not work if the guest has snapshots nor will it work on Fixed drives.
I have asked about any independent tool or something like that. I already knew it does not work with snapshots nor fixed drives by using the original tools...
In the other hand, is there any way to see the real size of the disk in the guest OS after having cloned the VDI file?
Thanks!
Re: Cannot use cloned VDI
Posted: 15. Dec 2013, 23:49
by Perryg
Did you read the link at all? It tells you in step two what you use.
Re: Cannot use cloned VDI
Posted: 16. Dec 2013, 02:13
by pepe_gotera
Perryg wrote:Did you read the link at all? It tells you in step two what you use.
Yes, but the new size of my VDI disk is
smaller than the original one instead of bigger what these instructions are talking about.
Do the instructions work also for new smaller disks?
Thanks!
Re: Cannot use cloned VDI
Posted: 16. Dec 2013, 02:17
by mpack
Your disk capacity is not smaller, only the host file size is smaller.
You need to understand the difference between what is being simulated (a drive of a particular size), and the means of that simulation (a file on the host).
Re: Cannot use cloned VDI
Posted: 19. Dec 2013, 01:25
by pepe_gotera
mpack wrote:Your disk capacity is not smaller, only the host file size is smaller.
You need to understand the difference between what is being simulated (a drive of a particular size), and the means of that simulation (a file on the host).
I understand it. Whis would be the form of fixing it?
Regards!