Windows 8 and 8.1 Forums


Expanded virtual hard disk but it's still using small size

  1. #1


    Posts : 15
    Windows 8.1

    Expanded virtual hard disk but it's still using small size


    I have Windows 8 installed on a Hyper-V VM in Windows 8.1. It turned out that the size I originally allocated for the virtual hard disk was too small, so I went into settings for the VM and expanded it.

    But Windows 8 in that VM still sees only the smaller hard disk size.

    In Hyper-V manager, when I click Inspect for the virtual hard disk, it says that the "Current File Size" is the old, small size, while the "Maximum Disk Size" is the new, larger size.

    So, how do I get the OS installed in the VM to see the new, larger, expanded size?


    Thanks,

    Greg

      My System SpecsSystem Spec

  2. #2


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    Your virtual machine's vhd is as it should be, you have no issue. I will try to explain this below.

    Hyper-V uses three different types of virtual hard disks:
    1. Fixed size VHD
    2. Dynamically expanding VHD
    3. Differencing VHD


    1. Fixed size vhd

    A fixed size VHD is when stored on your host always the same size. If your vm has a 100 GB fixed size VHD it takes 100 GB storage space on your host regardless how much data is actually stored on it. A totally empty 100GB fixed size VHD takes 100 GB on host, a fixed size VHD with 60 GB data stored on it takes the same 100 GB storage space on your host.

    If you want your virtual machine to use a fixed size VHD you need to create the VHD first, then attach it to a vm as existing VHD. A fixed size VHD can be created in New Virtual Hard Disk Wizard (Hyper-V Manager > New > Hard disk):

    Click image for larger version

    In wizard select Fixed size:

    Click image for larger version

    Now create a vm with New Virtual Machine Wizard and use your existing fixed size VHD:

    Click image for larger version


    2. Dynamically expanding VHD


    The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.

    An example. I have a Windows 10 Technical Preview vm. When I created it I accepted the default 127 GB VHD size for it and later created another 127 GB VHD attaching it to the same vm. This W10 vm has now two 127 GB virtual hard disks attached to it:

    Click image for larger version

    Looking from inside the vm everything is as it should be:

    Click image for larger version

    However, if we check these two VHD files from the host, we can see they are only using just under 12 GB and 4 GB storage space on host:

    Click image for larger version

    Let's copy a big ISO file to vm and download some additional content on it to see what happens. You can see that the vm sees its hard disks exactly as they were, two 127 GB hard disks, only showing less free space because we have added about 5 GB worth of files:

    Click image for larger version

    Looking the same changes on host we can see that the size of the VHD file has been changed because it needed to expand to store the newly added 5 GB:

    Click image for larger version


    3. Differencing VHD


    Hyper-V uses differencing virtual hard disks to allow Checkpoints. A Hyper-V Checkpoint is a "snapshot" of the virtual machine state as it was when a checkpoint was created, allowing user to discard all changes later and restore the vm as it was. Read more about Hyper-V checkpoints at our sister site The Ten Forums: Hyper-V Checkpoints - Create and Use in Windows 10

    When you create a checkpoint of your parent VHD (original VHD where the OS is installed) it keeps record of changes (differences) on your vm which makes it possible to discard every change made since creating the checkpoint. A differencing VHD can have a fixed size VHD or a dynamically expanding VHD as its parent, in virtual machines with several virtual hard disks it can also have (it will have) more than one parent.

    VHD type for a differencing VHD cannot be changed nor can it be shrinked or expanded.

    Click image for larger version


    Summary:


    When you create a VHD in a New Virtual Machine Wizard, the resulting VHD is by default a dynamically expanding VHD, meaning it only uses as much space on your host (Hyper-V server) HDD as needed, expanding when it needs more space. The Maximum Disk Space shows how large you allow a dynamically expanding VHD to grow. You can check this easily by launching your vm and checking from its disk management how big the HDD is and compare it to VHD file size on host. The vm HDD always shows the same size but the VHD file on host expands when more space is needed.

    Remember the difference between a VHD file on host and a HDD on guest vm; a VHD file on your host is a normal HDD for your vm. A 10 GB VHD file on host can contain a 1 TB HDD for a vm.

    Quite a complicated explanation, I hope you got it .

    Kari
      My System SpecsSystem Spec

  3. #3


    Posts : 15
    Windows 8.1


    Thanks, but if I understand your explanation correctly, the guest OS should see the larger size. But it doesn't; it only sees the smaller size. And it's warning me of limited space and not doing Windows Update due to insufficient space.

    Did I miss a step after expanding the drive in the Hyper-V manager settings?
      My System SpecsSystem Spec

  4. #4


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    Open the settings for your vm, select the vhd and click Inspect, make a screenshot of the Virtual Hard Disk Properties. Then launch your vm, open the Disk Management on vm, enlarge the disk management windows so that everything can be seen and take a screenshot that.

    Post both screenshots here. Tutorials if needed:


    I want need to see these screenshots:

    1. Virtual Hard Disk Properties:

    Click image for larger version

    2. Disk Management of the vm, windows maximized so that everything is visible:

    Click image for larger version

    Also please tell how did you change the size of the vhd?
      My System SpecsSystem Spec

  5. #5


    Posts : 15
    Windows 8.1


    Thanks Kari, the step I missed was going into the Disk Management control panel in the guest OS, and extending the volume to use the additional space.
      My System SpecsSystem Spec

  6. #6


    Posts : 1,875
    Windows 10 Pro Prieview x64


    Quote Originally Posted by Kari View Post
    2. Dynamically expanding VHD

    The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.
    Note though that if you do a native boot to a dynamically expanding disk it will be expanded to full size (100GB here) on disk until you shut down at which point it will shrink again.
      My System SpecsSystem Spec

  7. #7


    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,452
    Windows 8.1 Pro with Media Center


    Quote Originally Posted by GregL65 View Post
    Thanks Kari, the step I missed was going into the Disk Management control panel in the guest OS, and extending the volume to use the additional space.
    Good to know .

    Quote Originally Posted by adamf View Post
    Quote Originally Posted by Kari View Post
    2. Dynamically expanding VHD

    The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.
    Note though that if you do a native boot to a dynamically expanding disk it will be expanded to full size (100GB here) on disk until you shut down at which point it will shrink again.
    Yes, of course. The system using the VHD sees it as a HDD as big as the maximum space allowed by the setup (user). If you boot a physical machine from a VHD, in order for the system to operate it needs to allocate the set maximum space on HDD.

    However, this thread, OP's question and my responses were about a virtual machine running in Hyper-V having nothing to do with booting from a VHD.
    Last edited by Kari; 19 Oct 2014 at 12:40.
      My System SpecsSystem Spec

Expanded virtual hard disk but it's still using small size
Related Threads
Unable to start Disk Management. I tried the following without success: - Check file integrity - Repair with DISM - Start the Virtual Disk Service and Volume SHadoy Copy manually and set them to Automatic and Manual (it starts, but Disk Management cannot connect to it) - Disable Firewall and...
Hello guys, i've solved the blue screen problem 0xc0000225 using EasyRE but now the problem is the total hard disk space it is showing as 200GB (mine is 1TB) i thought of taking backup of image file using OneKey Recovery but it says"Current System Cannot Support Backup" i'm confused :( help...
In my pictures folder, as well as all other folders that I have checked, the option to change the icon size larger or smaller is grayed out. Solutions I have found use the options to change settings, however, my options are also grayed out so I can't. Refer to my attachment for a view of my...
How to Convert Hyper-V Virtual Hard Disk to VHD or VHDX This tutorial will show you how to convert a Hyper-V virtual hard disk toVHD or VHDX in Windows 8and 8.1. This example will show you how convert a Hyper-V VHD to VHDX, although you are able to also convert VHDX to VHD. Also through...
How to Change Default Virtual Hard Disk Location in Hyper-V This tutorial will show you how to change the default location where your virtual hard disks (VHDs) are saved to in Hyper-V. If you change the default Virtual Hard Disk location you will still be able to change the location when...
virtual disk service? in General Support
what is the windows virtual disk service? never heard of it before... friend of mine on windows 8 saw it in his event log and he wants to know what it is, so..it falls to me to ask as he's not got regular internet access... that and I end up doing all his maintenance work for him somehow......
Hi there Since we are booting directly into a VHD this topic isn't really about Virtualisation per se -- so whether this post should be moved to Virtualisation --leave that for the Mods. Seems to me that running W8 from a VHD directly (I.E no HOST OS installed) would be really efficient and...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook