Just short note about it, as from time to time I need to increase volume size.
Part 1 - In host system
Get list of VMs
Get-VMTurn off the VM.
$vmName = "YourVirtualMachineName" Stop-VM -Name "$vmName"Expand the disk
Get-VHD -VMName $vmName Resize-VHD -Path "VHD_PATH" -SizeBytes 100GBCheck the changes
Get-VHD -VMName $vmNameStart the VM & connect to VM
Start-VM -Name "$vmName" Connect-VM -VMName "$vmName"
Part 2 - Inside VM
Install guest tools for VM (if it wasn’t done before)
sudo apt install cloud-guest-utilsWork with virtual disk
lsblk # to find the correct disk name and partition sudo growpart /dev/sda 1 # choose the partition of hard drive to increase, in this example sda and 1 partition sudo resize2fs /dev/sda1 # resize filesystem in the partition, in this example sda and 1 partitionCheck the changes
df -h
That’s all.