Question

Unable to connect to Ubuntu VPS using xrdp from Microsoft Remote Desktop

When I first created the droplet, I managed to succesfully install xrdp and connect to it through Microsoft Remote Desktop from my Windows machine. That was on Friday, today, it stopped working completely. I tried a miriad of solutions I found online, but no avail. No solution worked, I’ve tried reinstall the ubuntu image multiple times, forwarded the 3389 port multiple times, enabling and disabling the firewall, changing the default port, etc. None have worked so far. The only thing I know is that, through namp and the open port tool, the 3389 port appears to be closed, even though it is supposed to be open. The 22 port is shown correctly as open. I tried using x2go, but the desktop always crashed on startup. I’m in desperate need of help, I’ve searched everywhere for a working solution, without success. Xrdp logs are devoid of any erros, Microsoft Remote Desktop displays the x204 error consistently. I don’t know what to do anymore, any kind of help is deeply appreciated.

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Changing the port xrdp listens to, to some other open port fixes the issue. With Microsoft Remote Desktop, using the address as ip:port is enough. I suspect DigitalOcean was blocking the 3389 port, that’s why it apperead open on the droplet, but was unreachable.

KFSys
Site Moderator
Site Moderator badge
April 25, 2023

Hey @matiasantonioalonsoeiras,

When the port is shown as closed, it usually means nothing is listening on it. Anyway, here are a few things to check and possibly provide info on them.

Confirm that xrdp is running

SSH into your droplet and check the status of the xrdp service:

  1. sudo systemctl status xrdp

If it’s not running, try to start it:

  1. sudo systemctl start xrdp

Check firewall rules

Make sure that the firewall (UFW or iptables) is allowing connections on port 3389. If you’re using UFW, you can check the current rules with:

sudo ufw status

If the port is not listed, add a rule to allow it:

sudo ufw allow 3389

If you’re using iptables, check the rules with:

sudo iptables -L

If the port is not listed, add a rule to allow it:

sudo iptables -A INPUT -p tcp --dport 3389 -j ACCEPT

Check xrdp logs

Inspect the xrdp logs for any errors or issues:

sudo cat /var/log/xrdp.log sudo cat /var/log/xrdp-sesman.log

Look for any error messages or failed connections.

Not seeing the Port as open when using NMAP is where we should start from, you SHOULD see it so it’s either the configuration not proper or your firewall is blocking it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel