Windows 10

Ensuring you can capture a screenshot from a remote Hyper-V VM

This should be a trivial exercise.  I should be able to connect to a remote Hyper-V server using Hyper-V Manager, connect to a specific VM, and interact with it as if I were on the server.  Since I typically use Azure AD Join, that’s not as simple as it should be.  Over the years, I’ve certainly lost many hours around scenarios like this, because of one particular technology being used behind the scenes:  WinRM, also known as WSMan.

I’ve gotten used to getting the initial connectivity in place, enabling WinRM and making sure it trusts the remote Hyper-V computers.  You can use “winrm quickconfig -force” to do the initial configuration of WinRM, and then set the list of trusted hosts:

Set-Item WSMan:\localhost\Client\TrustedHosts –value ‘Server1,Server2,Server3’

But there’s one item that puzzled me: the error that you can get when trying to capture a screenshot (using the “Capture screen” menu option on the Clipboard menu of VMConnect).  It’s a clear error:


And a quick internet search shows that there is a “MaxEnvelopeSizekb” property that needs to be set to a larger size to get around that error.  Great, except every time I tried to set it, I got an error:


The only way I could figure out how to get around this one was to disable all network adapters (as all the ones that were actually in use were already marked as private):


Presto, the command succeeded.  But it didn’t work, the “Capture screen” still failed with the same error.  It turns out that you don’t need to set the value on the client, you need to set the value on the server.  And that succeeded without any issues:


And with that, I can successfully capture a screen from a VM:


And only one hour wasted.  Oddly, I can’t paste the screen capture directly into Open Live Writer – I have to first paste it into Paint and then copy it again from there.  But I can live with that little issue (for now at least).

Categories: Windows 10

2 replies »

  1. I’ve been using a tool called snipaste, which is very convenient and easy to use. You can get it from the Microsoft Store.