Can vhd size be greater than physical disk?

This is for discussing general topics about how to use VirtualBox.
Post Reply
rlincolnh
Posts: 5
Joined: 9. Oct 2009, 03:36
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: win2k

Can vhd size be greater than physical disk?

Post 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
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can vhd size be greater than physical disk?

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
NeBlackCat
Posts: 154
Joined: 3. Aug 2008, 13:37

Re: Can vhd size be greater than physical disk?

Post 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).
Post Reply