Tuesday, July 29, 2008

GetVirtualSystemThumbnailImage – HyperV, WMI and Virtual Machine “Screen” Thumbnail

Taylor Brown's Blog - Hyper-V WMI: Creating a Thumbnail Image

“Hyper-V has a WMI API that will allow you to create a thumbnail image of any running or paused virtual machine.  You can create any sized thumbnail you want (640x480, 800x600, 1024x768 etc…).  Creating the image is pretty easy, you just call GetVirtualSystemThumbnailImage passing a reference to an Msvm_VirutalSystemSettingData instance and the size of the image you want…  However getting something useful from the returned data is a bit tricky…  You get an array of unit8’s that represent pixels, the API doesn’t have much choice and luckily Powershell makes this not an impossible feat.  All you have to do is create a new bitmap object and read (marshal) the pixel data into the object…

…” [Post leach level: 90%]

Oh… that’s neat! And being WMI this should be do’able remotely (given the right permissions of course).

So you could integrate this into a custom application, which joins line of business status, control, etc with a thumbnail view of a HyperV VM. Nice.

I can see how I might be able to use this… maybe. With Virtual Server there was VMRC, does that work with HyperV too? Or is it easier to Remote Desktop into the VM’s? And if so, when you disconnect (not log off, but disconnect), then the VM would lock? And so the Virtual System Thumbnail would be of a locked system? Or am I just being stupid? I guess I’ll just have to wait and see.... ;)

No comments: