Search code examples
azureremote-desktoprdp

azure connected vm remote desktop


I've got two VMs in Azure, the second of which was linked to the first when it was created. I can connect via remote desktop fine to the first VM, but cannot remote desktop to the second nor edit the rdp endpoint. I'm assuming this is something to do with the fact they've both got the same DNS name (the second machine's DNS is auto allocated when you 'link' it to the first). If I use the public IP it connects me to the first VM.

The linking was done so we could load balance between the two but if I can't RDP to the second then it's pretty useless to me.

Any idea how to remote desktop to the second VM or an alternative load balancing (it's an asmx web service we're looking to balance)

Many thanks


Solution

  • You can enable remote desktop for all VM's within a single cloud service deployment. The external-facing RDP port for each VM will be different, and each will then map to 3389 on their respective vm's. These will be set up as port-forwarded endpoints, meaning not load-balanced.

    I'm not sure how you set up your 2nd VM when provisioning, but you should have been able to enable rdp at creation time. If you used the CLI, you'd have something like

    >azure vm create -c --rdp [port] -n -z size newvmname existingdnsname disk-image-to-use username password
    

    By specifying --rdp, everything will be automatically set up for you. Just be sure to specify a port different from your first VM's port. If you create the VM through the portal, the port number will be automagically assigned for you.