Ubuntu 14.04 – LXDE Desktop Alternative for XRDP

lxde_logo

Hello World,

It has been some time that i didn’t post a new article.  I’m currently busy with a heavy virtualization project (Hyper-V based) which takes me quite a lot of time and bring me abroad as well.  I’ve been positively surprised by the success of the post about xrdp in Ubuntu 14.04.

I have received positive feedback about the post.  However, I’ve noticed that some people does not really like to work with the xfce desktop interface. The main argument is that the interface is a little bit old in terms of look and feel.   Based on this feedback, we though that instead of using xfce, we could describe how to configure your ubuntu machine to have xrdp solution working against a lxde Desktop environment.

Note :  We have picked up the lxde desktop because one of our colleague was asking specifically for this one.  We are preparing a post on how to use the MATE-Desktop (which is the closest replacement to Gnome classic desktop)

So, let’s go and let’s do this !

Install XRDP Package from Ubuntu Repository

In this post, we will be installing the standard xrdp package from the Ubuntu Repository. In order to perform the installation of the xrdp package, you will login into your ubuntu 14.04 machine.

Using the Dash button, in the search box, type Terminal

Click on Picture for Better Resolution

Click on the terminal icon and the Terminal console will open

In the Terminal, type the following command

sudo apt-get install xrdp

You will be prompted for your password

Click on Picture for Better Resolution

You will be then informed about the package size. To proceed with the installation, press Y

Click on Picture for Better Resolution

Wait for the completion

When done, you need to install an alternate desktop environment. In our scenario, we are using lxde

Installing the LXDE Desktop environment

In the Terminal console; type the following command

sudo apt-get update

sudo apt-get install lxde

Click on Picture for Better Resolution

You might be prompted for a password.Enter the password and press enter

You will be then informed about the package size. To proceed with the installation, press Y

Wait for the completion

 

Checking the LXDE Desktop interface 

To ensure that you have installed the lxde interface and if you wanna see how it looks like,  you should logoff from your Ubuntu machine.

At the  login page, click on the Ubuntu logo in the login box.

Click on Picture for Better Resolution

after clicking, you should see a menu similar to the one on the screenshot where you can select a list of alternate desktop interfaces installed on your system

Click on Picture for Better Resolution

In our scenario, we will select the option LXDE. When you have made your choice, you can enter username and password and login into your Ubuntu machine.  The LXDE desktop interface should look like something captured on the screenshot below

Click on Picture for Better Resolution

 

Configure xrdp to use LXDE desktop environment

At this stage, you have to configure your Ubuntu machine in order for xrdp to know that the LXDE desktop will be used instead of the Unity or Gnome (which are not working anymore in Ubuntu). To configure this, from the terminal console, you will issue the following command

echo lxsession -s LXDE -e LXDE > ~/.xsession

 

Click on Picture for Better Resolution

Restart the xrdp service by issuing the following command

sudo service xrdp restart

Click on Picture for Better Resolution

 

Test your xrdp connection

At this stage, you should have a basic xrdp working solution. When I say basic, I mean that you can indeed connect to your remote Ubuntu machine but if you disconnect your session and try to connect again, you will each time open a new session. (Read below section in this post to see how you can reconnect to the same session)

To test your xrdp solution, find the ip address of your linux machine (or use the name if you have DNS Infrastructure in place). To find the ip address, issue the command

hostname -I

Click on Picture for Better Resolution

Now go to your windows machine, start remote Desktop client and enter the ip address/name of your ubuntu machine

Click on Picture for Better Resolution

You should see then the login screen of xrdp presented to you. Note that, at this screen (and because we have not configured keyboard layout yet), the keyboard layout is set to English by default.

Click on Picture for Better Resolution

Enter your username and password and Press OK

You will see a dialog box showing the login process

Click on Picture for Better Resolution

If everything is configured correctly,you should see your LXDE desktop loading and you should be able to perform you work through this desktop environment.

Click on Picture for Better Resolution

To set Keyboard layout at the xrdp Login screen, perform the following steps

As explained above, with no special configuration, the xrdp login screen keyboard layout is set to english by default.  if you need to change it to another keyboard layout, you should proceed with the following actions

This is the command you should issue in order to change the keyboard layout to be used during xrdp sessions…

Step 1 : You go to the /etc/xrdp directory

Step 2 : you issue the command setxkbmap -layout <%your layout%> to define which keyboard map/layout to use

Step 3 : create a copy of the km-0409.ini file into the same directory. It seems that this is the default file used by xrdp to define the keyboard layout. You will need to use sudo in order to be able to write into the directory

Step 4 : Check that you have a backup of your file by typing the dir or ls command

Step 5 : update the file by issuing the following command sudo xrdp-genkeymap km-0409.ini

 

Reconnect to the same session throug xrdp

You have mutliple ways to reconnect to the same session through xrdp. we have explained two of them. One method is based on performing a custom installation and use the X11VNC software. This is one is working well but requires a little bit more effort. (http://c-nergy.be/blog/?p=4168)

The other one is to use the xrdp package from ubuntu repository and tweak some configuration files whil connected to the session. This solution is really a workaround and it’s not our favourite one. (see http://c-nergy.be/blog/?p=4471)

We have also presented a third method in the last post about xrdp and ubuntu 14.04 (see http://c-nergy.be/blog/?p=5305).  In this third method, we will be again using the default xrdp package available from the Ubuntu repository. We simply need to change the /etc/xrdp/xrdp.ini file in order to get access to the same session each time

To edit the file, issue the following command

sudo gedit /etc/xrdp/xrdp.ini

You might be prompted for a password. if this is the case, provide the password and Press enter.   When the file is open, locate the section [xrdp1] and replace the following line

port=-1
with the line
port=ask-1

Save the file. The file should look like this

Click on Picture for Better Resolution

When done, restart the xrdp service by issuing the following command

sudo service xrdp restart.

You are done.

When trying to access your Ubuntu machine through via the remote desktop client, you will see that the xrdp login screen has indeed an additional field called port.

Click on Picture for Better Resolution

If this is your first connection, leave the default value in the port field (i.e. -1), you will be then connecting through xrdp to your ubuntu machine using a specified port that can be seen on the login process dialog box.

Click on Picture for Better Resolution

Take a note of this port.

When you need to reconnect, you will have to specify the same port as your first connection and you should see the same screen as you left it.

Click on Picture for Better Resolution

Note : This tip has been provided to us by one of our reader (Thank you Wei 🙂 )

Final Notes

You did it !  You have installed LXDE desktop and now you can use your XRDP software in order to remote into your Ubuntu machine.  Again, this is not the perfect solution.  We still cannot use our favourite  Unity or Gnome Shell desktop interface but at least you can start working remotely on your machines.

There might be other desktop interfaces that might be useable with XRDP and Ubuntu.  We have (and will not test) all of them.  If you have another Desktop installed on your Ubuntu and you have the XRDP solution working.  Drop us a note, a link… This might be useful for other people

That’s it (for this easy) post

Till next Time

See ya

 

 

 

 

 

 

48 thoughts on “Ubuntu 14.04 – LXDE Desktop Alternative for XRDP

  1. I very much appreciate you posting this article. I had to switch from lubuntu to xfce because of the 14.04 upgrade. xfce was killing me. LXDE is treating me much better. Thanks!!!

  2. Hello Chuck,

    Good to hear that the posts are useful.
    You can also install MATE Desktop if you want to which provide the closest gnome classic experience

    Thank for the visit and feedback
    Till Next Time
    See ya

  3. Hello,

    I am running Ubuntu 14.04. I installed “rdp” as above but when I connect I see an “X” as the cursor and a screen filled entirely with crosshatch marks or dots – hard to tell – I can move the “X” around but I do not see the Ubuntu desktop. Any tips?

    Thanks ….. Milty

  4. @Bob Miltenberger

    This is not my fix, but if you are on Lubuntu its a small detail that makes all the difference.
    Just in case people are following this and using lubuntu there is a slight difference.

    Posted by lance bermudez
    http://ubuntuforums.org/showthread.php?t=2220414

    for lubuntu 12.10 and lubuntu 14.04
    $nano ~/.xsession
    lxsession -s Lubuntu -e LXDE

  5. Hello Signo,

    The post is targeting specifically Ubuntu (and not lubuntu) where the LXDE desktop interface has been installed to overcome the unability of Unity desktop to work with XRDP.

    If you are using LUBUNTU edition, it’s correct that the .xsession file should contain a different syntax that the one we have provided.

    Thank you for sharing the information about the LUBUNTU Edition

    I hope you fixed your issue
    Till next time
    See ya

    Till next time
    See ya

  6. hi

    I am able to login into xrdp session with root and I installed xrdp and LXDE with root privilages now when i am trying login with user to xrdp I am getting a log Login Failed I am new to this please post the steps how to login into xrdp as user

    Thanks for your ealier post from which so many like me used to Install XRDP with LXDE my version of Ubuntu 14.04LTS

  7. Hello Harish,

    if you can login with the root account, this means that you have changed the sesman.ini file. Correct ?
    If you create a new user account on Ubuntu, if you have logged into the system and configured the .xsession file, you should be able to login with no problems.
    Have you checked that your keyboard layout is correct when login into xrdp ?
    Have you created a group called tsusers ? If yes, your user should be part of this group to access the xrdp functionality. If not; you should not do anything, any users will then have access to your xrdp server

    hope this help
    Till next time

    See ya

  8. Amazing, it works! For me it’s better than x2go, but… clipboard don’t work. I can’t copy and paste on server to windows and vice versa. Any solution? It’s damn needed. Thanks!

  9. Hello There,

    Not that I’m aware of. I have seen in some blogs that this should be working but i never got it working.
    It seems that the clipboard function works when you are using the rdesktop (rdp client for linux) and xrdp

    xrdp would be a great solution but it still lack a lot of feature….

    Till next time
    See ya

  10. 1) Thanks for the very useful information.
    2) Thanks to Signo for the tweak in Lubuntu, which is what I’m using.
    3) It didn’t actually work for me as posted. After many failures, I found that adding “exec” in front of the lxsession line in my .xsession file made it work. I don’t know why it would be any different for me. I’m running a straight-up install of Lubuntu 14.04 with xrdp.
    4) Another way to do this is described at this link: http://www.blime.com/2014/xrdp-remote-desktop-on-lubuntu-14-04/ Basically, edit the start script for xrdp sessions and run startlxde instead of Xsession. (On Lubuntu, this also requires sudo apt-get install lxde-common, as well as editing startlxde’s final line to match Signo’s tip.) Obviously, you wouldn’t do this on a big system with many users, but on a small machine with a few accounts (kids, maybe?) this removes the necessity of editing multiple .xsession files.
    5) If I’m already logged in, I get a popup box that says “GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject.” There does not appear to be any other ill effects. Does anybody know if this is meaningful?

    Once again, thanks.

  11. Thank you for the detailed instructions, they were a big help and the best available after a lot of googling.

    One addition for adventurous people: XFCE is not developing much, and LXDE is focussing on LXQT now. Why not use LXQT right now?

    You need to install the ppa with
    add-apt-repository ppa:lubuntu-dev/lubuntu-daily
    and make a
    apt-get update
    apt-get install lxqt-metapackage openbox
    to install the lxqt environment.

    For the rest, one follows your instructions, but in the /etc/xrdp/startwm.sh file, you need to change as follows:

    #!/bin/sh

    if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG LANGUAGE
    fi

    #. /etc/X11/Xsession
    . /usr/bin/startlxqt

    That’s it! Very enjoyable working with LXQT remote.

  12. Hello Erik,

    Thank you for the info. You are absolutely right. lxde is moving to lxqt. and you have provided the info needed to cover this new situation

    Till next time
    See ya

  13. Thank you so much for this simple and useful tutorial. It worked for me. The only challenge was that I needed to use:

    echo lxsession -s XBMCbuntu -e LXDE > ~/.xsession

    instead of

    echo lxsession -s LXDE -e LXDE > ~/.xsession

    because I am using the XBMCbuntu distro.

    Now to my problem: when I logout from the LXDE desktop using the logout functionality I am not able to reconnect and I only see:

    Connection Log
    started connecting
    connecting to 127.0.0.1 5915
    error – problem connecting

    my:

    /etc/xrdp/xrdp.ini

    looks like this:
    [xrdp1]
    name=sesman-Xvnc
    lib=libvnc.so
    username=ask
    password=ask
    ip=127.0.0.1
    port=ask5915

    I am want to always use port 5915 to be able to reuse my session. But when I accidently logout (and not just disconnect) I can’t reconnect. No port is working.

    What I am doing wrong?

  14. Hello There,
    sorry for the delay in my response but I was abroad for some other projects….

    I will need to check on that…
    A quick workaround would be to always use the default port used by xrdp (i.e port=ask5910)
    Let me have a look at it and I might come back to you about this topic

    Thank for the visit
    Till next time
    See ya

  15. Hello En,

    Actually the behavior you see is normal.
    When you logout, you kill the vnc display on the port you have selected
    It freeze the vnc display for another user or connection

    If you logout, you should not care on which port you were connected to. if you are logged out, you cannot reconnect to the same desktop right.

    So, the simple approach here is to just leave the default enable
    or to replace the port line with port=ask-1

    Hope this help
    Till next time
    See ya

  16. I’ve installed LXQT- 0.8.0 on my ubuntu server ,however i’m unable to login into it using Xrdp. Any suggestiom what changes do i’ve to make? Your guide works perfectly for LXDE.

  17. Hello There,
    I have no clue as I never used the LXQT Desktop. Can you provide a little bit background ?

    So, you have installed lxqt and xrdp. can you see the xrdp login box ? if you login you see a black screen or simply an error is thrown at login and you are disconnected ?

    If I have time, I will try to install Lxqt and have a look at it in conjunction with xrdp and see what’s the results

    Till next time
    See ya

  18. Hello Chebria,

    Quickly installed and test lxqt on my ubuntu 14.10 test machine. Using xrdp I can login into the system. It’s not perfect obviously. I have no menu displayed at bottom but If I click alt-F1 I see my menu and I can work….

    So, It should be working for you as well.

    If I have time; I will describe how to install lxqt and configure xrdp to use it…
    but the process is really similar to the one for lxde

    Hope this help

    Till next time
    See ya

  19. Hello,

    Thanks for reply, i overlooked the comment section, to my surprise the solution was already posted by Erik on comment no.13.

    However i solved it before reading Erik’s comment and solution is identical but came from different sources. After posting my comment here yesterday, i googled around and found this post here. (i’m stupid, i didn’t read read comments here)

    wademurray.com/2014/xrdp-remote-desktop-on-lubuntu-14-04/

    Since i had lxqt, i tried changing from startlxde to startlxqt in startwm.sh, voila! It worked.

  20. I can’t input charactors like “.” “-” “/” , only numerical and alphabet works , any fix ?

    This issue happens on lubuntu and lxqt 0.8.0 , lxde works perfectly with keyboard.

  21. Hello Chebria,

    As I mentioned earlier, I never used lxqt, so I cannot tell you right away if this is normal or not…
    As soon as I have some time, I will try to install it and test it more toroughfully
    You can have a look at http://c-nergy.be/blog/?p=3858 to see if there is a keyboard layout issue

    Hope this help
    Till next time

    See ya

  22. Hello Griffon,

    I am trying to use xrdp with LXQt 0.8 but when I try to login I have a grey screen.

    What did you add into your ~/.xsession file for lxqd ?

    Thanks a lot for your help 🙂

    Best,

    F.

  23. Hello Francois,

    You should have checked the comments section (comment n° 13)…or the one of the latest comments

    Since you are using lxqt, you should try to change from startlxde to startlxqt in startwm.sh.

    Hope this help
    till next time
    See ya

  24. Hi there,

    This all works great for me. Thanks for the blog article. One though, when I try to reboot XFCE desktop (through a remote connection from a Windows machine), it just ‘hangs’ and does not actually reboot. Any ideas why not or what I can do? Is this a known issue with XRDP?

    Thanks

    James

  25. Hello James,

    Yes, apparently there is a problem when trying to reboot the machine using the gui. If you need to reboot a machine, use the command line
    you can use sudo reboot

    Hope this help
    Till next time
    See ya

  26. Thanks, I did what was written, but now I have a problem: I purged abiword package and now when I click logout @ LXDE, it won’t log out & won’t kill the vnc. So after several logins, the old sessions leak hundreds of megabytes RAM.

  27. Hello;

    we do not have much experience with LXDE desktop as our favourite desktop is MATE-DEstkop when working with XRDP…
    You can always use the command line to logout from your session (should something like lxsession-logout…

    Hope this help
    Till next time

  28. Man this was super useful. I had two issues.

    1) I got a black screen over and over until I told windows RDP client to ‘always ask for credentials’
    2) I got a grey screen until I used “echo lxsession -s Lubuntu -e LXDE > ~/.xsession” instead of your command.

    I do have a side question that maybe can be answered? Once you’ve gotten your port, is there any way to ‘reserve’ it so that it stays there every time, or is always selected? I thought about editing the ask-1 except that if there’s no session involved, it’ll just error.

    Thanks again for the useful article!

  29. Hello Dave,

    thank you for the comments and the feedback..
    have you installed the lubuntu desktop on your system ? (which might explain why you had to use a different command for /.xsession)
    for getting always the same session in xrdp, you could try to upgrade the xrdp package or to upgrade your os to ubuntu 14.10
    have a look at the following posts http://c-nergy.be/blog/?p=6046 and http://c-nergy.be/blog/?p=6063

    Hope this help
    Till next time

    See ya

  30. Hi,
    I am unable to connect to my virtualbox ubuntu machine this way.

    I used exactly same commands until
    sudo service xrdp restart
    but I am not able to find my machine IP using windows remote desktop.

    Is there something wrong I am doing ??

    I have one more question though.
    I have a VirtualBox Ubuntu Server (Terminal Based), would I be able to get an interface for that using this article.

    thanks in advance.
    Waiting for your reply.

  31. Hello Vikas,

    To connect using xrdp, you need to know the ip address of the ubuntu machine running inside the virtualbox. You also need to ensure that the virtualbox network configuration allows you to connect to the virtual machine…

    To get the ip of your Ubuntu virtual machine, log into it (using virtualbox gui) and in a command prompt type hostname -I
    This should return the ip address of your vm

    From windows workstation, check that the vm is reachable (i.e. ping )
    If you receive a reply, the machine is reachable and you use the remote desktop client of your choice to connect to the ubuntu machine

    If you are not able to ping your ubuntu virtual machine, you might have configured within virtualbox settings, private network or internal network,…..

    To answer your second question, yes, you can definitely add a desktop environement on top of your ubuntu server based virtual machine and you could indeed use xrdp to perform remote connection

    Hope this help
    Till next time
    See ya

  32. I have followed the instruction for both 14.04 and 15.10 but all I get when I try to connect to my lubuntu box is a grey screen and a black X as a cursor, any suggestions? All PC’s are real not virtual and on the same IP range, I have tried two pc’s to try and RDP from to my lubuntu PC , one running windows 10 and the other running debian testing both give the same result.

    Any help would be appreciated, Thanks

  33. Hello Xendistar,

    Gray screen generally means that .xsession is not configured or not configured properly.
    You should have a look at the following post (http://c-nergy.be/blog/?p=5984)

    if you have installed a native Lubuntu machine and try to perform remote desktop to your Lubuntu machine, you might need to change the default command to
    “echo lxsession -s Lubuntu -e LXDE > ~/.xsession”

    We assume that you have configured the .xsession file for the user that you are using to performing the remote desktop session. If you have multiple users that needs to connect, you need to create .xsession for each users or to use this post to enable multiple users to xrdp (http://c-nergy.be/blog/?p=6050)

    Hope this help
    Till next time

  34. when using LXQT I was unable to start the desktop in the default display since im using xorg dummy monitor instead of vnc I had to add the following in the startlxqt file:

    export DISPLAY=:10
    just before the lxqt session command.

    the problem is that for some reason when the remote desktop connects I had to right click open terminal and execute startlxqt command to start the desktop.

    how can i fix that? id like the desktop start automatically.
    thanks.

  35. It seems that the Display is not ready without init the remote session first, thats why i had to first try to connect then execute startlxqt from the terminal.

  36. your artcile is excellent. thanks a lot
    i try to install a desktop environment to Armbian Ubuntu (like a server version, no desktop).
    then installing “lubuntu-desktop”, xorg , display drivers and xrdp.
    i met a grey screen too. using this command (echo lxsession -s Lubuntu -e LXDE > ~/.xsession) solved it.
    forgive my bad english 🙂

  37. @Pankaj,

    Nope, no idea, it should behalve the same way as if you were connected directly to your computer… Try to either remove/re-install xrdp software or try to install an alternate browser and check if this would work for you

    If you upgrade to latest version of ubuntu, you would benefit from the latest xrdp package (o.9.x) that comes with a new xrdp server part (Check this Posts and the comment section as well)

    hope this help
    Till next time
    See ya

  38. @Xuelin,

    Thank you for sharing your experience with us as your feedback help us to improve information provided through this blog to our readers
    Happy to see that we can be helpful in a way or another
    Thank for the visit

    Till next
    See ya

  39. @Griffon

    I’m glad that you can reply me.
    Now, I have another problem. When the first time logs in after switching on computer, It said

    “””
    connecting to sesman ip 127.0.0.1 port 3350
    sesman connect ok
    sending loggin info to session manager, please wait…
    xrdp_mm_process_login_response: login succseeful for display
    started connecting
    connecting to 127.0.0.1:5910
    error – problem connecting
    “””

    However, I tried to log in again, It could log in successfully.The third time, forth time ….. this error had never appaered again.It just appaered at the first time.
    Although, It is not a big problem but I want to kown why.

    hope for your reply, tkx

  40. @2h0u-Xuelin,

    Thank you for the feedback.. You didn’t specify if this was a recurrent issue or if it was at your first login. Indeed, there is a known issue about first time connection (we have mentioned in this post http://c-nergy.be/blog/?p=5984 – Question 24). This applies for the custom installation but we have noticed indeed that time to time first login fails also when standard installation is performed.

    Thank you for the useful information and sharing with us
    We will try to use this info to even provide better information in the future (when time permits)

    Till next time
    See ya

  41. Hi Griffon,

    thank you so much for this article! But I still have a question: I’m connecting to a remote Ubuntu 16.04 LTS by tunneling RDP over SSH from my Windows 10 machine. I observed, that I’m not able to copy-paste between my Windows machine (using the default RDP software and PuTTY) when connecting to this Ubuntu. Any guess why it’s like that and what should be changed?

    Thanks in advance!

  42. @Marren,

    You have to check the version of xrdp you are using. if you have version 0.6.x, this feature is not available by default…..
    IF you have xrdp 0.9.x, and installed from Ubuntu repository, the functionality should be there…. If the package is not available in Ubuntu repository, you will need to perform a custom installation…. To get the package 0.9.x in Ubuntu, you need to use Ubuntu 16.10 or later…

    hope this help
    till next time
    see yq

Leave a Reply