Hyper-V force shutdown VM

Let’s face it, sometimes a Hyper-V gets stuck in a funny state and you can’t shut it down from the UI. Fear not, you can easily force it down using powershell.

Firstly, get the guid of the VM.

$VMID = (Get-VM '<name of the VM from the hyper-v manager (or Get-VM)').id

Then, find the process that’s running that VM.

$VMProcess = (Get-WMIObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $VMID})

Then you can force stop that process.

Stop-Process ($VMProcess.ProcessId) –Force

Hey presto, the VM should be down.

Hyper-V set display resolution

With all the migration from VMware to other sources, Hyper-V is making quite a comeback. Hyper-V is a lot better than the good (aka bad) old days, but you still need to know how to handle certain quirks.

In this case I needed to change the resolution of my Hyper-V windows guest to something higher as it was stuck on the default 1152×864.

It’s simple to fix, just shutdown your VM in the Hyper-V manager (or use powershell) and when the system is down, open a powershell window and use.

Set-VMVideo -VMName "<Name of VM in Manager>" -HorizontalResolution 1920 -VerticalResolution 1080 -ResolutionType Single

Then when you power the VM back on and access via the Hyper-V display option you will have a VM with the larger screen resolution.

Navigation