Score:1

Looking for diagnosing RDP access to my Ubuntu 20.04 LTS

kz flag

I have an ubuntu 20.04 LTS VM. It is a default installation and its networking seems properly up and running.

I am able to remote SSH to the machine, no problem.

I ran the following commands to enable RDP:

sudo apt install xrdp
sudo systemctl enable --now xrdp
sudo ufw allow from any to any port 3389 proto tcp 

In addition, I have screen sharing enabled like this:

enter image description here

Still I am not able to connect to the VM using Windows 10 RDP Client.

I don't think the problem is due to networking setup outside the VM. I can SSH to the VM and it get proper IP and internet access through my Router.

I noticed many people on Internet are able to connect RDP with steps I followed.

Am I missing anything here? How can I diagnose this issue?

Update #1:

Many thanks to @iBug I found that my Ubuntu VM is not even listening on port 3389:

netstat -tpln
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      4122/vino-server
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -
tcp6       0      0 :::5900                 :::*                    LISTEN      4122/vino-server
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:631                 :::*                    LISTEN      -

This is strange since I see it works for other people like this one :

https://youtu.be/IlsPwrYqz70

Is there any official instruction how to enable RDP access in Ubuntu box?

Update 2

Once again, many thanks to @iBug, here is more detail:

systemctl status xrdp
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-10-07 01:24:07 EDT; 20h ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)

Oct 07 01:24:07 ub-02 systemd[1]: Starting xrdp daemon...
Oct 07 01:24:07 ub-02 xrdp[4077]: (4077)(140619056088896)[INFO ] address [0.0.0.0] port [3389] mode 3
Oct 07 01:24:07 ub-02 xrdp[4077]: (4077)(140619056088896)[INFO ] listening to port 3389 on 0.0.0.0
Oct 07 01:24:07 ub-02 xrdp[4077]: (4077)(140619056088896)[ERROR] trans_listen_address failed
Oct 07 01:24:07 ub-02 xrdp[4077]: (4077)(140619056088896)[DEBUG] Closed socket 7 (AF_VSOCK cid -1 port -1)
Oct 07 01:24:07 ub-02 xrdp[4077]: (4077)(140619056088896)[ERROR] Failed to start xrdp daemon, possibly address already in use.
Oct 07 01:24:07 ub-02 systemd[1]: xrdp.service: Control process exited, code=exited, status=1/FAILURE
Oct 07 01:24:07 ub-02 systemd[1]: xrdp.service: Failed with result 'exit-code'.
Oct 07 01:24:07 ub-02 systemd[1]: Failed to start xrdp daemon.

Per my netstat -epl result above, no process is listening on port 3389.

With this discovery, my question is a duplicate of this one:

Failed to start xrdp daemon, possibly address already in use

Unfortunately left unanswered since 11 month ago.

iBug avatar
tr flag
Your "screen sharing" dialog shows the protocol as VNC, is that right?
iBug avatar
tr flag
To diagnose: Install `net-tools` and check the output from `netstat -tpln`. See if there's something listening on port 3389.
kz flag
@iBug, thank you for help. I updated my question with netstat result.
iBug avatar
tr flag
It seems you enabled `xrdp` service but it isn't running. Check its logs with `systemctl status xrdp` and `journalctl -eu xrdp` and sort out any issues.
James S. avatar
de flag
"enabling" the service means it will be started at boot time, but does not itself start the service. You just need to start the service. Or use VNC instead, which is what you enabled with "screen sharing". VNC and RDP are not the same thing.
kz flag
@iBug, thanks so much. See my update. Not sure if this is an easy to fix issue, but I learned how to better diagnose. Appreciate your help here.
iBug avatar
tr flag
@JamesS. Look closely. The command was `enable --now`, which means enable *and start*.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.