Apache Guacamole connecting Hyper-V

Guacamole is one of those tools that makes my home server so much more useful. I’ve been running Guacamole for ages now, and use it on a very regular basis.
It comes in handy with all kinds of situations, and it’s rock solid when it comes to stability. It can be a bit tricky to setup though, especially when digging into the more advanced topics, such as being able to access your Hyper-V virtual machines. In this post I will explain a pitfall you might come across when trying to do the same.

Guacamole’s documentation is good but…

There’s a pretty good section on how to setup Hyper-V (search for Hyper-V on that page) connections through Guacamole. Most of it is in there to get you going.
However you might have set this up like it’s described in the manual, and you’re still not able to connect to your running VM.

The crux here is that you might still have to grant access to allow connecting to the Hyper-V VM through VMConnect.
I used to always to this by ways of connecting once locally, using vmconnect.exe and supplying the username I would use to login through Guacamole.
When setting up my brand new machine I just got the other day, and having to go through these hoops again, I found that there’s an easier way!

There’s a PowerShell command that does this trick for you; Grant-VMConnectAccess. Just supply the VMName and UserName parameter in an elevated PowerShell prompt, and off you go.

2 Comments

  1. Benard Mensah
    July 21, 2021
    Reply

    so how do you go about connecting to a vm thats running on a hyper-v cluster that will move hosts as a result of live migration.

  2. July 21, 2021
    Reply

    That is a very good question 🙂
    And to be honest I don’t have an answer for you.
    As a developer, I only use Hyper-V for development reasons. I have little to no experience with Hyper-V clusters.
    With that said, I do not see how this would be possible within Guacamole. Guacamole requires you to configure the host, if that changes, the Guacamole configuration has to be changed.
    Since Guacamole optionally stores it’s settings in a database, it might be possible to change the configuration when moving to another host (just updating records at the appropriate time).
    This whole procedure might be scriptable, or there might be hooks in Hyper-V to kick of some code. But that’s all way beyond my knowledge scope of this subject.

Leave a Reply

Your email address will not be published. Required fields are marked *