Can we change RDP port to 8080 for a VM?

Sai Kumar 20 Reputation points
2024-05-09T17:33:47.77+00:00

I changed the port to 8080, allowed incoming for the same in my NSG. But I was still not able to take RDP on port 8080.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,252 questions
0 comments No comments
{count} votes

Accepted answer
  1. v-vvellanki-MSFT 4,210 Reputation points Microsoft Vendor
    2024-05-09T18:12:56.1133333+00:00

    Hi @Sai Kumar,

    Thanks for contacting Microsoft Q&A platform.

    beside configuring the NSG for the new port of RDP the OS needs to be configured listening on the new port RDP should listen as well.

    You can get this done by PowerShell executed on the VM:

    
    $newRDPPort = "8080" # new listening port for RDP
    Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP\” -Name PortNumber -Value $newRDPPort
    New-NetFirewallRule -DisplayName “RDP New Port” -Direction Inbound –LocalPort $newRDPPort -Protocol TCP -Action Allow
    
    

    Hope This helps you.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jackson Martins 9,796 Reputation points MVP
    2024-05-09T17:43:29.7+00:00

    Hi Sai Kumar

    Have you changed the RDP listening port? if you don't change the pattern 33

    https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/change-listening-port

    If you are changing the RDP listening port to 8080 on the server, you will need to ensure that the server's firewall (within the operating system) is also configured to allow connections on this new port.

    windows -> run -> wf.msc

    When connecting via RDP client, ensure that you specify the port correctly by using the address in the format: hostname:8080 or IP_address:8080.

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    0 comments No comments