If you use quick create and select one of MS's templates, e.g. Ubuntu 22.04 LTS, the resulting VM generally doesn't have enough space.
If you know this at create time here are steps you can use to increase the space to something useful.
-
Select quick create and in the quick create select the template you want. ( e.g. Ubuntu 22.04 LTS ) etc
-
After creation do not connect. Click edit settings
-
Select the hard drive, note the virtual disk location, and then edit the hard drive
-
In the edit wizard, select Expand and click next
-
In the expand panel set the size to what you need and click finish
-
Click OK to dismiss the editor window
-
Close the 'Create Virtual Machine' success window without connecting
-
In Hyper-V Manager edit a linux vm other than the one you just created. ( create a second one if you don't have one ). Add the disk from above as SECOND disk
-
Boot up this 2nd VM and install gparted if it isn't already install
-
Run gparted as root. You should be presented with something like the screenshot below. Select Fix
- You should then be in the partition editor. Select your disk from the drop down in the upper right hand corner. ( /dev/sdb in this case )
- Select the partition 1st partition ( /dev/sdb1 in this case ). Click the resize tool
- Use the size slider to maximize the partition ( /dev/sdb1 in this case )
- Click the apply button to apply the change
-
Shutdown the 2nd VM
-
Edit the 2nd VM, remove the disk you added previously
-
Boot up your new VM