Saturday, August 9, 2025

how to increase space of c drive in virtual machine hyper-v

 








✅ 2-Step Process:

Step 1: Expand the virtual hard disk (.vhdx)

(This increases the size of the disk itself)

Step 2: Extend the C: drive inside Windows

(This tells Windows to use the new free space)


🔧 STEP 1: Expand VHDX in Hyper-V

  1. Shut down the VM (Important: Cannot resize a running VM).

  2. Open Hyper-V Manager.

  3. Right-click the VM > Settings.

  4. In the Hardware list, find the Hard Drive under IDE Controller or SCSI Controller.

  5. Click on the hard disk path (e.g., C:\HyperV\VMName\disk.vhdx).

  6. Click Edit (next to the disk path).

  7. Click Next > Choose Expand.

  8. Enter the new size (e.g., increase from 60 GB to 100 GB).

  9. Click Finish.


💻 STEP 2: Extend C: Drive in Windows (After Boot)

  1. Start the VM normally.

  2. Log in and open Disk Management:
    Press Windows + R → Type diskmgmt.msc → Enter.

  3. You will see Unallocated space next to the C: drive.

  4. Right-click the C: drive → Click Extend Volume.

  5. Use the full unallocated space or specify how much you want.

  6. Click NextFinish.


📌 Notes:

  • Works for .vhdx disks only (not .vhd unless converted).

  • C: drive must be on the same disk you're expanding.

  • If C: is not adjacent to unallocated space (rare), use tools like MiniTool Partition Wizard or GParted.


🧯 Optional: Check Space After

Open Command Prompt and run:

wmic logicaldisk get size,freespace,caption