How do I compact a Hyper-V VHD file?

In a nutshell, in order to shrink or compact virtual hard disks, you should do the following:

  1. Open Hyper-V Manager.
  2. Launch the Edit Virtual Hard Disk Wizard.
  3. Specify the virtual hard disk whose size you want to reduce.
  4. Select the action you want to perform (Shrink or Compact).
  5. Click Finish to accept the changes.

How do I shrink the size of a VHDX?

Shrink the VHDX File Click on the Edit button. Click Next. Select Shrink and then click Next. Set the New size to 128GB, and then click on the Finish button.

How do I reclaim storage space on Hyper-V virtual machine?

Make sure that the virtual machine is shut down, and then right click on the virtual machine and choose Settings from the shortcut menu. This will cause the Hyper-V Manager to open the virtual machine’s Settings page. Select the virtual hard disk that you want to compact, and click the Edit button shown in Figure 3.

How do I shrink the size of a virtual machine?

Go to the disk edit mode (Data to copy -> Edit). Select the copy mode: Select volumes to copy. Specify the new disk size for your new VM. As you can see, 48 GB is occupied in the guest OS, and the disk size is 150 GB.

How do I shrink a virtual drive?

Shrink the partition residing within a disk before reducing the size of a virtual disk. Non operating system disks users can also add a new smaller VMDK to the virtual machine and copy the data between the larger and new smaller disk using tools within the guest such as Robocopy.

Can we reduce the VMDK size?

To reduce the VMDK disk from 80 to 40 GB, we have to specify 83886080 in the Extent description section. Set the new size of the virtual disk using a text editor. From the down arrow key, go to the line containing the disk size. Specify the new size, save the changes and close the file.

How do I remove unallocated space from a virtual machine?

Remove unallocated space via Disk Management Or use “Windows+R” to open Run, type “diskmgmt. msc” in the empty box and tap “OK”. Right-click the unallocated space, and select “New Simple Volume”, then New Simple Volume Wizard will pop out, follow it to create a new partition.

How to work with Hyper-V and Windows PowerShell?

Working with Hyper-V and Windows PowerShell 1 Return a list of Hyper-V commands. Click on the Windows start button, type PowerShell. 2 Return a list of virtual machines. Use the Get-VM command to return a list of virtual machines. 3 Start and shut down virtual machines 4 Create a VM checkpoint. 5 Create a new virtual machine.

How to shrink or compact a Hyper-V virtual hard disk?

In a nutshell, in order to shrink or compact virtual hard disks, you should do the following: Open Hyper-V Manager. Launch the Edit Virtual Hard Disk Wizard. Specify the virtual hard disk whose size you want to reduce. Select the action you want to perform ( Shrink or Compact ). Click Finish to accept the changes.

How do I enable Out-GridView from Hyper-V using PowerShell?

Click on the Windows start button, type PowerShell. Run the following command to display a searchable list of PowerShell commands available with the Hyper-V PowerShell Module. Get-Command -Module hyper-v | Out-GridView You get something like this:

How do I return a list of Hyper-V PowerShell commands?

Return a list of Hyper-V commands Click on the Windows start button, type PowerShell. Run the following command to display a searchable list of PowerShell commands available with the Hyper-V PowerShell Module. Get-Command -Module hyper-v | Out-GridView You get something like this: