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](https://i.stack.imgur.com/c0Pg2.png)
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.