Search code examples
virtualizationremote-desktopvnchyper-v

Remote view to To Hyper-V Guest Virtual Machines


My software can discover all the hyperv vms (a software agent is installed in the hyperv host which returns the information). From my software I can do any operation on the vm. Now I want to take a remote console view of the hyperv vms from my software. It can be a web based or flash based or any other way.... How to accomplish this ?


Solution

  • Do you want to get the printscreen from the console or to control the VM through console remotely?

    • for the first one, Hyper-V provides an API through WMI where you can get the printscreen as a picture.
    • for the second one, you can simply use vmconnect.exe to connect to the console which comes with RSAT (remote administrative management pack, you can install it on Win7) or inbox on server edition. The remote control of the console is done by RDP (Remote Desktop Protocol) which is the same as you run mstsc.exe to connect to a remote server. But it's using a different port and some customized metadata during initialization. You may look at the implementation by reverse-engineering vmconnect.exe with Reflector.