Connect to Ubuntu 16.04 | 17.10 | 18.04 Desktop via Remote Desktop Connection (RDP) with Xrdp

Want to connect to Ubuntu desktop from your Windows 10 machine via remote desktop connection? Well, it’s possible with xrdp opensource tool..

In most cases, VNC server and other opensource remote connection tools are the only options available to Linux users… You don’t see tool supporting Microsoft Remote Desktop Connction (RDP) protocols to connect to Linux desktop… The only tool that gets this done is xrdp..

xrdp is an open source remote desktop protocol server which uses RDP to present a GUI to the client. It provides a fully functional Linux terminal server, capable of accepting connections from rdesktop, freerdp, and Microsoft’s own terminal server / remote desktop clients.

This brief tutorial is going to show students and new users how to using Windows own remote desktop connection protocol to connect to Ubuntu 16.04 / 17.10 and 18.04 desktops

When you’re ready, follow the steps below to get it working…

Step 1: Install Xrdp Server

To get Ubuntu desktop accepting RDP connections, you must first install and enable Xrdp tool… to do that, run the commands below

sudo apt install xrdp
sudo systemctl enable xrdp

After running the commands below, logout or reboot your desktop.

Step 2: Connect from Windows 10

Now that Xrdp server is installed,  go and open Windows Remote Desktop Connection app and connect to the server IP or hostname…

Xrdp ubuntu desktop

Then click Connect to initiate the connection to Xrdp… you should be warned about  Windows not trusting the computer you’re conneting to… Accept and continue to connect anyway..

xrdp ubuntu install

Next, type in your Ubuntu machine account username and password and connect using Xorg session

xrdp ubuntu setup

When your accout username and password are confirmed, you should be logon to your Ubuntu machine from Windows… as shown in the image below

xrdp ubuntu install

That’s it!

You are now connected to your Ubuntu desktop from Windows using Microsoft own remote desktop connection protocol (RDP)… The graphic isn’t great, but good enough to get your work done.

 

Update

I have read all the comments below… and tried again was successfull… Here’s the trick..

  1. Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
  2. If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
  3. Restart again if step two doesn’t work right away..

Enjoy!

You should also like the post below:

HPLIP 3.18.4 Released, Adds Support 18.04 and Boat Load of New Printers

49 Replies to “Connect to Ubuntu 16.04 | 17.10 | 18.04 Desktop via Remote Desktop Connection (RDP) with Xrdp

  1. I downloaded and installed a 100% clean ubuntu 18.04 today and followed the instructions above. The Windows remote desktop window closes right after entering the login and password information. xrdp doesn’t work?

    1. I’m getting the same problem. I got it all working, get the login… username\pw then it just dies.

      1. Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
      2. If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
      3. Restart again if step two doesn’t work right away..
      1. Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
      2. If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
      3. Restart again if step two doesn’t work right away..
  2. Not working for me as well with Ubuntu Desktop 18.04 freshly installed. I get immediately disconnected after entering the credentials. I see xrdp listening on port 3389 and xrdp-sesman on port 3350, which looks good. I use “Xorg” as session type (I am not using Wayland). The “xorgxrdp” package has been automatically installed together with the “xrdp” package.
    By the way, I have xrdp also installed on a Redhat machine (RHEL 7.5 + Gnome), and there it works fine.

  3. I got the same. I updated and restarted 18.04 and now after the xrdp login (I already see the background wallpaper), it asks me for a second authentification. If I do that, it does it again and then disappears …

      1. Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
      2. If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
      3. Restart again if step two doesn’t work right away..
  4. I’m able to rdp and see desktop, but the dock is missing. dock is also missing from setting. logging in directly i see the dock and dock settings are present in settings window.

    anyone else have this problem?

    apt-cache policy gnome-shell-extension-ubuntu-dock
    gnome-shell-extension-ubuntu-dock:
    Installed: 0.9.1
    Candidate: 0.9.1
    Version table:
    *** 0.9.1 500
    500 http://ca.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
    500 http://ca.archive.ubuntu.com/ubuntu bionic/main i386 Packages
    100 /var/lib/dpkg/status

    1. run “gnome-shell-extension-prefs”
      the Shell Extension will open, and then you can turn ON the Ubuntu Dock

      Hope that’s helpful for someone, I just happened to run into this setting by accident.

  5. It works great for me!
    I just 2 new installs today.

    1st I ssh in, and run three commands:
    sudo apt install xrdp
    sudo systemctl enable xrdp
    sudo reboot

    Then I connect using RDP from my Windows 10 laptop.
    Note: sometimes I click ‘cancel’ twice to get past the Ubuntu authentication, or sometimes I just enter my password.
    It seems to work either way.

  6. Still not working for me…

    Running Ubuntu 10.04 on a Jetson board. Installed xrdp and started it, then issued a reboot.

    Connection Log:
    connecting to sesman ip xxx.x.x.x port 3350
    sesman connect ok
    sending login info to session manager, please wait…
    xrdp_mm_process_login_response: login successful for display
    started connecting
    connecting to xxx.x.x.x 5910
    tcp connected
    security level is 2(1 = non,2 = standard)
    password ok
    sending share flag
    receiving server init
    receiving pixel format
    receiving name length
    receiving name
    sending pixel format
    sending encodings
    error – problem connecting

    I’ve tried sesman-X11rdp, as suggested. With the same result.

    I used to be able to do this on a Raspberry Pi, but can’t seem to get it working on this board. Don’t know if it’s a change to Ubuntu or just this board.

  7. The problem appears to be that unity-3d does not work across xrdp. That was a LOT of google searching to track that one down. Off to trying other desktop managers to see if I can find one compatible with NVIDIAs software and that works across xrdp.

  8. works with debian 9 (stretch) out of the box which pulls the xorgxrdp driver. if you have older versions of debian or ubuntu do the below instead.
    apt-get install xfce4 –no-install-recommends -y
    apt-get install xrdp xfonts-base tightvncserver -y
    reboot
    username is root. password is your vps password.
    enjoy

  9. doesn´t work neither for me. I also have done the 3 workarounds. I´m using Ubuntu Bionic (fresh install) and when i log in, i get a blank screen, like if the window manager wasn´t starting (i added the line at .xsession …).

  10. Only get a blank green screen. Yes it is a desktop but empty and nothing to do.
    EDIT
    I use the Mate trick in a post above. Then log in with remember username and password. In the log in screen I click abort and get a real Ubuntu Desktop. Scale it to 300% because I have a 4K screen.

  11. xrdp for Ubuntu 18.04.01 LTS didn’t work for me as described in this article. Kept getting blank desktop, though the RDP connection did actually function.

    The following link, however, with its associated script, worked perfectly:

    http://c-nergy.be/blog/?p=11868

    But I could only get xrdp/RDP working using the above link on Ubuntu 18.04 and 18.04.01 on an x86 virtualbox running on a Win 10 host. Couldn’t get Lubuntu 18.04/18.04.01 or Kubuntu 18.04/18.04.01 to work with xrdp.

  12. I finished to install Ubuntu 18.04 and add the server into my domain, all working fine and I am able to login with the domain user from the Vmware console and from the Putty but when I am using XRDP for RDP and put the domain user and pass I am not able to log in. with the SU user, I can log in to the machine using XRDP without any issue.

    anyone have the same issue or have any suggestions what should I do in order to solve this issue?

    thanks.

    1. i solved the issue.
      if it won’t work with domain user just follow the following step:
      Change the last line of your sssd.conf to
      access_provider = simple
      AD logins will work then. Access_provider =ad needs some more configuration. Details can be found in the man page of sssd.conf.

  13. I was using 16.04 LTS and had difficulties when i tried to login
    I ran these codes and it worked:
    echo mate-session> ~/.xsession
    sudo apt-get install mate-core

    Now I can RDP into my 16.04 LTS

    1. Thanks. It works for me! I ran these commands:
      echo mate-session> ~/.xsession
      sudo apt-get install mate-core

  14. Hello! I installed the ubuntu18.0.4 can see interface and operation, but open genymotion open simulator, the simulator can’t display inside! Is there any way to solve

  15. when using XRDP if I am logged into the machine from the systems keyboard, mouse and screen I apparently cannot login to XRDP. If I reboot and then login via RDP I have no problem logging in via RDP. I would like to solve this problem as I would like to be able to be logged into the main screen and a remote session as well.

    Pretty buggy version of ubuntu. Previous versions did not have this problem. sure they had other issues, but this one is a PIA!

  16. Worked straight away on a xubuntu VM running under Win2k16. Thanks!
    Maybe it wont work with Unity cos it’s shit?

  17. Well, it broken my login process. I couldn’t login Ubuntu 18.04 Gnome desktop until i Removed xrdp.

  18. Is it a secure connection, or is there something than needs to be done to secure it? I haven’t used Windows RD in a while, but I remember it didn’t encrypt the connection by default (only the handshake).

  19. Great article!

    Now, apologies for such a noob question.

    In Ubuntu 16.04 I had XRDP working great using the xfce4 desktop environment. Sitting at Windows 10 machine I could fire up remote desktop top app and get to my Ubuntu machine and see a xfce4 desktop. All good.

    I recently upgraded to 18.04.

    Now I still get to xfce4 desktop via xrdp just fine. Here comes the question.

    I added a new user to Ubuntu system. The new user uses XRDP, logs into Ubuntu machine, and sees…
    Unity desktop. What the what??

    What is causing this? How to I switch between unity and xfce4? I set this all up over 4 years ago and do not recall all the steps I took. Any suggestions would be appreciated!

  20. This does not work, it throws you out after showing the screen. Your update says:

    I have read all the comments below… and tried again was successfull… Here’s the trick..

    Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon
    –> OK no problem…

    If you try Xorg session and it quickly disconnect… select the X11rdp from the drop-down list.. it will hang and not fully logon… close the session and try the Xorg session again… that time it will work… but keep prompting you to authenticate… you can cancel the prompt windows…
    –> What drop down list, where is it, I can’t find it anywhere… if it’s not loggin in, how do you select a drop down list? I mean, are you talking after login? I can’t login so … how to keep it to connect and not bomb out and throw me out?

    Here is what shows on the screen for like a split second, then it goes away … I print screened it before it vanishes …

    https://1drv.ms/u/s!ApjktsplyCisi32wIZxjiXuS8iYI

    OK, thanks … it’s awesome to be almost there!! Can you help me get all the way?!?!? Thanks!!

  21. Test on an updated Ubuntu 18.04 and worked like a charm.
    I have a question, how could we protect the system from brute force logins? Can we make a fail2ban jail?

  22. What worked for me is to install xubuntu-desktop on top of Ubuntu server. After that, create a file .xsession in the user’s home dir with “xfce4-session” in it.

  23. The mate trick worked for me. I did the echo redirection then loaded the mate-core and after that everything worked fine.

Leave a Reply to Lecquio Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.