Step 1 — Expand the Virtual Disk (on the Hyper-V Host)
Resize-VHD -Path "D:\VMs\Server01\Server01.vhdx" -SizeBytes 100GBThe VM must be shut down (or the disk not currently in an active checkpoint/snapshot chain) for this to succeed against most disk types.
Step 2 — Expand the Partition (Inside the Guest)
Boot the guest, open a PowerShell session on the Server Core install, and check the partition and its supported maximum size:Get-Partition -DriveLetter C Get-PartitionSupportedSize -DriveLetter CThen resize the partition to fill the newly available space:
Resize-Partition -DriveLetter C -Size (Get-PartitionSupportedSize -DriveLetter C).SizeMaxRun
Get-Volume afterward to confirm the drive now reports the expected total size.
If Step 1 Fails: Common Reasons
A few things worth checking ifResize-VHD itself refuses to run before you get anywhere near the partition step: confirm the VM is fully shut down rather than saved/paused (a saved state can behave like the disk is still in use), confirm there isn’t an active checkpoint/snapshot chain on the disk (checkpoints lock the base VHDX against direct resize — you’d need to remove or merge checkpoints first), and confirm the Hyper-V host itself has enough free space on the underlying volume to accommodate the requested growth if the VHDX is dynamically expanding rather than fixed-size.
It’s also worth double-checking you’re targeting the correct file if the VM has multiple virtual disks attached — running Get-VMHardDiskDrive -VMName Server01 on the host lists every disk path attached to that VM, which is a safer way to confirm the exact path than guessing from the VM name alone, especially in environments where VHDX files aren’t stored in an obviously-named folder structure.
One more distinction worth knowing if you’re working across mixed environments: this Hyper-V-specific two-step process (host-level VHD resize, then guest-level partition resize) doesn’t directly apply to Azure VMs or VMware — Azure disk resizing is done through the Azure portal/CLI against the managed disk resource rather than Resize-VHD, and VMware uses its own vSphere-side disk expansion tools, though the guest-side Resize-Partition step is the same regardless of hypervisor once the underlying disk has actually grown.
Resources
Gear We Recommend
Running this in a home lab? Here’s the gear that keeps our test environment reliable.
Browse our Home Lab Essentials picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.