Ubuntu + RDP on Oracle Cloud

The first one works the best. Open an SSH connection to the server and run these commands:

sudo su
cd ~
apt update
apt upgrade
apt -y install lxqt sddm xrdp
systemctl status xrdp

The XRDP port needs to be open in Oracle Cloud and search for ‘Virtual Cloud Networks’. Then select the network and go to the ‘Security Lists’ and click on the default one. Then add ingress rules:

The open the port in iptables by editing /etc/iptables/rules.v4

Make a copy of the rule for port 22 and change the value to 3389

Then run:

iptables-restore < /etc/iptables/rules.v4

Create a file in your home folder (/root) called .xsession

nano .xsession

Alternative videos – they may install a different desktop:

How to Enable and Secure Remote Desktop on Windows


How to add a new RDP listening port

If you need to add another listening port for your RDP server, for whatever the reason, this howto will show youhow to do it.
Please notice we need to edit the registry, so it always best to BACKUP the REGISTRY before you doing any edit on it.

We need to create a new RDP listening port within the registry:

1 – Run Regedit.exe on your Server.

2 – Navigate to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

3 – Export the entire key to a .REG file by selecting the key “click on it” and going to File – Export.

4 – Give it any name you like (name not important, any name will do).

5 – Edit the .REG file you’ve just created
(Do not double click on the .REG file, instead right click it and choose Edit)
and change the name of the key at the 3rd line of the file to something like:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp-New

6 – Then Find: PortNumber

and change it to whatever port you want. Make sure you write it in hexadecimal format. For example,
for 3390 you must enter D3E (use calculator in scientific mode to easily convert decimal to hexadecimal format).

7 – Import the .REG file back to the registry by double clicking on it, and we are done.

To connect to the Server from the client:

1 – Go to the Start menu and click on Run.
2 – On the Run menu type MSTSC and click Enter.
3 – In the RDP window, in the Computer box, scroll to the computer name or IP to which you wish to connect.

Code Snippet

Add a “:Port” (without the quotes) where “Port” is the decimal value of the destination port.

Another method of connecting to a different port that default is to run the MSTSC command
with the required command line parameters:

Code Snippet


For example: MSTSC /v: (example port)

NOTE: You have to enable (Allow) the port in the firewall of the client operating system

This was originally posted here: https://social.microsoft.com/Forums/en-US/4e7bd341-38d9-42b6-9265-c6952dc3cdc3/add-a-new-rdp-listening-port-howto