Connect to Ubuntu 12.04 (Precise Pangolin) via Windows Remote Desktop

Want to connect to Ubuntu 12.04 from Windows 7 via Remote Desktop Connection? Well, it’s now easy to do it with xRDP server. In the past, it was almost impossible to do but thanks to xRDP, you can easily use Microsoft RDP to connect to Ubuntu without any configuration.

All you need to do is install the xrdp package, then open Remote Desktop Connection from Windows and connect. That’s it, nothing to configure.

Without wasting anymore of your time, let’s get going.


Enhance your coding experience with this split keyboard that offers up to 9" of separation.

  • Connect to Ubuntu from Windows via RDP Protocol
  • Enjoy!

To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to install xRDP package.

sudo apt-get install xrdp




Next, open Windows’ Remote Desktop Connection and type Ubuntu hostname or IP address.




When prompted, type your Ubuntu username and password to connect.








If you have a problem connecting, run the commands below and restart Ubuntu, then try again.

echo "gnome-session --session=ubuntu-2d" > ~/.xsession


Or install gnome session fallback.

sudo apt-get install gnome-session-fallback

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Invest in some screen real estate with a new big screen, backlit monitor availabe in five different sizes and price points.

75 thoughts on “Connect to Ubuntu 12.04 (Precise Pangolin) via Windows Remote Desktop”

  1. Hey–

    I have installed this nice software im encoutering a problem where it asks me for the Login Keyrin password. How do I obtain that? im able to manage all folders but it keeps on poping up

    1. Dear Dihego,

      Your login keyring is something that you can safely ignore, but you must have set up a keyring and password at some time in the past. Things like Ubuntu one will try to use the login keyring to get a password to connect to the cloud storage service etc.

      If you want to get rid of the keyring:
      rm /home/{user}/.gnome2/keyrings/*

      Next time you will probably be asked to set a new password.

  2. This is incredible. Now that this works well it makes using Ubuntu in an Entrprise cloud environment that much more attractive.

    I am quite frankly amazed at how well this worked straight away.

          1. i got the same problem but after i used the cammands as writer wrote down

            sudo apt-get install gnome-session-fallback

            echo “gnome-session –session=ubuntu-2d” > ~/.xsession

            and it started working

              1. try this

                sudo apt-get install gnome-session-fallback

                echo “gnome-session –session=gnome-fallback” > ~/.xsession

                sudo /etc/init.d/xrdp restart

  3. Hello,

    Is it for 12,04? Because i followed above all steps but no luck. Here am using 10.04.

    Thanks & Regards,

  4. Thanks for the post!

    I was able to RDP in but had a number of permission issues.

    ex: USB drive would not mount when in an RDP session.

    I found a fix here:

    The recommended steps are:
    Create a blank .Xauthority file in the home directory of the user you are connecting with (not necessary if file already exists). Be sure to log in as that user (either graphically, or via the terminal), then run:

    touch ~/.Xauthority
    chmod 600 ~/.Xauthority

  5. Hi all,
    I’m trying this from a Win2008 r2, but I’m getting an error saying:
    “Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again.”

    does anyone successfully made this work on win2008 r2? or seeing this error and fixed it somehow?

    Marcelo Caldas.

  6. Guys, if you are using ufw then you need to allow incoming port 3389 (GRE) from whatever IPs (or local subnet e.g. you want to access.

    My slightly different prob is that if I RDP from more than 1 PC, it creates a 2nd/3rd session/shell which doesn’t see the GUI instances of various running programs. This is, obviously, a bit annoying, as I can see those progs in the process list clearly. Any suggestions on how to re-attach to a previous RDP session…?

  7. Hi,I did all the steps in my computer(ubuntu 12,04) but I still only can see the the desktop background and can’t see menu,can’t open terminal .However,I can use right click.
    Could you tell why?

  8. Note that in order for Windows to connect to ubuntu with this solution, you must also have samba installed (sudo apt-get install samba). I imagine most people trying to do this already had smb shares or something that required it anyway, but it happens I was setting this up first thing after installing ubuntu 12.04.

  9. 1.Open Terminal and install the xrdp

    #sudo apt-get install xrdp

    2.Finding the X11RDP binary..

    #sudo apt-get build-dep xserver-xorg-core
    #sudo apt-get install automake1.7 automake 1.9

    3.Download X11rdp Source :



    #tar xvf x11rdp_xorg71.tar.gz

    4.Make a Directory to Store the Built Binary files.

    #sudo mkdir /opt/X11rdp
    #cd x11rdp_xorg71
    #sudo sh /opt/X11rdp

    5.If everything is done with no errors then enter below command from your current location :

    #cd /opt/X11rdp/bin


    #ls -lh

    6.Now the X11rdp Binary has been Compiled.

    #sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp check your binary runs without crashing

    #/usr/bin/X11rdp :1

    Now you are Ready to take Remote Session of your Ubuntu system via

  10. Not working for me. I can use a linux laptop and remote in with Remmina Remote Desktop just fine, but every time I use a Windows computer with RDP, I get “Failed to connect.” Can’t figure out why. Help!

  11. Just discovered why it wasn’t working, and I’ve got it working now. The firewall was blocking port 3389. Once I opened it up for incoming traffic, it worked perfectly.

  12. Thanks a lot. it helped me to connect my raspberry pi remotely! But how to stop the srdp server later? just “pkill xrdp” ?

  13. Very nice, works perfect with

    echo “gnome-session –session=ubuntu-2d” > ~/.xsession

    Or install gnome session fallback.

    sudo apt-get install gnome-session-fallback

  14. I get the message ‘Failed to load session “ubuntu-2d”‘.
    I have done the following steps on Ubuntu 13.04:
    1) sudo apt-get install xrdp
    2) echo “gnome-session –session=ubuntu-2d” > ~/.xsession
    3) sudo apt-get install gnome-session-fallback

    Initially I have only done step 1, this gave me the”purple” background only.
    What should I try to “load the session”?

  15. I am using Ubuntu 13.04 as well and using a blank .Xauthority with perm set to 0600 I have tried both echo “gnome-session –session=gnome-session-fallback” > ~/.xsession and echo “gnome-session –session=ubuntu-2d” > ~/.xsession to work. I also get failed to load session error messages. Note I have gnome-session-fallback installed as well.

  16. Hi guys,
    I managed to get it working following similar steps to everyone else:
    1) Installed XRDP:
    sudo apt-get install xrdp
    2) opened up a terminal and entered:
    echo “gnome-session –session=ubuntu-2d” > .xsession
    3) run remote desktop in windows 7.

    Without step 2, I would get a blank screen. With step 2, I can now see icons, and I can use the linux. I couldn’t access the terminal. So I had to create a shortcut on the desktop. Also, the close/minimize/maximize buttons on the top LHS of the window aren’t present. Other than that, works like a charm!

    Does anyone know why the buttons are gone?

  17. Hello, I have installed and am able to access ubuntu successfully. The display is not working correctly. I can open terminals, web pages, doc etc but can not read menus as the display is screwed up – any suggestions.

  18. The [echo “gnome-session –session=ubuntu-2d” > ~/.xsession] worked a treat! I could not RD into Ubuntu and so glad I found your page – Thanks!

  19. Hi,

    Works fine with Windows XP SP3 running RDP ver 6.1.7600. Total black screen using Windows 7 running RDP ver 6.2.9200? Just sits minimized in taskbar, seems “connected” but can’t open/maximize etc. Can only kill it. Go figure, any ideas anyone?


  20. Hi guys,

    I installed the Ubuntu 13.10 Desktop x64 and it can’t open the Unit GUI.
    The xrdp works becouse it ask me user/password. After that is show me the ‘X’ cursor and the desktop from X. Nothing more.

    I’ve been using xrdp to access the Ubuntu 12.4.3 Desktop x 64 and it works nice.
    I installed int the follow order:
    – sudo apt-get install xrdp
    – echo “gnome-session –session=ubuntu-2d” > ~/.xsession
    – sudo apt-get install gnome-session-fallback

    I tried to change .xsession to “gnome-session –session=gnome-fallback” but it din’t help.

    best regards,

  21. Can’t get this to work. Tried using the FQDN of a remote Ubuntu 12.04 web server and even its IP address but my Windows 7 RD still cannot connect. However my Bitvise SSH client has no problem connecting and that’s how I entered all the commands as root. I even restarted the server, reconnected using my Bitvise SSH client, restarted xrdp but still no success with Win7 RD.

    Any other trick I can try?

    Thanks much.

  22. Many thanks! Considering you wrote this article in 2012 and date now is 2014! It’s still proving to be a place to come to have ones prayers answered! In this case accessing ubuntu from Win 7

    …worked like a dream! Many thanks

  23. Worked great, thanks. But, I cannot figure out how to stop my session from timing out. If I start an analyses and walk away, the session times out and logs me off and the analysis dies. How do change the session time out to “never”?

  24. While logging to Ubuntu machine using Windows’ Remote Desktop Connection, click on the module and change it from “sesman-Xvnc” to “console”. and enter password. it worked for me

  25. Als ik mijn email wil controleren op Ubuntu moet ik steeds inlooggen. Ik heb een paswoord aangemaakt bij het starten van Ubuntu maar dat wordt niet herkend voor het lezen van een bericht.

  26. bij het openen van email-berichtn in Ubuntu moet ik steeds een wachtwoord ingeven. Bij de installatie van Ubuntu op deze XP computer heb ik een paswoord ingegeven maar dat is niet het juiste gewenst paswoord. Hoe geraak ik op de site waar je dat paswoord kan aanmaken?

  27. Hi,
    I have a ubuntu machine running 12.04. The machine only has vga-out. My monitor only has digital ports. So I am unable connect my ubuntu machine to a monitor. I have it on plugged into my wifi router.

    I used my windows 8.1 laptop (Remote desktop connection) to successfully connect to my Ubuntu machine using sesman-xVNC. The login is successful, but I land on the desktop screen with no icons/launcher, etc…

    Pressing ctrl-alt-T does nothing, neither does right-clicking. I can’t launch a Terminal. I would love to try some of the commands suggested above, but am unable until I can get Terminal launched.

    Has anyone experienced this and if so, how did you solve the problem?



  28. Hi Jeremy S,

    Try remote connect via ssh (use ‘putty.exe’) to have a remote prompt or buy a vga-to-digit convertor cable.. (

  29. Great guide! Really helpful.

    I have one small problem though. I connect remotely, put the username and password for the Ubuntu and it connects but all is displays is the background, the icons aren’t there so there is nothing. No matter how long I wait, no icons show up. Anything I could do to fix this?

  30. Hi,
    I connect fine, but I only get the blank desktop background and not the icons along the left side.
    Sometimes I get some error about Precise being out of development but I am not sure what to do about that.

Leave a Reply

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