Page 1 of 1

Can vhd size be greater than physical disk?

Posted: 9. Oct 2009, 04:53
by rlincolnh
Hi all, I'm a new VBOx user, really happy with it. I have a couple of questions that were triggered by my discovery of this link
http://technet.microsoft.com/en-us/sysi ... 56415.aspx
This creates a snapshot of e.g. my running Windows 7 system. Is it possible (or reasonable to expect) that I could set the resulting vhd as the system disk in a VBox VM? Would the integration components work? Or is it all a bit much to hope for?

My second question relates to the subject of this post. If I do create a vhd as a snapshot of my running system, I presume that the vhd will have a notional maximum size equal to the size of my physical system partition. Assuming that it is possible to run that vhd as the system disk in a VM, would VBox have any conceptual problems with the potential size of the vhd being greater than the remaining space on my real disk?

I hope I've expressed my thoughts clearly enough to get a useable answer :?

Roger

Re: Can vhd size be greater than physical disk?

Posted: 9. Oct 2009, 10:21
by Sasquatch
If you get a fixed size VHD, then it won't work no matter what you try. Can you fit one liter of water in a drinking glass? It would spill all over so that's no good. If it's a dynamic VHD, then it can be possible, as long as the file itself isn't larger than the free space.

Let's say you start with a clean VM and VDI. You make the VDI 500 GB on a 250 GB disk. That's possible (haven't tried it, maybe there's a check to avoid this kind of thing) as long as it's a dynamic VDI. The Guest will see the whole 500 GB and use it, to a certain extend. You can't put more data in it than the physical disk has free space (in the case of a 250 GB disk, you will effectively have 232 GiB). The moment you hit the limit, the VM will be paused and shall never boot again until you free up space or move the VDI to a larger physical drive.

Re: Can vhd size be greater than physical disk?

Posted: 13. Oct 2009, 04:29
by NeBlackCat
rlincolnh wrote: This creates a snapshot of e.g. my running Windows 7 system. Is it possible (or reasonable to expect) that I could set the resulting vhd as the system disk in a VBox VM? Would the integration components work? Or is it all a bit much to hope for?
Alternatively you can snapshot your physical hard drive to a format that vbox can directly use (vmdk) using the free VMWare Converter tool. You could then convert it to a VDI with vbox's tools if you really wanted to.

It's also possible to make a boot CD to do that from outside of your running OS, if you don't want to install anything and/or want to ensure that you get a 100% consistent image.

What you then have to do to get that image working on a VM is something else ("P2V") and there are many discussions about it here (see here for an idea).