If you run out of disk space on a Hyper-V virtual machine, thank your lucky stars that the processing of increasing the disks capacity is less complicated and less risky than repartitioning a physical disk. In the example below, we are going to increase the disk capacity of a virtual machine running on a Hyper-V host server.

To begin, make sure you have a recent working backup of the VM. As with any changes, there are risks, albeit very low risk but nonetheless it’s best practice to back up before making any types of changes on production systems.

As you can see below, the VM is running out of disk space.

image

Log in to the Hyper-V host and gracefully shut down the VM

image

Once the VM if off, edit the VM settings.

image

Locate the hard drive that needs to be expanded and edit the VHDX file.

image

When prompted, choose expand to increase the size of the virtual disk.

image

Select a larger capacity disk size and enter it into the new size field.

 

image

Click finish then start the VM. Once the VM has started, log in to the VM’s desktop UI. Open a command prompt with administrative rights and run the command diskmgmt.msc to open the disk management console. In the dism manager, you will notice two partitions. The first is the current disk capacity and the second is the additional capacity we created in the previous step.

image

Right click on the original partition (1) and select extend volume.

image

The select disks dialog box should show the additional partition already showing in the selected partition window.

image

Click next,  then finish and you should now see a single partition of increased capacity.

image

Your operating system should immediately detect and update the disk size, if it does not, restart your VM.

image

Leave a comment

Your email address will not be published. Required fields are marked *

error: Sorry, copy/paste is disabled
Skip to content