Sponsored Links

X11rdp, Ubuntu 11.10, Gnome 3, xrdp customization – New Hotness! Updated!

Note :  this tutorial is getting really old now and Distributions have moved on a lot since Ubuntu 11.10!
Use X11RDP-o-Matic instead.

 

 

This is a followup to my original article, “Install xrdp and X11rdp – the comprehensive HOWTO for Ubuntu and Debian based systems“. In that article I used the tarball – and hence old – version of x11rdp, because at the time of writing the article, I thought the SVN – hence more up to date – version did not work.

It does in fact work, if you use the more up to date version from the SVN repository, AND you use the newer xrdp server from the Git repository. Thanks to a reader named Daniel for pointing this out.

So now you have a choice, the Old and Busted method from earlier, or the New Hotness I outline below ;)

The info here is also updated so that users of Ubuntu 11.10 (and possibly later, time will tell) can configure RDP to work properly.

The Bonus here is I’ll also add in handy tips on how to customize X11rdp so that it’ll have the rdp session as default when you connect to it, plus how to customize the logo you see when you connect! Hurrah!

2012-05-23 : Update – Instead of doing all this yourself, why not let my new utility do all the hard work for you?

2012-04-07 : Update – How to forward audio from your RDP sessions to your local client :D

2012-03-22 : Update.

Changelog;

  • A recent update to the xrdp code in the git repository prevented the tutorial working – added extra step to xrdp compilation stage (Thanks go to read Daniel!) 

2011-12-02 : Article updated.

Changelog:

  • 1) Explicitly explain about where to perform the various commands as a normal user or as sudo/root. (Thanks go to reader Andriy!)
  • 2) Greatly simplified the method by turning startwm.sh into a symbolic link to call the /etc/X11/Xsession script. (Thanks go to reader Ed!)

2011-11-18 : See Update 1 near the bottom of the article for automatically removing&restoring the background picture for the RDP session.

 

I’m assuming you’re running Ubuntu 11.10, which I wrote about in another article on how to customize that to give you a sensible desktop rather than that abomination they call Unity.

In fact you’d be well advised to read that through right now if you haven’t already, as I’m going to use what I did there, so that when you log into a machine running Ubuntu 11.10, you’ll be presented with a sensible desktop. In fact this article is being written and tested on the fresh 11.10 virtual machine I used in that last article.

1)  Obtain X11rdp from SVN repository…

 

If you haven’t got it already, install subversion – you need it to obtain the SVN version of X11rdp;

sudo apt-get install subversion

Then in a terminal, in your home directory, and as your normal (non-root) user, type;

svn co svn://server1.xrdp.org/srv/svn/repos/main/x11rdp_xorg71

svn will then nab the source from the repository to your home directory.

 

 

2) Compile X11rdp…

This is much the same procedure as outlined in the old article.

Libraries, it’s all about libraries…

 

 

 

You’ll need various development libraries needed to build Xorg;

sudo apt-get build-dep xserver-xorg-core

 

 

 

 

 

This’ll stop the whining…

 

 

If you haven’t done so already, install automake 1.7 and 1.9 – the x11rdp compilation looks for those and whines if it can’t find ’em;

sudo apt-get install automake1.7 automake1.9

 

 

 

 

 

 

Be prepared – this bit takes AGES!

 

Make a directory, to which the X11rdp (and in fact Xorg) build system will place all the built binaries and files. I’ll use;

sudo mkdir /opt/X11rdp

NOTE: /opt/X11rdp will be owned by root. This is the intended result.

Next, go into the root directory of the downloaded X11rdp source tree, which will be in your home directory;

cd x11rdp_xorg71

Then start the compilation using the already configured build script, supplying it with the directory location you made above;

time sudo sh buildx.sh /opt/X11rdp

 

 

Yes that’s right, I added the “time” command in there, which will tell you how long it took to compile.  ;)

Now, be prepared! The compilation takes AGES! You’re basically compiling a whole Xorg tree here – that is – the whole X Window Display System. I’m not joking – this will take a loooooong time, so, go away while it’s doing this (or read on for a bit to see what you’ll need to do next).

 

18 minutes 25 seconds…

 

 

 

OK, so it took my virtual machine with 4 CPU’s running over an iSCSI system disk 18 minutes and 25 seconds to compile. Your machine may be quicker, may be slower – ain’t my fault if it takes longer :)

 

 

 

 

 

There it is…

 

 

After compilation is complete you can (even as a normal user);

cd /opt/X11rdp/bin

ls -lh

To see if everything is there. In my case it is so we continue…

Lastly, we need to soft link the X11rdp binary to /usr/bin;

sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp

 

 

 

 

3) Compile xrdp from the Git repository

My $deity… it’s full of Fail!

 

 

In the previous article I used the xrdp package from the Ubuntu/Debian package repository. This was purely out of convenience and the fact that I had always used it before.

However, both xrdp and X11rdp have been updated a lot and new features added, such that at time of writing, the current version of xrdp supplied by the distribution packages does not work with the SVN version of the X11rdp server. You’ll get an xrdp session filled with garbage, as the screenshot shows. That totally threw me off when I wrote my original article, and I wasted about 2 days trying various different distros, 32 and 64-bit, and was even considering voodoo magic to get it to work ;) … no chickens were harmed though :P

 

 

 

 

Install Git

 

 

 

So we need to nab the xrdp source from the FreeRDP Git repository. To do that we’ll need to install git (if you don’t already have it);

sudo apt-get install git libssl-dev libpam0g-dev

 

 

 

 

 

Install old&busted xrdp package to nab some stuff from it…

 

Next up, we’ll need to nab  the startup script from the old & busted xrdp package, for use with our new hotness compiled xrdp source, so;

sudo apt-get install xrdp

This installs the Ubuntu xrdp package, and also VNC server/clients.

Then

sudo apt-get remove xrdp

This will get rid of Mr Old and Busted, while keeping the newly generated xrdp user,group, and startup scripts, because I didn’t “–purge” them whilst removing – which is one of the useful benefits of using a Debian based system. This will come in very handy later thank you very much ;)

 

 

 

 

Use the source, Luke

 

 

Next up, retrieve xrdp source from the git repository;

NOTE: Again, do this as a normal user, in your home directory!

git clone https://github.com/FreeRDP/xrdp.git xrdp.git

If you have trouble with https , then try

git clone http://github.com/FreeRDP/xrdp.git

 

 

 

 

 

Next, do the following steps, which will

  • compile xrdp
  • install it in the correct locations for Ubuntu usage
  • copy and change the ownership and permissions of the RSA keys required for an encrypted RDP connection;

 

NOTE: Again, this starts off using your normal user account in your home directory…

2012-03-22 NOTE : Added extra step (in orange) so xrdp works correctly again.

A) Compile xrdp

cd xrdp.git
git checkout 4cd0c118c273730043cc77b749537dedc7051571
./bootstrap
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make

B) Install xrdp in the correct locations for Ubuntu/Debian use;

sudo make install

C) Copy and change permissions of the generated RSA keys required for an encrypted RDP session.

NOTE: at this point, you will find yourself in a root prompt (after sudo su -)…

sudo su –
mkdir /usr/share/doc/xrdp
mv /etc/xrdp/rsakeys.ini /usr/share/doc/xrdp/
chmod 600 /usr/share/doc/xrdp/rsakeys.ini
chown xrdp:xrdp /usr/share/doc/xrdp/rsakeys.ini 

 

Stay in the root prompt for the next step.

UPDATE: 2011-12-02; After a bit of conversation in the comments below, a better way of using the startwm.sh script has been figured out.

In the comments section below, you’ll notice I had a nice conversation with reader Ed, and eventually we came up with a better use for the startwm.sh script.

Here’s what to do. You should still be in a root prompt after the “RSA keys” step above…

A) Make a backup of startwm.sh

cd /etc/xrdp
mv startwm.sh startwm.sh.BACKUP

B) Make a symbolic link called startwm.sh , to the file /etc/X11/Xsession

ln -s /etc/X11/Xsession /etc/xrdp/startwm.sh

New startwm.sh method

 

 

Here’s a screenshot showing startwm.sh as now being a symbolic link to the Xsession script.

 

 

 

 

 

Finally, edit /etc/init.d/xrdp and add or change the following near the beginning of that init script;

PIDDIR=/var/run 
SESMAN_START=yes

 

 

Editing xrdp init script

 

 

 

And a screenshot of the lines highlighted.

Note: I copied the old Ubuntu “PIDDIR=/var/run/xrdp” line and kept it as a comment above.

OK, lets try starting xrdp… /etc/init.d/xrdp start

 

 

 

 

 

 

xrdp running

 

 

 

ps ax | grep rdp and… Success! Seems to be up and running.

 

 

 

 

 

 

Okay from another computer try running your RDP client and see if you can connect and log in to an RDP session…

rdesktop -a 16 -g 1240×800 192.168.1.231   (your client and ip address will almost certainly differ from mine)

Seems to be running ok…

 

 

 

And yes indeed, at least the freshly compiled xrdp is up and running.

 

 

 

 

 

 

 

NOTE: If you don’t want to have to be manually hunting down and killing an X11rdp process, and also having to stop and restart xrdp, don’t try logging in like I’m just about to do as a test. We need to proceed to section 4 which is next up, in order to get our sessions running properly…

 

Well at least it isn’t a screen full of garbage… ;)

 

 

 

 

Almost there!

 

 

 

 

 

 

 

At least now there isn’t a screen full of garbage, so the xrdp/X11rdp combination works. How to get a proper desktop though? Oh yes, we need to tell xrdp what type of session we want…

4) Telling xrdp what kind of session we want, after logging in…

UPDATE: I have re-written this section, because of the new method we did above, which has made this procedure FAR simpler!

There is a script in /etc/xrdp called startwm.sh , which is responsible for starting the window manager after you have logged in. In the step above we renamed it and turned it into a symbolic link to /etc/X11/Xsession.

In its original form, the beginning of the script as supplied read like this;

# change the order in line below to run to run whatever window manager you
# want, default to kde

SESSIONS="gnome-session blackbox fluxbox startxfce4 startkde xterm"

start the window manager
wm_start()
{
  for WindowManager in $SESSIONS
  do
    which $WindowManager
    if test $? -eq 0
    then
      echo "Starting $WindowManager"
      $WindowManager
      return 0
    fi
  done
  return 0
}

 

This would have caused us trouble when logging into xrdp, because what it’s saying is “Here’s a default bunch of the usual window managers. Go through each one and if you find one, start it”.

Blech!

Not very flexible, and way over-complicated. Personally speaking, I’d rather it look at a file in my login directory and start whatever window manager or session I want.

Also, we can do really interesting things with a customizable .xsession script – read Update 1 at the bottom of this article for bonus hot-ness ;)

By turning startwm.sh into a symbolic link above, we can now automatically use our .xsession script in our home directory.

A) Edit or create the file .xsession in your login directory.

Please read Update 1 at the bottom of this article for additional hotness – automatically remove background for the RDP session and restore when you log out of the RDP session.

In your home directory there should be a file called .xsession

Don’t worry if there isn’t – it just means you haven’t created it yet. Anyway, after logging in via the xrdp login screen, the .xsession file basically specifies what kind of desktop session we want.

In this case, I’m going to use the Gnome 3 classic session, which if you followed my other article, should be configured by now to resemble a pretty usable old skool gnome desktop.

Simply open up a terminal and as your normal user either edit or create a file called .xsession , and enter the following;

gnome-session --session=gnome-fallback

Save the file, and if the xrdp server is not already running, start it up.

 

Now try to connect to an RDP session!

5) Connect via RDP!

I’ll try using the RDP client from Windows 7, mstsc.exe;

Login details

Display details

 

 

 

 

 

 

 

 

 

 

 

 

 

By the way, remember to select “sesman-X11rdp” module at the xrdp login screen! Log in and…

It Works!

 

 

 

 

Bingo! Works nicely!

 

 

 

 

 

 

As I stated above, you can now specify exactly what session you wish to see when you log in via xrdp.

I installed Xfce, logged out of that RDP session, edited my .xsession file, commented out the gnome session and entered this instead;

#gnome-session --session=gnome-fallback
xfce4-session

Then logged back in;

Xfce Session…

 

 

 

Freedom of choice is wonderful, isn’t it ;)

 

 

 

 

 

 

Note that now you’re using the more recently updated versions of xrdp and X11rdp, you can specify more color depths; 8,15,16,24,32 all work! (Although, I doubt using full 32-bit color over the internet is going to be fast – haven’t tried it yet).

And now for the last section of this tutorial; customization…

5) Customizing the xrdp login screen…

 

A) X11rdp as default on the login screen…

First of all, let’s make the sesman-X11rdp option appear by default. This is useful because A) You don’t have to keep manually selecting it every time, and B) you can just plug in your login and password details to your RDP client and you can log straight into your RDP session.

So with that in mind, have a look at the file /etc/xrdp/xrdp.ini ;

[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=low
channel_code=1
max_bpp=24
#black=000000
#grey=d6d3ce
#dark_grey=808080
#blue=08246b
#dark_blue=08246b
#white=ffffff
#red=ff0000
#green=00ff00
#background=626c72

[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1

[xrdp2]
name=console
lib=libvnc.so
ip=127.0.0.1
port=5900
username=na
password=ask

[xrdp3]
name=vnc-any
lib=libvnc.so
ip=ask
port=ask5900
username=na
password=ask

[xrdp4]
name=sesman-any
lib=libvnc.so
ip=ask
port=-1
username=ask
password=ask

[xrdp5]
name=rdp-any
lib=librdp.so
ip=ask
port=ask3389

[xrdp6]
name=freerdp-any
lib=libxrdpfreerdp.so
ip=ask
port=ask3389

[xrdp7]
name=sesman-X11rdp
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
xserverbpp=24

Notice the section “[xrdp7]” .

It’s the one used for use with X11rdp.

Simply edit that file (you need to be root), cut & paste that to the top of the list and rename it to [xrdp1] , renumbering the others too. You should end up with something like this;

[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=low
channel_code=1
max_bpp=24
#black=000000
#grey=d6d3ce
#dark_grey=808080
#blue=08246b
#dark_blue=08246b
#white=ffffff
#red=ff0000
#green=00ff00
#background=626c72

[xrdp1]
name=sesman-X11rdp
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
xserverbpp=24

[xrdp2]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1

[xrdp3]
name=console
lib=libvnc.so
ip=127.0.0.1
port=5900
username=na
password=ask

[xrdp4]
name=vnc-any
lib=libvnc.so
ip=ask
port=ask5900
username=na
password=ask

[xrdp5]
name=sesman-any
lib=libvnc.so
ip=ask
port=-1
username=ask
password=ask

[xrdp6]
name=rdp-any
lib=librdp.so
ip=ask
port=ask3389

[xrdp7]
name=freerdp-any
lib=libxrdpfreerdp.so
ip=ask
port=ask3389

Save the edited file, then restart xrdp with sudo /etc/init.d/xrdp restart . Then use your RDP client to connect again;

X11rdp Is Now Default

 

 

 

There ya go! X11rdp is now the default session type.

 

 

 

 

 

 

Press Cancel, and now enter your complete login/password details to your RDP client. You’ll be logged straight into your RDP session using the X11rdp server :)

B) Changing the Xrdp Logo on the login screen!

 

I’m including this as a bit of fun, but I can see where this might be useful in a corporate environment where you may wish to place your company logo on the login screen.

It’s actually remarkably simple…

Having looked at the xrdp source, I noticed that the utility loads the logo bitmaps at time of execution, so as an experiment, I spent a little bit of time to come up with a newer, fresher Xrdp logo, here’s what it looks like on the xrdp login screen – compare that to the old logo in the last screenshot above;

New Logo Hot-ness! :D

 

 

 

I think I like mine better, but I’m biased  ;)

 

 

 

 

 

 

Basically all you need to do is replace the logo bitmaps with something of your choice – they have to be saved in BMP format, and it shouldn’t matter if the bitmap is larger or smaller in size compared to the original files (widthxheight in pixels) , because if I’ve read the xrdp source code correctly, it takes the dimensions of the source bitmap and allocates the memory properly for proper fixing into the resultant login screen, from the bottom right outwards. You’ll notice my logo is a bit bigger than the original Xrdp logo.

Xrdp Bitmaps – find ’em here…

 

 

 

The bitmaps, after installation, are stored in the directory /usr/share/xrdp/

 

 

 

 

The two main ones to consider are xrdp24b.bmp, and xrdp256.bmp – obviously for 24-bit and 8-bit versions respectively.

xrdp24b.bmp

 

 

 

 

Here’s the 24-bit one I made in GIMP as an example. If you like it, feel free to use this if you wish, but tell people where you got it from if they ask (and consider making a donation for all this fine work I’ve been doing for your benefit :D ).

 

 

 

 

 

 

xrdp256.bmp

 

 

 

 

And here’s the 8-bit version. Again same condition of use as above :)

 

 

 

 

 

 

Okay and that’s it for this one – I think I’ve covered just about all the specifics which are relevant to Ubuntu 11.10, and once again I hoped this helped!

Have fun!

So, how did this procedure work out for you? Let me know in the comments section! :D
(Oh and please rate and share this on your social links!) 

 

UPDATE 1 : 2011-11-18 :  Automatically remove your desktop background for the RDP session

This is relevant to the Gnome session only…

Edit your .xsession file to look like the following;

background=`gsettings get org.gnome.desktop.background picture-uri`
gsettings set org.gnome.desktop.background picture-uri ''
gnome-session --session=gnome-fallback
gsettings set org.gnome.desktop.background picture-uri $background

Basically this saves your current background setting , then clears it, runs your gnome session, and after you log out of that session, restores the original background setting.

Simple ;)

 

VN:F [1.9.22_1171]
Rate This Article
Rating: 9.8/10 (67 votes cast)
X11rdp, Ubuntu 11.10, Gnome 3, xrdp customization - New Hotness! Updated!, 9.8 out of 10 based on 67 ratings
Share the knowledge :
Facebook Twitter Pinterest Linkedin Digg Delicious Reddit Stumbleupon Posterous Email Snailmail

314 comments to X11rdp, Ubuntu 11.10, Gnome 3, xrdp customization – New Hotness! Updated!

  • dblv

    Hello,

    When I try to do “svn co svn://server1.xrdp.org/srv/svn/repos/main/x11rdp_xorg71

    I have this message : Impossible de se connecter à l’hôte ‘server1.xrdp.org’: Connexion terminée par expiration du délai d’attente

    (that mean “Impossible to connect to host … Connexion aborted” !)

     

    Any Idea ?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi dblv,

      It might mean that the server is blocking your block of IP addresses? I don’t know.

      Why not try connecting from a different IP block? (Via Tor perhaps? Might work.)

      rgds.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Don

    Thank you Kevin! Another excellent article!

    It’s nice to be able to use the more recent versions of xrdp and X11rdp.

    Now if I can only figure out how to make xrdp honor my rdp client setting for not displaying the desktop wallpaper. The wallpaper really slows down the session. But it’s nice and fast without it.

    Don

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hey Don, read Update 1, I just figured out how to do that – and it was made easy by my changing the startwm to use the .xsession file in the home directory ;)

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Don

        Excellent! That is perfect!

        Oh, and I appreciate the way you don’t mind diving into more advanced topics such as the compile and configuration of xrdp. I get plenty of good tips from other blogs but here I usually find something unique and very useful :)

        I can’t wait to see what “New Hotness” you come up with next. ;)

         

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Kevin Cave

          Glad to be of help.

          Suggestions for future articles would be appreciated ;)

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
  • Andy

    Excellent article and worked without any modification on Debian 6.0.1.  My only question is this… how do I modify ~/.xsession to start KDE rather than Gnome?

    Thanks,

    Andy.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Thank you!

      Without being at the machine right now, my immediate guess is to enter “kde-session”. When I get the time I’ll install kde to my virtual machine and give it a try…

      OK, tried it – edit ~/.xsession to say “startkde” and that’ll do it B) … note though there doesn’t seem an easy way to set the kde4 wallpaper and back, but it’s 11:25pm as I type this and I’m going to bed for now – I’ll have a look when my brain is working properly ;)

      I should really update the article to include a lot of the other desktop environments anyway, and head a lot of these questions off at the pass ;)

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Brad

    Thank you for the awesome guide. I’m still learning, but didn’t have too much trouble with it. However, it seems I messed something up as I have to restart xrdp after reboot before I can use it. Any idea where I screwed up? Thanks.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hey Brad,

      Hrm. It sounds as if for some reason you don’t have the service enabled.

      Have a look in the directory /etc/rc2.d , and see if there is a symbolic link (kinda looks like a file) called S20xrdp .

      If there isn’t, then that’s possibly what your problem is, and if you issue the command sudo update-rc.d xrdp enable , that might/should sort the problem out for you.

      If it doesn’t, try issuing sudo update-rc.d xrdp disable , followed by sudo update-rc.d xrdp enable.

      The only way I think this got messed up would be at the stage where we install and then remove without purging, the Debian/Ubuntu xrdp package :)

      Hope that helps!

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Mark

    Awesome write up, but I’m having a problem.
    I get the error: another Xserver is already active on display 13

    It seems to connect at first, but then gets an error. Here is my log:

    [20111127-17:22:43] [INFO ] scp thread on sck 7 started successfully
    [20111127-17:22:43] [INFO ] ++ created session (access granted): username mark, ip 192.168.2.3:60544 – socket: 7
    [20111127-17:22:43] [INFO ] starting X11rdp session…
    [20111127-17:22:43] [CORE ] error starting X server – user mark – pid 10227
    [20111127-17:22:43] [DEBUG] errno: 13, description: Permission denied
    [20111127-17:22:43] [DEBUG] execve parameter list: 11
    [20111127-17:22:43] [DEBUG]         argv[0] = X11rdp
    [20111127-17:22:43] [DEBUG]         argv[1] = :13
    [20111127-17:22:43] [DEBUG]         argv[2] = -geometry
    [20111127-17:22:43] [DEBUG]         argv[3] = 1920×1200
    [20111127-17:22:43] [DEBUG]         argv[4] = -depth
    [20111127-17:22:43] [DEBUG]         argv[5] = 24
    [20111127-17:22:43] [DEBUG]         argv[6] = -bs
    [20111127-17:22:43] [DEBUG]         argv[7] = -ac
    [20111127-17:22:43] [DEBUG]         argv[8] = -nolisten
    [20111127-17:22:43] [DEBUG]         argv[9] = tcp
    [20111127-17:22:43] [DEBUG]         argv[10] = (null)
    [20111127-17:22:53] [ERROR] X server for display 13 startup timeout
    [20111127-17:22:53] [ERROR] X server for display 13 startup timeout
    [20111127-17:22:53] [INFO ] starting xrdp-sessvc – xpid=10227 – wmpid=10226
    [20111127-17:22:53] [ERROR] another Xserver is already active on display 13
    [20111127-17:22:53] [DEBUG] aborting connection…
    [20111127-17:22:53] [INFO ] ++ terminated session:  username mark, display :13.0, session_pid 10225, ip 192.168.2.3:60544 – socket: 7

    And here is the output from starting xrdp:

    root@Ubuntu:/etc/init.d# ./xrdp start
    * Starting Remote Desktop Protocol server                                      process 19799 started ok
    starting sesman…
    sesman config:
    ListenAddress:            127.0.0.1
    ListenPort:               3350
    EnableUserWindowManager:  1
    UserWindowManager:        startwm.sh
    DefaultWindowManager:     startwm.sh
    AuthFilePath:             disabled
    Xvnc parameters:
    Parameter 00                   -bs
    Parameter 01                   -ac
    Parameter 02                   -nolisten
    Parameter 03                   tcp
    Parameter 04                   -localhost
    Parameter 05                   -dpi
    Parameter 06                   96
    X11rdp parameters:
    Parameter 00                   -bs
    Parameter 01                   -ac
    Parameter 02                   -nolisten
    Parameter 03                   tcp
    logging configuration:
    LogFile:       /var/log/xrdp-sesman.log
    LogLevel:      4
    EnableSyslog:  0
    SyslogLevel:   4
    security configuration:
    AllowRootLogin:       1
    MaxLoginRetry:        4
    No TSUsersGroup defined
    No TSAdminsGroup defined
    session configuration:
    MaxSessions:                 10
    X11DisplayOffset:            10
    KillDisconnected:            0
    IdleTimeLimit:               0
    DisconnectedTimeLimit:       0
    [20111127-18:23:12] [WARN ] [init:45] libscp initialized
    [ OK ]

    Any ideas what could be wrong???

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Mark,

      Hmm that’s a good one all right :)

      What linux distro are you running when you try this?

      If you reboot your system and log in normally via your desktop, and then ps axw | grep rdp in a terminal window, do you see any X11rdp process? Also, if you do a ps ax | grep X you should see the X server process which is already running.

      Without seeing that output, I’m guessing that perhaps your running X server is already or somehow running as display #13?

      Give me some feedback on that and lets see if we can get to the bottom of the problem.

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Andriy

      @Mark
      Your ./bootstrap failed under “mark” user because it was issued from dir where “mark” user have not write permission.
      Try to fetch/recompile/rebuild xrdp under mark’s home dir.
      I believe it fix your problem.

      @Kevin
      Excellent article, thanks!
      Could you please put a mention that we need to left root shell and /opt/x11rdp before install xrdp.
      It’s not obvious to everyone.

      Thanks,
      Andriy

      VA:F [1.9.22_1171]
      Rating: +1 (from 1 vote)
      • Kevin Cave

        Andriy, thanks!

        And well spotted!

        Y’know, on hindsight I agree with you – I shall update the article immediately :)

        Regards.

         

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • Mark

    I just installed Ubuntu 11.10. This is the first thing I tried to do since I want it to be headless. Upon reboot I get the following (minus the grep process).

    ps axw | grep rdp:
    982 ?        S      0:00 /usr/sbin/xrdp
    984 ?        S      0:00 /usr/sbin/xrdp-sesman

    ps ax | grep X:
    968 tty7     Ss+    0:31 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none

    I don’t see a 13 anywhere, and there is only a 0 (zero) file in the /tmp/.X*-lock files. Thanks for your help – I’m stumped… :(

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Oh my that’s even irritating me…

      I booted up my ScaryExample VM again and cat a look at the xrdp logs…

      [20111128-13:19:25] [CORE ] starting sesman with pid 948
      [20111128-13:19:25] [INFO ] listening...
      [20111128-13:20:28] [INFO ] scp thread on sck 7 started successfully
      [20111128-13:20:29] [INFO ] ++ created session (access granted): username kcave, ip 192.168.1.10:38450 - socket: 7
      [20111128-13:20:29] [INFO ] starting X11rdp session...
      [20111128-13:20:29] [INFO ] starting xrdp-sessvc - xpid=1849 - wmpid=1848
      [20111128-13:20:57] [INFO ] scp thread on sck 7 started successfully
      [20111128-13:20:57] [INFO ] ++ reconnected session: username kcave, display :10.0, session_pid 1847, ip 192.168.1.10:38454 - socket: 7

      That’s what I got after logging in via rdesktop (logged in twice because immediately after login the first time I got disconnected – just logged in again and I simply got reconnected to that initial session).

      I’m trying to think what could possibly be setting x11rdp to be run as display 13…. lemme see if I can figure that one out and I’ll reply again…

      In the meantime, can you post your sesman.ini, xrdp.ini and startwm.sh to http://pastebin.com and send a link?

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Kevin Cave

      Oh wait… this could be a permissions thing…

      From your paste earlier…

      [20111127-17:22:43] [INFO ] ++ created session (access granted): username mark, ip 192.168.2.3:60544 – socket: 7
      [20111127-17:22:43] [INFO ] starting X11rdp session…
      [20111127-17:22:43] [CORE ] error starting X server – user mark – pid 10227
      [20111127-17:22:43] [DEBUG] errno: 13, description: Permission denied

      Is your username “mark” in the sudoers list? i.e. Can “mark” use sudo ?

      Let me test this on my Example VM…

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Mark
        One difference is that I am using the Windows 7 RDP client.
        When I connect my client it says:
        connection to sesman ip 127.0.0.1 port 3350
        sesman connect ok
        sending login inf to session manager, please wait...
        xrdp_mm_process_login_response: login successful for displa (the rest is cut off)
        started connecting
        connecting...
        connected ok
        Then the window closes. Here are my files:
        
        sesman.ini: http://pastebin.com/UsyxP2KZ
        xrdp.ini: http://pastebin.com/hcVwny8h
        startwm.sh: http://pastebin.com/PNJHdKLz
        
        It seems like it can't start X11rdp which must be trying to start the
        X server using execve and failing because of permissions. Here are my
        permissions on X. mark can't start it without sudo:
        mark@Ubuntu:/usr/bin$ ls -al X
        -rwsr-sr-x 1 root root 9688 2011-09-09 05:42 X
        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
      • Kevin Cave

        Hrm… I cannot replicate the error you’re having, Mark :(

         

        I created a new user “test1” created the .xsession file , and logged in via rdesktop and it works fine… here’s the output of pstree;

             ├─xrdp───{xrdp}
             ├─3*[xrdp-chansrv───{xrdp-chansrv}]
             ├─xrdp-sesman───xrdp-sessvc─┬─X11rdp
             │                           ├─startwm.sh───startkde───kwrapper4
             │                           └─xrdp-chansrv───{xrdp-chansrv}

        and ps;

        kcave@ScaryExample:~$ ps ax | grep rdp
         4555 pts/0    S      0:00 /usr/sbin/xrdp-sesman
         4562 pts/0    S      0:00 /usr/sbin/xrdp-sessvc 4564 4563
         4563 pts/0    S      0:00 /bin/sh /etc/xrdp/startwm.sh
         4564 pts/0    S      0:02 X11rdp :13 -geometry 1400x990 -depth 24 -bs -ac -nolisten tcp
         4565 pts/0    Sl     0:00 xrdp-chansrv

        So, I’m kind of at a loss :(

        I’m wondering if the X11rdp source has been updated since I wrote that article… I’ll make another fresh VM and see.

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • Mark

    One difference is that I am using the Windows 7 RDP client. When I connect my client it says:

    connection to sesman ip 127.0.0.1 port 3350
    sesman connect ok
    sending login inf to session manager, please wait…
    xrdp_mm_process_login_response: login successful for displa (the rest is cut off)
    started connecting
    connecting…
    connected ok

    Then the window closes. Here are my files:

    sesman.ini: http://pastebin.com/UsyxP2KZ
    xrdp.ini: http://pastebin.com/hcVwny8h
    startwm.sh: http://pastebin.com/PNJHdKLz

    It seems like it can’t start X11rdp which must be trying to start the X server using execve and failing because of permissions. Here are my permissions on X. mark can’t start it without sudo:

    mark@Ubuntu:/usr/bin$ ls -al X
    -rwsr-sr-x 1 root root 9688 2011-09-09 05:42 X

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Mark,

      First thing I noticed is you don’t appear to have edited xrdp.ini the way I outlined in my tutorial such that [xrdp1] is the sesman-X11rdp session by default.

      This might be causing the issue your experiencing?

      Just a tentative question here; did you follow the tutorial to the letter? :)

      Regards!

      Edit: Actually, I re-read what you were saying… the binary you should be looking for is /opt/X11rdp/bin/X11rdp … I have no idea why you’d be interested in /usr/bin/X :)

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Mark

        I did follow it to the letter when I could. I only got to the first section 5) where it says to try the client and it failed. A problem I had earlier was that I got errors when I ran the ./boostrap command. It failed. It finally succeeded when I ran as root. I did make some other changes after it failed the first section 5), trying to get things to work. I was able to connect using sesman-Xvnc, but it was really slow. So I tried x11vnc as the server, etc.

        Also, I am running the 32-bit Ubuntu desktop 11.10. And I compared your picture of /opt/X11rdp/bin to mine and they are identical!!! Except for dates and times, but permissions, owners, sizes, etc all match.

        Tried the chmod – no go. I just noticed there is a .xsession-errors file created in my home dir. Bunch of errors in there. Could it be due to errors loading .xsession?

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Kevin Cave

          Would be nice to see what errors you got when trying the ./bootstrap command…

          .xsession-errors is created or added to after an X session of some sort has been started, although there may be some errors in there which could give a clue as to what’s going on in your system.

           

          Regards

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
    • Kevin Cave

      Another thing… perhaps try setting the SETUID flag of /opt/X11rdp/bin/X11rdp?

      cd /opt/X11rdp/bin

      chmod u+s X11rdp

      I don’t know if that’ll solve your problem. If you’ve followed my tutorial to the letter, the owner and group of the X11rdp binary should be root, and setting the SETUID flag means it’ll run as root – that’s probably a security risk BTW, and I don’t have the time to look into the security aspect of that so would advise against that as a permanent solution.

      The only other thing I could suggest is completely purging the xrdp package from your system, purging /opt/X11rdp , completely removing the build directory, and starting from scratch again – the tutorial I wrote was made using a completely freshly installed Ubuntu 11.10 64-bit edition running in a vm, and it works the way I’ve written it – and others have stated it works for them :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Only1KW

      I hit this same issue. However, the fix was simple. When I ran “ps ax | grep xrdp”, I got way more stuff:

      root@ayla:/etc/xrdp# ps ax | grep rdp
      1506 ? S 0:00 /usr/sbin/xrdp-sessvc 1508 1507
      1508 ? S 9:29 X11rdp :12 -geometry 1600x900 -depth 16 -bs -ac -nolisten tcp
      1512 ? Sl 0:00 xrdp-chansrv
      3548 ? S 0:00 /usr/sbin/xrdp-sessvc 3550 3549
      3551 ? Sl 0:00 xrdp-chansrv
      4154 ? S 0:00 /usr/sbin/xrdp-sessvc 4156 4155
      4172 ? Sl 0:00 xrdp-chansrv
      4301 ? S 0:00 /usr/sbin/xrdp-sessvc 4303 4302
      4303 ? S 0:20 X11rdp :13 -geometry 1920x1080 -depth 16 -bs -ac -nolisten tcp
      4304 ? Sl 0:00 xrdp-chansrv
      28313 pts/4 S 0:00 /usr/sbin/xrdp
      28315 pts/4 S 0:00 /usr/sbin/xrdp-sesman
      28320 pts/4 S+ 0:00 grep --color=auto rdp

      Once I cleaned up all processes except the final three, all was fine and I could connect.

      Kevin, you may want to add those instructions for those of us that originally ran the steps in your first post on this and then later followed the steps in this post.

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Ed

    Kevin,

    Great followup article from your previous 11.04.  I got 11.10  up and running as you direct.  Synaptic does not run on a remote desktop from Windows.  I’m sure it’s a permission thing.  I tried putting an empty .Xauthority in the home directory with the user’s permissions, but that does not make things run. Any input would be appreciated.  FYI: This all works follwing your 11.04 directions.

    Ed.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Ed, I just investigated the “Synaptic not running from the menu” problem and could replicate it as you described.

      There is a solution, and I’ll detail it here – you can either follow this, or – haha – the alternative method is to just press ALT-F2 and then type gksu synaptic ;)

      It’s all down to the /etc/xrdp/startwm.sh script, and the subsequent calling of the gnome session in the ~/.xsession script.

      The problem exists because we’re launching a somewhat “simpler” gnome session than is otherwise created by logging in directly at the PC’s console via the gdm display manager, which uses its own kind of “startwm.sh” script, but instead called Xsession, the full path being /etc/gdm/Xsession. If you look at that script, it’s a heck of a lot more complicated than our startwm.sh, as it sets up lots of other gnome, dbus, shell environment goodies, etc. etc.

      The good news, is that we can use that Xsession script :D

      Try this;

      [EDIT: THIS SOLUTION MIGHT NOT BE THE MOST OPTIMAL – IT DOES WORK BUT IT SEEMS NAUTILUS ISN’T LIKING IT, SO I MAY HAVE TO TRIM DOWN THE RESULTANT SCRIPT TO SUIT xrdp MORE… PLEASE LET ME HAVE A FURTHER LOOK AT IT BEFORE IMPLEMENTING THE FOLLOWING… you have been warned :) ]

      [EDIT 2 : Actually, panic over – I must have confused dbus/gnome/nautilus when I was trying to find out this solution – a quick reboot of the system and this seems to work well. Carry on! :P ]

      [EDIT 3: Yeah it’s doing it again. The first time I log in via RDP it works great, if I log out then back in again however, nautilus starts pegging the CPU and there’s a lot of network traffic from the VM… let me look into this, it’s kind of perplexing…]

       

       

      [EDIT 4: Okay nautilus doesn’t like this for whatever reason so it’s advisable to install gnome-tweaks and disable nautilus running the desktop ( Set “Have file manager handle the desktop” to “OFF” under the “Desktop” heading of the gnome-tweaks {called Advanced Settings in the start menu} app.
      Also, for some reason gnome-terminal uses quite a bit of CPU as well – advise using alternate terminal, like xterm for example. Lastly, the xsession file can remain as is in the tutorial above.]

       

      1) Steal a copy of the gdm Xsession script and use that.

      Backup the old startwm.sh first;

      sudo cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.OLD

      Then;

      sudo cp /etc/gdm/Xsession /etc/xrdp/startwm.sh

      sudo cp /etc/X11/Xsession /etc/xrdp/startwm.sh

      [EDIT 5 : Actually, use /etc/X11/Xsession instead – it’s more generic than the gdm one and works just as well]

      2) Run Advanced Settings from your start menu and under “Desktop” set “Have file manager handle the desktop” to “OFF” – otherwise nautilus, if it’s set to draw the desktop, will run amok on your system and peg your cpu and make me look bad ;)

      Also, for some reason I noticed that gnome-terminal from time to time likes to eat cpu cycles – I suggest using xterm or some other alternative if you also notice this behavior.

       

      3) After you’ve done that,  try a new RDP session – you’ll find that starting Synaptic and probably all the other utilities that need sudo or root privileges, now work. :)

      Regards!

       

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Ken

        Hmm…  I still have an issue that I think may be related to this or Xauthority somehow, even after following these instructions.  Wondering if you can help

        Remotely, when I try and run “Disk Utility” from the menu, it runs, but when I try and do something that requires privileges(eg. in my case, run benchmark on my drives), it says “Not Authorized”.  If I run “gksu palimpsest” from the terminal, it starts up Disk Utility with root privileges and I can run drive benchmarks fine.

        If I try and run “Disk Utility” from the menu while I’m at the actual box(ie. not remotely through xrdp), it runs fine and I can run drive benchmarks.  So its something to do with the user I’m using while logged in remotely, even though I’m logged in as the same user both locally and remotely.

        Any tips?

        PS. I notice that when I run xauth remotely, it says I’m using ~/.Xauthority.  When I run xauth on the local machine, it lists some other file along the path /var/run/something/something   Is that anything to do with it?

        PPS. Tried to look for more stuff on net, and looks to be other symptoms of same problem- a) can’t see the network icon on top bar b) in the “users and systems” utility, when I click on Add, it just clicks and does nothing, same with Advanced.  When I try and do this on local, it works fine

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Kevin Cave

          Ken, I’ll have another look into it and get back to you if I find out what’s causing it. You might try ALT-F2 to bring up the command line menu and gksu <utility-name> in the meantime? Might work.

          Regards.

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
          • Ken

            ya that works for the “disk utility” GUI program, but unfortunately doesn’t work for the “users and systems” utility(it just hangs and never comes back), so I can’t add users, etc.. through the GUI.  I can of course, do it through the CLI, but prefer not to if there was a GUI equivalent.

            I’ll keep playing around with it as well.  Am now on 11.04 cos for some reason, it seems to run faster overall for me than 11.10.  I’ve seen this behaviour on both 11.04, and 11.10 so its not isolated to just 11.04.

            VN:F [1.9.22_1171]
            Rating: 0 (from 0 votes)
            • Kevin Cave

              Hi Ken,

              Hrm. So, I’ve been looking into this, and the problem appears to be something to do with xrdp-sesman’s interaction with ConsoleKit. After logging in via xrdp, I bring up a terminal and run ck-list-sessions.

              The output I get is;

              kcave@ScaryExample:~$ ck-list-sessions
              Session10:
              unix-user = '1000'
              realname = 'Kevin Cave'
              seat = 'Seat1'
              session-type = 'x11'
              active = TRUE
              x11-display = ':0'
              x11-display-device = '/dev/tty7'
              display-device = ''
              remote-host-name = ''
              is-local = TRUE
              on-since = '2012-02-15T06:55:24.215817Z'
              login-session-id = ''

               


              Session13:
              unix-user = '1000'
              realname = 'Kevin Cave'
              seat = 'Seat9'
              session-type = ''
              active = FALSE
              x11-display = ':10.0'
              x11-display-device = ''
              display-device = ''
              remote-host-name = ''
              is-local = FALSE
              on-since = '2012-02-15T07:07:34.186795Z'
              login-session-id = ''

               

              Note I’ve been logging in and out a few times, and been playing about with the pam.d files, but…

              “Session10” is me logged in via GDM, and I can like yourself use Disk Utility’s benchmark etc etc…

              “Session13” (heh, lucky for some) is the RDP session, and as you’ll notice, the parameter active is set to FALSE. It’s this which is probably causing the issue of having no permissions to do certain things via the RDP session.

              I’m now having a look at how this can be resolved. I have tried removing “nox11” from the file /etc/pam.d/session-common , but this doesn’t appear to solve the problem. Still looking for a solution to this – either it’s going to be as simple as reconfiguring the options in /etc/pam.d/xrdp-sesman and others in the PAM directory, or we’re going to be unlucky and it’s going to involve changes in how the sesman code authenticates or talks to PAM.

              Edit : I’ve highlighted what I think are the relevant parts in each session. I think all of those need to be “true” in some form or other, in order for PAM to allow the logged in user be able to perform administrative tasks (like benchmarking in Disk Utility, user administration etc.). Will investigate further…

              Let’s see if we can’t whack this one down :)

              Regards!

              VN:F [1.9.22_1171]
              Rating: 0 (from 0 votes)
              • Ken

                Ah, its great you can reproduce the problem.  I thought it was just me that was experiencing these issues! :)

                Something that’s different on my ck-list-sessions is that I’ve got is-local = TRUE for both sessions.  Although, like you said, one Active = false, and the other Active = true.

                Glad that you’re looking at it.  Hopefully with your expertise in these matters, we might be able to make some headway.  I’m a linux newbie and have no idea what I’m doing at all, other than following your tutorial.  I’m surprised I worked out the fonts problem by myself, although I do wish I understood the make install enough to not have to compile xrdp on the target system.  I’ve been googling this all over the place, and no one seems to have found a solution to it yet.  I’m thinking that it might be because most hardcore linux people are probably used to using the CLI, so this problem may not even be a problem or they don’t notice it.  I’ve been looking at PAM as well, but no luck for me.

                Easiest way for me now to see if anything’s changed is to look for the network connection icon on the top panel.  If its not there, I take it that the permissions or whatever isn’t right, and then when i check in the users application or the disk utility application, I’m limited there too.

                VN:F [1.9.22_1171]
                Rating: 0 (from 0 votes)
                • Ken

                  SUCCESS! My supreme googling skills have saved the day! :)

                  Looks like the network connection icon on top panel is unrelated to the authentication issues.  The network icon only shows up for first user that logs on(http://www.ubuntugeek.com/possible-solutions-to-fix-the-missing-network-manager-icon-in-ubuntu-9-10.html).  If I log off the user on the actual machine and log in via RDP, I can then see the network icon successfully. So, not really an issue.

                  The issue with the authentication with Disk Utility and Users&Groups apps are something to do with polkit.  Found this very useful post: http://askubuntu.com/questions/47942/when-machine-is-headless-user-is-no-longer-privileged .  I ran the script in the answer, and followed the instructions and voila, when i log in via RDP, all the apps that used to require authentication(but never asked) work as expected :)

                  Hope that helps for anyone else who was getting pissy with this like I was!

                  VN:F [1.9.22_1171]
                  Rating: +1 (from 1 vote)
                  • Kevin Cave

                    Ken,

                    I gave you a Thumbs Up for that one – thanks for the research! I haven’t had the time recently to look into these things – been busy relocating the blog to a new VPS  and learning how Nginx works ;)

                    I’ll have a look at that post about the authentication and will revise the article to reflect that :)

                    Regards!

                    VN:F [1.9.22_1171]
                    Rating: 0 (from 0 votes)
  • Ed

    Kevin,

    What I did to get things going is to keep .xsession as you direct in your article.

    In startwm.sh, at the end I comment out : #pre_start,  #wm_start, #post_start and add this just before the exit 1:

    . /etc/X11/Xsession

    It has worked thus far, but more test is required.

    Regards,

    Ed.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Ed, lol, yeah that would work too, and is less drastic than copying the Xsession file over to startwm.sh ;)

      I did find though that nautilus in the RDP session after that was using a helluva lot of CPU and froze up on me if it was set to handle the desktop.

      I also found that gnome-terminal was also – for some reason I cannot fathom – using a lot of CPU, even when idling (e.g. no scrolling output etc).

      It was weird, because there was a lot of data streaming to the RDP client, but apparently nothing happening on the RDP display itself.

      I tried to find out what was going on – even went as far as using Wireshark to examine the packets going to the RDP client, but even then I still couldn’t see what was happening.

      I didn’t get any of that behaviour with Nautilus set to not handle the desktop and also running good old Xterm.

      Weird.

      I also didn’t see that behaviour when using Xfce4 as the desktop.

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Ed,

      As you can see, I decided to completely update the article with respect to calling the Xsession script. I decided to just turn startwm.sh into a symbolic link pointing to it.

      Once again, thanks for the conversation!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Mark

    Kevin,

    I decided to purge everything and start over. This time it all worked. But I don’t have access to any gui apps or even logout. And adding –session=gnome-fallback after gnome-session or changing it to xfce4-session both failed. But it’s an improvement…

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Ciek

    Hi Kevin,

    Many thanks to You for that xrdp tutorial. All is working like a charm. Anyway I’ve got a – maybe simple – question. Is it possible to use gnome interface while connected via xrdp? There is no problem in switch .xsession file between unity,or gnome classic, but I can’t figure out how to use just  main GNOME interface (that with rounded menu) in remote desktop connection. I can’t find any answer. Thanks for Your time.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Ciek

      Unfortunately, the gnome-shell interface will only work on displays with 3d acceleration, so the quick answer is basically “no” – RDP protocol is 2d only.

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Ruediger Meyer

      Actually you can install unity-2d. In that case, Kevin is right, you have at least the look and feel without 3d.

      Greetings

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Hi,

    Thanks for this. It worked for me. I have one minor correction for section 3A where you are compiling xrdp. The dashes in the configure command are not standard on this web page. I just copied and pasted it from here to a terminal and I received this message: “configure: error: invalid variable name: `–prefix'”. I typed over all 3 dashes to get it to run successfully. Below is the original and modified lines. You can barely distinguish the difference in the dashes but they are different.

    ./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var
    ./configure -prefix=/usr -sysconfdir=/etc -localstatedir=/var

    Also, I am wondering how often these changes will get overwritten if I do an sudo apt-get update and sudo apt-get upgrade once a week. Do you have any predictions?

    Thanks again, PLA

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Patrick, and thanks!

      Thanks for the heads-up on the dashes… wordpress seems to like converting two single dashes into a non-standard weird long single dash. I didn’t catch that one – it definitely looks like two single dashes at the back-end I swear! ;)

      I just converted that paragraph to pre-formatted and the dashes came out right.

      As to your second point, APT does not touch packages that have been removed but not purged, even with an apt-get update/upgrade – hence my use of that technique in this tutorial. :)  [If that behavior ever changes then I’ll revise this article asap!]

      Regards!

      VN:F [1.9.22_1171]
      Rating: +1 (from 1 vote)
  • ciso

    Excelente muy buen trabajo felicitaciones.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Matthew

    This article worked great. It is so much better than using VNC.

    I did have one issue and that was because I was not paying that much attention to the .xsession file. I was missing a dash in front of  "session=gnome-fallback"  it needs a total of two dashes in front of it "gnome-session --session=gnome-fallback". I was trying to connect and it would instantly disconnect me. I was almost too the point of purging the packages when I decided to read through the article one more time double checking everything.

    I had xrdp working before but I reinstalled ubuntu because all I could get was that stupid global menu at the top bar…it almost made me think I was on a MAC. I followed your other guide for customizing it too look like the classic gnome and I am all set now. I do however like the new regular Gnome desktop it seems to work very well and is much more functional than Unity.

    Thanks Kevin for all the hard work on this article.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Matthew,

      Thanks for the comments!

      Yeah, WordPress has a nasty habit of displaying a double-dash as a weird single long dash. I keep forgetting to properly format the quotes to “preformatted” in the editor, so that particular one slipped the net. I’ve now fixed that bit and I’m sorry you fell into that trap. :)

      But thanks for giving me the heads-up on that :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Erik

    I followed your instructions and build the X11rdp server on openSuSE 11.3 following the instructions at http://www.linuxquestions.org/questions/linux-server-73/xrdp-authenticates-but-does-not-load-x-server-rdp-592138/

    However, when I login using rdesktop, I see a garbled desktop. Much like white noise on a television. What could be the problem here? Could there  be a compatibility issue in encryption? I used the latest X11rdp from subversion and the latest xrdp from git.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Erik,

      I have no experience with OpenSuSE – I usually stick to Debian-based distros (although I have recently installed Fedora 16 in a vm just to have a look at how the RPM universe is doing these days).

      I also did not see exactly how you proceeded to try the above in OpenSuSE – which makes it very difficult to figure out what’s going on.

      The only time I saw the rdp session corruption is when I used an older version of a distribution’s xrdp package with the newer version of X11rdp server, therefor that might lead me to believe that somewhere within your system there lurks an old version of xrdp?

      Try searching for instances of the xrdp files within your system – that’s the only thing I can think of right now.

      Perhaps it’s time for me to write a new article, catering  for RPM-based distributions ;)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Alex

    I already installed xdrp by anotherone and this instruction, but have same problem:

    then xvnc-sesman start loading it show me :

    failed to load session ‘ubuntu’

    what should I do, to fix it?

     

    Cheers!!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • aaron

    thanks.  just updated an extra dev box to 11.10 that I use (I rdp to it from a win box and don’t want the extra k&m laying around all the time) the rdp was fail, I had a blank desktop that would not accept any commands – couldn’t even logout of the session

    well….followed your setup for x11rdp and voila – works.  Also reverted desktop mgr back to gnome – not going to try to use the horribly unusable window manager called unity, it really sucks bad…..thanks for all the goodness that is rdp with gnome – win!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • ubiquo

    Thank you very much!
    I was finally able to see xrdp working.

    However, from the step three something must have gone wrong.
    I did not see a session filled with garbage using sesman-Xvnc and the error “only supporting 8 and 16 bpp rdp connections” using sesman-Xrdp, but I continued anyway after taking a snapshot:)

    I stopped at the end of step three, because instead of seeing the desktop as before I see  a small white terminal window.
    Can you imagine what I did wrong?

    Happy new year to all!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi ubiquo,

      I did not see a session filled with garbage using sesman-Xvnc

      sesman-Xvnc wil start the vncserver backend, rather than the rdp backend :)

      I stopped at the end of step three, because instead of seeing the desktop as before I see a small white terminal window.
      Can you imagine what I did wrong?

      I can’t even begin to imagine what you did wrong ;)  I suggest starting from the beginning again. I’ve performed this same set of instructions on many of my own installations and VM’s, and it works every time :) – even on Debian and Linux Mint installations :)

      I presume you’re doing this using the latest Ubuntu or Debian or Mint distros?

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Poison-Reverse

      This isn’t a fix but might explain why you got that error message. The default color bit in RDP is 32bit. If you change the color depth to 16bit you’ll see the garbage like in Kevin’s example.

      I was getting the same error as you, and was able to fix it using his instructions. I’m using Ubuntu 11.04. Note to other’s, if you get the 8 and 16 bit error message when connecting… You’re on the right track. Try following Kevin’s instructions starting at #3 “Compile xrdp from the Git repository”

      Good luck.

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • ubiquo

    Thank you Kevin, I will restart from the beginning.

    I’m using Ubuntu 11.10 and xrdp was already installed when started this test; should I remove xrdp before proceeding with step two?

    Thank you again and best regards.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Try completely removing xrdp (purging) before starting… I don’t know if that’ll make any difference, but it’s worth a try.

      Please let me know how you got on :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Hi,

    I followed all the instructions down to the end of section 4 and now have XRDP running fine – thank you.

    Points of interest:

    a) if you don’t set up .xsession then you get the Unity interface, but it works – which it didn’t under the standard 11.10 distribution.

    b) When running the RDP client on Windows 7 this version of XRDP supports cut and paste between the RDP client and the XRDP windows – both ways.

    I had a bit of trouble extracting all the commands out of the splendid text above.  So here they are, with a few extra sudo added in for good measure because I had to restart after a mis-copy !  Hope this helps anyone who just wants to do it all.

     

    sudo apt-get install subversion

    svn co svn://server1.xrdp.org/srv/svn/repos/main/x11rdp_xorg71

    sudo apt-get build-dep xserver-xorg-core

    sudo apt-get install automake1.7 automake1.9

    sudo mkdir /opt/X11rdp

    cd x11rdp_xorg71

    time sudo sh buildx.sh /opt/X11rdp

    cd /opt/X11rdp/bin

    ls -lh

    sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp

     

     

     

    sudo apt-get install git libssl-dev libpam0g-dev

    sudo apt-get install xrdp

    sudo apt-get remove xrdp

     

    git clone https://github.com/FreeRDP/xrdp.git xrdp.git

     

    cd xrdp.git

    ./bootstrap

    ./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var

    make

     

    sudo make install

    sudo su –
    mkdir /usr/share/doc/xrdp
    mv /etc/xrdp/rsakeys.ini /usr/share/doc/xrdp/
    chmod 600 /usr/share/doc/xrdp/rsakeys.ini
    chown xrdp:xrdp /usr/share/doc/xrdp/rsakeys.ini

    cd /etc/xrdp

    mv startwm.sh startwm.sh.BACKUP

     

    ln -s /etc/X11/Xsession /etc/xrdp/startwm.sh

     

     

    Finally, edit /etc/init.d/xrdp and add or change the following near the beginning of that init script – NB change both lines;

    PIDDIR=/var/run

    SESMAN_START=yes

     

     

    /etc/init.d/xrdp start

    ps ax | grep rdp

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Kevin,

    Thank you so much for this. I’ve just built a Developing Hypervisor and this was one of the projects I had on it. I’m using Gentoo which build from source anyway. If it is ok with you, I would like to use your instructions as a base for the complete ebuild in Gentoo. Right now, we only have xrdp (a overlay at that) using tigervnc (no clue why), but after many tries and tests, I have found the sweet spot and can recreate the success over and over. The bulk of the information was from here and Linuxforums, so thank you!!!!

    Mike

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
    • Kevin Cave

      Michael, glad this was of help to you!

      Sure, go right ahead :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • prasad

    Awesome. Been mucking around with ssh X11 tunnelling and flaky tunnels and  Windows clients.

    This worked out great. Installed under  Debian Squeeze with LXDE, the compilation went thru without a hitch.

    What controls how many concurrent sessions for a specific user?

    Cheers

    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Lol, X11 tunneling over the internet is painful!

      Glad that worked out for you.

      As for your question, usually RDP is limited to 1 session per user… if you disconnect from that session, as long as you reconnect with the same resolution and colour settings, you’ll get reconnected to that session.

      If you want more than 1 session for the same user, you could try a different session with a slightly different resolution setting. Might work, I never tried ;)

      Regards

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Hi,

    thanx for your really good tutorial. It is very good explained and everything worked fine for me.

    Thumbs up :)

    Greets Chriz

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Ken

    Hello again Kevin!  Actually meant to post the comment on this page rather than the one before, but brainfart! :)

    Anyway, I’ve set up a VM to do the compile for this, following your instructions.  I’m very much a Linux newbie, so having all the steps set out has been very helpful.  I’ve managed to compile the X11rdp binary as per your instructions.  Is it now possible to just copy this binary file to the intended install on another machine?  Reason I ask is that my “real” Ubuntu install is on my NAS on a small USB disk, and rather than do a full get of the source code, etc, and compile on the NAS(ubuntu installed on USB stick, so trying to lower the number of writes, etc), I wanted to do the compile on my faster machine, then move the relevant parts over, ready to be used.

    Same with the xrdp stuff as well, is it possible to grab the updated source code from git, recompile, etc. then move it over to another installation?

    Or do I have to do the whole process on the actual target installation?

    Also, you mentioned setting up a “gnome-fallback” in the other comment.  Is this necessary?  I have no real experience with either unity or gnome, so happy to just plug along with Unity for now.

    Thanks again for your help mate.

     

    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hello again :)

      Your idea should work – if the target machine has the same CPU architecture as the machine you’re building it on – i.e. build on a 32-bit installation to copy over to a 32-bit installation of linux.

      You should be able to build everything on the faster machine and as you say, copy everything over to the other one, then pretend you built it on that and follow the instructions for making the necessary adjustments to the various files, symbolic links, etc etc.

      Remember though to follow the part of the instructions where I say to install the xrdp package from the ubuntu repositories then uninstall without purging – that’s important ;)

      Give it a try at least, then tell me how you got on.At the very worst, if that doesn’t work, you may have to do everything from the slow box :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Ken

        Been googling lots of stuff on Linux making, linking, etc..slowly slowly starting to make sense.  I “think” it should be sufficient to just copy the compiled X11rdp binary across to then /usr/bin directory on the target install.  I’ve seen a few tutorials on x11rdp which mentions just that, compiling on a machine and copying across to the /usr/bin directory on target machine.  Will test that soon I hope.  The only iffy bit is that there are other files in the /opt/X11rdp/bin/ directory which I’m not sure is needed for the binary to work, but as some of these are just links, I don’t see how to copy these over as well.

        The xrdp part I think gets a bit messier.  I think the part from the “sudo make install” step onwards needs to be done on the target machine so what I’ll do is copy everything from the xrdp.git after the “make” command over to the target machine then will do the “make install” there, which should put everything needed into the right places, hopefully that’ll work.

        I’ll give it all a shot, and report back.

        Btw, did you have anything to add to the part where I was asking about  “gnome-fallback” and whether it was necessary?

         

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Kevin Cave

          Btw, did you have anything to add to the part where I was asking about  “gnome-fallback” and whether it was necessary?

          Well the Unity interface uses the 3D capabilities of your graphics card (there is however a Unity 2D session) , but, honestly, for RDP sessions, in my opinion you’re better off with a more traditional desktop manager look and feel – with the “Start” button and menus – so I personally recommend using it.

          However the choice is up to you of course :)

          Regards!

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
          • Ken

            Managed to compile X11rdp successfully on one machine, then moved it to target machine. When I run it on the target machine, I get an error message saying the following:

            Could not init font path element /opt/X11rdp/lib/X11/fonts/misc/, removing from list!
            Could not init font path element /opt/X11rdp/lib/X11/fonts/TTF/, removing from list!
            Could not init font path element /opt/X11rdp/lib/X11/fonts/OTF, removing from list!
            Could not init font path element /opt/X11rdp/lib/X11/fonts/CID/, removing from list!
            Could not init font path element /opt/X11rdp/lib/X11/fonts/100dpi/, removing from list!
            Could not init font path element /opt/X11rdp/lib/X11/fonts/75dpi/, removing from list!

            On the compiling source machine, I noticed that there’s a symbolic link(?) in the /opt/X11rdp/lib/X11/fonts that points to /usr/share/fonts/X11. When I created this symbolic link manually on the target machine(by creating the /opt/X11rdp/lib/X11/ directory structure and creating the fonts symbolic link to the /usr/share/fonts/X11 directory), the X11rdp binary then works. I still get the other error messages for the TTF, OTF, CID, 100dpi and 75dpi directories, but it seems as long as it can find the misc directory, it keeps working. No idea where those other directories live as I can’t find them on my ubuntu 11.10 install.

            When I look at the buildx.sh file on the compiling machine, I see that it creates this symbolic link automatically as part of the build process. Is there any way of changing the compile settings so that it looks for the fonts in the right directory(/usr/share/fonts/x11) in first place rather than depend on a script on the build computer which means that the binary isn’t really transportable without manually creating the symbolic links?

            Edit: Scrap that question.  After playing with it a bit more and googling, I found a post(http://www.linuxquestions.org/questions/linux-server-73/xrdp-authenticates-but-does-not-load-x-server-rdp-592138/), which fixed my issue.  Had to edit the buildx.sh file, and add the option “–with-fontdir=/usr/share/fonts/X11”.  After doing this, and recompiling, it now looks in the right directory without having to recreate the directory hierarchy and symbolic link.  It still can’t find the other font directories, but the binary seems to work.  Now when I connect via RDP, I get a garbled green screen, so looks like I just need to recompile the newest version of xrdp now and it should work.

            Still, don’t agree with how this build script assumes that the binary will only be used on the machine its being compiled on.

            VN:F [1.9.22_1171]
            Rating: +1 (from 1 vote)
            • Kevin Cave

              Edit: Scrap that question.  After playing with it a bit more and googling, I found a post(http://www.linuxquestions.org/questions/linux-server-73/xrdp-authenticates-but-does-not-load-x-server-rdp-592138/), which fixed my issue.  Had to edit the buildx.sh file, and add the option “–with-fontdir=/usr/share/fonts/X11″.  After doing this, and recompiling, it now looks in the right directory without having to recreate the directory hierarchy and symbolic link.  It still can’t find the other font directories, but the binary seems to work.  Now when I connect via RDP, I get a garbled green screen, so looks like I just need to recompile the newest version of xrdp now and it should work.

              Still, don’t agree with how this build script assumes that the binary will only be used on the machine its being compiled on.

               

              LOL, there’s a whole heap of things wrong with that build script, the main one for me is you have to build a COMPLETE XORG SYSTEM just to get a resultant X11rdp binary!

              I’ve been thinking about making a fork of x11rdp, and changing it so that all you’d need is the Xorg-dev packages installed on your machine and x11rdp would compile against that. Thing is, that would take a whole heap of time and effort… hrm…

              VN:F [1.9.22_1171]
              Rating: 0 (from 0 votes)
              • Ken

                Compiling the x11rdp binary and then moving to target machine was simple enough(once I fixed the fonts problem).  However, trying to compile and move the xrdp portion was much harder, and with my limited knowledge, impossible.

                I tried to copy everything from xrdp.git after the “make” command to the target machine, and then tried to run a “sudo make install” but that failed with some dependencies.  I ended up getting the dependencies, rerunning “sudo make install” and then re-iterating until I finally got a success from the “sudo make install”.  Was quite annoying but at the end it worked, and the BIG compile of the xrdp binary was able to be done from another machine, which was my main aim.

                Now, I can rdp into the machine and it works beautifully.  I never really like VNC, it always seemed a bit “toy-like” and laggy to me.  Much prefer rdp, as it feels like you’re actually on the machine.  Thanks for the instructions :)

                The only pissy bit is that I’ll have to repeat most of this on every install I do, rather than just being able to copy some executables over.  Hopefully the apt package gets updated to the latest version soon enough and I can just do an apt-get to get this version.

                 

                VN:F [1.9.22_1171]
                Rating: 0 (from 0 votes)
  • Jaakko

    Hey nice stuff.

    However Im having issues with sesman. Did your tutorial to the letter and for some reason my ubuntu 11.10 is not accepting xrdp connections anymore. I had working xrdp setup before but with the missing desktop icons issue. So I tried this. I can get the machine to accept rdp connections if I just run /usr/sbin/xrdp –nodeamon. Of course this doesnt work properly. But it shows that the issue is with sesman, not xrdp?

    Any ideas where my issue could be?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Jaakko,

      Hrm, without seeing what’s going on in your system, it’ll be difficult to tell what’s happening…

      Try this;

      sudo /etc/init.d/xrdp stop

      then;

      sudo /etc/init.d/xrdp start

      This is the output of that last command for me;

      $ sudo /etc/init.d/xrdp start
      Starting Remote Desktop Protocol server : xrdpprocess 9112 started ok
      sesmanstarting sesman...
      sesman config:
      ListenAddress: 127.0.0.1
      ListenPort: 3350
      EnableUserWindowManager: 1
      UserWindowManager: startwm.sh
      DefaultWindowManager: startwm.sh
      AuthFilePath: disabled
      Xvnc parameters:
      Parameter 00 -bs
      Parameter 01 -ac
      Parameter 02 -nolisten
      Parameter 03 tcp
      Parameter 04 -localhost
      Parameter 05 -dpi
      Parameter 06 96
      X11rdp parameters:
      Parameter 00 -bs
      Parameter 01 -ac
      Parameter 02 -nolisten
      Parameter 03 tcp
      logging configuration:
      LogFile: /var/log/xrdp-sesman.log
      LogLevel: 4
      EnableSyslog: 0
      SyslogLevel: 4
      security configuration:
      AllowRootLogin: 1
      MaxLoginRetry: 4
      No TSUsersGroup defined
      No TSAdminsGroup defined
      session configuration:
      MaxSessions: 10
      X11DisplayOffset: 10
      KillDisconnected: 0
      IdleTimeLimit: 0
      DisconnectedTimeLimit: 0
      [20120125-08:32:25] [WARN ] [init:45] libscp initialized.

       

      Do you see any error messages or anything to indicate that xrdp isn’t starting properly?

      Also, if you type;

      ps ax | grep sesman

      ..do you see the process for sesman coming up?

      When I do that I get this;

       

       

       

      $ ps ax | grep sesman
      1440 ? S 0:00 /usr/sbin/xrdp-sesman
      9084 pts/4 S+ 0:00 grep sesman

       

      Regards

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Jaakko

    Hey,

    I get similar output when starting xrdp from init.d. Also both xrdp and xrdp-sesman process can be seen with ps. I dont get any errors while running those, neither do I get them in xrdp logs.

    Here is the output:

    sudo /etc/init.d/xrdp start
    * Starting Remote Desktop Protocol server                                      process 2331 started ok
    starting sesman…
    sesman config:
    ListenAddress:            127.0.0.1
    ListenPort:               3350
    EnableUserWindowManager:  1
    UserWindowManager:        startwm.sh
    DefaultWindowManager:     startwm.sh
    AuthFilePath:             disabled
    Xvnc parameters:
    Parameter 00                   -bs
    Parameter 01                   -ac
    Parameter 02                   -nolisten
    Parameter 03                   tcp
    Parameter 04                   -localhost
    Parameter 05                   -dpi
    Parameter 06                   96
    X11rdp parameters:
    Parameter 00                   -bs
    Parameter 01                   -ac
    Parameter 02                   -nolisten
    Parameter 03                   tcp
    logging configuration:
    LogFile:       /var/log/xrdp-sesman.log
    LogLevel:      4
    EnableSyslog:  0
    SyslogLevel:   4
    security configuration:
    AllowRootLogin:       1
    MaxLoginRetry:        4
    No TSUsersGroup defined
    No TSAdminsGroup defined
    session configuration:
    MaxSessions:                 10
    X11DisplayOffset:            10
    KillDisconnected:            0
    IdleTimeLimit:               0
    DisconnectedTimeLimit:       0
    [20120125-09:45:55] [WARN ] [init:45] libscp initialized
    [ OK ]
    ps ax |grep sesman
    2333 pts/0    S      0:00 /usr/sbin/xrdp-sesman
    2404 pts/0    S+     0:00 grep –color=auto sesman
    ps ax|grep xrdp
    2331 pts/0    S      0:00 /usr/sbin/xrdp
    2333 pts/0    S      0:00 /usr/sbin/xrdp-sesman
    2407 pts/0    S+     0:00 grep –color=auto xrdp

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hmm looks normal to me… do you have any sort of firewall on that machine by any chance?

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Jaakko

        Hi,

        I disabled ubuntu firewall to see if it would be blocking it. Also ran a packet trace to our hw firewall and those go trough as well, and if I start xrdp without sesman the connection works. So I think it really is issue with sesman.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • willi

    Hi Kevin,
    Thank you for your precise Howto – it looks very good.

    YUST A SHORT QUESTION.
    How can I override the login of xrdp and to leave authentication to gnome or kde?
    I do really need a login where the user can switch to his native language like gdm alike

    Thank you – willi

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Greets!

      How can I override the login of xrdp and to leave authentication to gnome or kde?
      I do really need a login where the user can switch to his native language like gdm alike

      Heh, y’know that’s a very good question… basically, how to get a gnome or KDE login screen rather than login via the xrdp login screen or authenticate straight from the RDP client?

      I’d love to know that myself :)

      Perhaps if I get the time (currently spending my time learning Java and Android programming and somehow managing to cram in Japanese studies too), I’ll try to figure out a way to do this.

      It might not be possible, due to the way RDP authentication works – basically it’s doing it the same way Windows RDP sessions log in and authenticate.

      It may well be that it’s possible to get a GDM or KDM login screen after authenticating the RDP session, via some clever kludge – I don’t know myself yet to be honest :)

      I promise though I will look into it. Seems that’d make for another nice article in itself. :)

      Regards.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • willi

    thank you for fetching it up.. coudn’t there be a way to skip xrdp authentication completely?
    Ok an auto-remote loging with credentials won’t be possible any more.
    But what if…. there is only one wm  possible, i.e. gnome and xrdp uses it as default.

    What is xrdp doing?
    — listening on 3389 rdp
    — opens a channel on request
    — for security reasons requesting credentials (Ok imagine X11 dies? would xrdp accepting connections anyways?)
    — transfering the credentials to WM for authentication

    Lotta guys say it is not possible to override this…
    Maybe I’m completly on the wrong trail but as i.e. xrdp why should I bother about a user at all?
    all destop environments have a lot of options to cut down remote users privileges…

    sI think this linux remote connection thing have a lot of really wrong points of view…

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Today I had a good long look to see it’s possible to get a gdm-type login screen up and running.

      I did a few experiments, trying to run the various Greeter programs, which are what you see during a gdm or lightdm or kdm or xdm login screen at your console.

      I changed /etc/xrdp/startwm.sh such that it was no longer a symbolic link, instead a script again, which then called unity-greeter – which is the default login greeter for Ubuntu 11.10.

      It was close, but no cigar – these greeters are programmed and run in a way which is not expecting curious people like me from trying to get them running as a login screen via xrdp. ;)

      The closest I got was actually seeing the unity-greeter screen, but without a text entry box for the password! I could select different users, but alas there was no way to enter the password. This is probably due to a variety of reasons, for example, unity-greeter running as my authenticated user rather than as the lightdm user (possibly), and various security tokens and setup variables not being set up.

      To sum up, xrdp is just not written to take trying to run a login greeter (other than the xrdp authentication method) into account.

      You have, however, given me something of an idea to try to achieve what you’re looking for, so,  when I get the time I’ll look into that :)

      For now, though, xrdp as it stands probably won’t do what you want without some serious re-writing.

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • prasad

    Hi

    Quick question: if the X11rdp Server runs iptables, what ports need be opened up? Just 3389 if standard rdp?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi,

      3389 TCP should suffice, although I’d advise keeping that closed and forwarding the port via an ssh tunnel – I’ll shortly be writing an article on how to do that :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Ken

        Your articles have been great and helpful so far, so would love to see an article on SSH tunneling.

        I currently have a HTPC running windows 7, and my NAS running Ubuntu 11.10.  The HTPC is already setup with RDP access, and the NAS is currently being worked on(as per above comments).  My main issue being that I usually control the HTPC with a physical remote, and hence why I’ve set up the user on that machine to have no password, so that when I access it via my remote, I don’t have to enter a password(painful through the remote…).  And because of this, I definitely do not want to expose a RDP accessible machine on the internet with a user with no password.  I’ve just been researching how to secure this, and seems that if I can wrap the RDP session with either SSH tunnelling or VPN tunnelling, I should be safe enough running the RDP without a password as it’ll be going through a secure tunnel.

        Within the LAN, I just set up my RDP machines with no passwords anyway, which I consider safe enough for my LAN, but definitely do not want to expose such unsecured machines to the interwebs without some sort of security!

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • Daro

    Great job! Following your article and everything works perfect.

    If only all the how-to’s were written that way a life of non-expert Linux user would be much easier :)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Jeff Dearmin

    Great information!  Using with wine and and Ubuntu 11.10 XLDE on Amazon AWS, and would like to get file and printer sharing working from Windows clients.  Anyone have experience or suggestions?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Boo Radley

    First of all, let me say, “Great work, Kevin!”  Very thorough and informative.  The only problem I’ve run into is the command

    sudo apt-get build-dep xserver-xorg-core

    On my Linux Mint 11 system I get this:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Picking ‘xorg-server’ as source package instead of ‘xserver-xorg-core’
    E: Unable to find a source package for xorg-server

    I’ve searched for hours for a solution, but have yet to find out why this happens.  I’m guessing it’s the Mint customizations. Nonetheless, I compiled X11rdp without errors.  Connecting from a Windows box works.  But that wasn’t what I was after; I really want this work from an iPad.  I thought I’d post my experiences, and hopefully someone else might post what apps they have tried.  With no mouse on the iPad there is no way to select the xrdp backend server at login.  You have to set the default in xrdp.ini

    I’ve tested four free apps:

    2X Client: If this one worked, it would probably be the most useful due to its virtual mouse.  Unfortunately, it doesn’t even display the login window.

    iRDesktop: With the Xvnc server, you can log in and perform simple functions.  Holding down your finger simulates a right-click. Still, full utility is hampered by an inability to scroll.  In an X11rdp session, you can login, but screen touches are not registered at all. On my Linux box I see segfaults in libglib-2.0 and libGL.so.1.2.

    iRemoteDesktop Free: the free version is less useful than iRDesktop — no left-click emulation.

    Mocha RDP Lite: will not connect.

    Now it’s eeney meeney miney moe, which paid app will I gamble on?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Boo, thanks!

      Y’know, perhaps it’s not needed to perform the build-dep operation after all anyway? I’ll need to check that. Glad that compiled on Mint anyway!

      As for tablet rdp clients, I also get finicky results with various Android RDP clients. I guess writing a decent RDP client for a tablet isn’t all that straightforward.

      Also, thanks, you just gave me another idea for an article ;)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Ken

      I’ll have to test my x11rdp setup with my ipad RDP apps too now that you’ve mentioned it.  I had assumed it’d just work if it follows the RDP protocol, but guess its good to double-check.

      I can “trial” the paid apps(!!!), so I’ll try a few and see how they all play with xrdp.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Bart

    Kevin,

    this setup works like charm. Thank you for this.
    Unix accounts have no problem authenticating. The only issue I have is when I have users that logon using Active Directory credentials. It works fine for them using SSH and GDM, but I get the following error when they connect to the xrdp service: xrdp_m_process_login_response: login failed.

    Active Directory integration is achieved through PBIS Open 6.5.538 – Stable Release (http://www.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/) on Ubuntu 11.10 32-bit.
    Do you have any idea on what I need to configure additionaly?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Bart

    This works like a charm for me. Unix users can connect without problems. However, I can’t get it to work for Active Directory authenticated users. I have deployed PBIS Open (http://www.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-open-edition/) and they authenticate fine using SSH or GDM but when logging on through xrdp, I get the following error: xrdp_m_process_login_response:login failed. Any suggestion how that can be configured? (Ubuntu 11.10 32 bit edition)

    Thanks again for this very well written guide.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Bart, hi

      I’m pretty certain xrdp uses PAM authentication. Just going to have breakfast just now so I’ll check later and get back to you on that :)

      Regards

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Bart,

      There is a file in /etc/pam.d called xrdp-sesman, which has the following contents…

      root@ScaryExample:/etc/pam.d# cat xrdp-sesman
      #%PAM-1.0
      auth required pam_unix.so shadow nullok
      auth required pam_env.so readenv=1
      account required pam_unix.so

       

      You will probably have to change that, to suit your custom authentication method using that Powerbroker Identity Services. There’s possibly something in their documentation on how to change the PAM settings for that.

      Let me know how you get on – good luck :)

      Regards

       

       

       

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Ruediger Meyer

    Speed improvement compiling X11rdp:

    Just let the compiler know, youre having more than 1 CPU:
    Replace every single “make” in buildx.sh with make -j4, where 4 is the number of your cores.

    in vi:

    :%s/make\n/make\ \-j4\r/g

    after this improvement, i compiled x11rdp on a i7 2600k 4×3,4 Ghz in 7 Minutes

    Greetings

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  • Dalon

    I following your guide (GREAT! btw) and setting xrdp up remotely through an ssh session. Unfortunately, my session terminated in the middle of the build of X11rdp. Being fairly new to linux, I wasn’t sure if it kept running or not. I started over and everything seemed to work, but now I can’t connect to it. My question is: How do I clean everything up to start from scratch? Thanks!

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Dalon…

      Unfortunately, my session terminated in the middle of the build of X11rdp

      Ouch. Well, I suggest you make use of the “screen” utility. Basically, apt-get install screen, then run screen by typing in “screen” (heh). After that, start your compilation. If your ssh session drops out again, the compilation will keep going inside that screen session – all you have to do is ssh back in to your target machine, and type “screen -r” to recover the screen session – it’ll be as if you never left.

      If you wish to, you can also detach from the currently running screen session by typing ctrl-a then d. Reattaching is again by using the screen -r command. That way you can be safe in the knowledge that stuff you’re doing over ssh won’t get stopped or lost if the ssh session terminates unexpectedly.

      As to tidying up, I suggest removing everything under /opt/X11rdp, then running the build again from scratch. Should work fine.

      Hope this helps.

      Regards

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Stavros

    Thanks for the great guide. It’s very nice that you’re actually explaining every step.

    When I try to run xrdp

    /etc/init.d/xrdp start

    I get:

    Starting xrdp: running in daemon mode with no access to pid files, quitting
    xrdpstart-stop-daemon: stat /usr/bin/sesman: No such file or directory (No such file or directory)

    Any ideas?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • prasad

      Stavros:

      Check –quote ”

      Finally, edit /etc/init.d/xrdp and add or change the following near the beginning of that init script

      PIDDIR=/var/run

      SESMAN_START=yes

      ” unquote

      Anything in /var/log/xrdp-sesman.log ??

      I have had similar cryptic error “No such file or directory” when  file did not have write permission.

      Kevin, can you advise?

      Regards

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • prasad

    Help required with keyboard map.

    What do I edit get the up arrow key in xrdp sessions terminal   to behave similar to a direct ssh login?

    With direct ssh login , the up arrow will echo the previous command, but via xrp session just prints

    Something to do with keyboard map file : but where?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • prasad

      Ok . Fixed.

      Changed shell to bash for all users.

      Cheers

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Kevin Cave

        Prasad, hi…

        I didn’t ignore your message – but I’m glad you got that sorted out :)

        Regards!

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • Mark

    Thank you so much for such a detailed tutorial perfect for an Ubuntu beginner. It worked perfectly after I tried everything else I could find on the web did not. Just made a small donation – thank you :) :) :)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • whackamus

    Absolutely first-rate tutorial. I can’t tell you how thankful I am for all of the time and effort that went into (a) researching, testing, and writing this, and (b) updating it (based on comments from discussions, as well as your own tinkering) over time.

    This is hand’s down the best GUI-based remote access facility I’ve used for Linux. Thanks, again, for posting this.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • prasad

    Continues to work great, even with some complex dynamic  iptables  access rules  and multiple users.

    I have a question ; how to ensure  my  current session continues to run after exit over rdesktop  so that I can log into the same session again?

    Basically, How do I add  a ‘session disconnect’ option when logging out?The remote m/c runs  LXDE and cannot see a terminate session option. Is this something in sessman?

     

    Cheers

     

     

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      prasad,

      Truth be told I’m a bit puzzled by that question :)

      If you disconnect from the session by closing your RDP client, the session is still running on the target machine anyway. Reconnecting to that session has always been a case of logging in over RDP as usual – as long as your RDP client’s (in your case rdesktop) bit depth and resolution settings are the exact same as when you disconnected, you should automatically be reconnected to the same session you left earlier – this works that way for me :)

      Regards!

      VN:F [1.9.22_1171]
      Rating: +1 (from 1 vote)
      • prasad

        Sorry, should have done some head scratching before posting .. ah well !!!

        I have been watered and fed —Needed by dinner and coffee……..

        OK.  Its nothing to do with X11rdp etc.

        Its the rdp client on the connecting m/c. I had connected in full screen mode, and did not have the ‘disconnect’  X in the window.Only way out was to logout and so kill the current session and all running applications.

        Here is the fix  when connecting full-screen.

        Quote:” When using tsclient, a remote desktop/terminal services/vnc client, if you connect in full screen mode to a server it can be difficult to disconnect or switch to another application because there is no ‘control bar’ at the top.

        To toggle full screen mode, use the key combination Ctrl+Alt+Enter.” Unquote

        Thanks to : http://www.steveneppler.com/blog/2005/12/07/full-screen-and-tsclient.

        The backend for tsclient is rdesktop. Above works great.

        Cheers

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • ozxpat

    Kevin,

    Thanks after a few attempts I finally got your solution to work. All icons now appear of the screen. I can load, run, install end remove programmes via x11rdp, all except one namely Gramps. althought the startup icon is present and active.

    Gramps appears to want to start-up but then dies an ignominious death.

    To my knowledge I repeated all your steps stiptly except for A) Compile xrdp in step 3. You stated this should be done with a normal user however this did not work and I had to compile with root.  Don’t know if that has anything to do with it… authorization maybe??

    Any ideas in which direction I should be looking??

    Thanks

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • ozxpat

    Thanks prasad,

    Yes that’s the program. Had a look at their debug page but now my ignorance is really shinning through. it gives the following message:

    (gramps.py:4317): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,
    Traceback (most recent call last):
    File “/usr/share/gramps/gramps.py”, line 50, in <module>
    import TransUtils
    File “/usr/share/gramps/TransUtils.py”, line 82, in <module>
    os.environ[“LANG”] = lang
    File “/usr/lib/python2.7/os.py”, line 471, in __setitem__
    putenv(key, item)
    TypeError: must be string, not None

    which says nothing to me.  I guess there is no other option than learning Python, C and debugging. :-)

    Oh joy … just what I want after 40 years in mainframes.

    That or going back to Windows again. :-((((

    Thanks again

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • ozxpat

    Just for the record the problem has been resolved. The problem lay in one of the pythons module after replacing the TransUtils.py module everything worked fine.

    As far as I’m concerned its closed.

    Thanks Again

     

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      ozxpat, hi

      Glad that’s all sorted out now :)

      Sorry I haven’t been replying much recently – I’m in the middle of setting up a new VPS to transfer this site to, alongside a whole heap of other Life Related Stuff which is keeping me off the keyboard more than on ;)

      And thanks to Prasad too!

      Regards!

       

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • andy

    hi, thanks Kevin.

    I have installed Ubuntu 11.10 on my office comptuer. I followed your instruction to install x11rdp and now manage to remotely log in my office PC while i am at home.

    The current problem is that when i opened something , for instance, google chrome, while i was working in office. Then i went home and remotely connected to the office computer (by sesman-x11rdp) from my home computer, it will always start a new desktop/session. And if i already opened chrome in my office PC while i was in office, it will always be displayed on the local/office PC desktop instead of my remote/home desktop.

    In short, how to  use exactly the same session i used when i worked in office instead of creating a new session? I want to see the same stuff already opened in my office computer through remote connection.

    Thanks a lot,

    Andy

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      Hi Andy!

      Okay, the reason you’re not seeing the apps which you left running on your desktop, is because they’re being displayed on the X Display session on your machine.

      When you log in remotely via x11rdp, your system creates an entirely new X Display, running under the X11rdp Xorg server.

      There is, however, a sneaky way around this…

      On your office desktop system, run rdesktop (or whatever your RDP client is) and connect to “localhost”. Take a note of the colour depth, and X & Y resolution you used when creating the “local” RDP connection.

      Run your apps and do your work within that session – it’ll be just about as quick as running it on the main desktop, so shouldn’t be too distracting.

      When you’re ready to leave work, don’t log out from the session. If you can, lock the screen on the RDP session as if you would lock the screen on your main desktop if leaving your desk for a while. Then, just disconnect from the RDP session. The X11rdp session and all the apps you started under it will still be running on the machine.

      When you get home or some other remote location, log into to your work machine via RDP in the usual way, remembering to use the same colour depth and X & Y resolution you used when originally creating the RDP session – you should get reconnected to the RDP session you created earlier, and will be able to continue using the still-running apps on that session.

      Note you can test this at your work machine by starting a session, running say Chrome, disconnecting, and then logging back in. The reconnection should work 100% of the time, as long as you use the same colour depth and resolution settings and username :)

      Hope that helps! Please let me know how you got on.

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Daro

    Hi Kevin

    I run into problem I couldn’t solve. I use my national keyboard layout – “pl” and could not get it as a default. I read some stuff but got even more confused where the default setting should be put.

    I run Ubuntu 11.10 x64 with LXDE desktop

    I followed this:

    http://forums.fedoraforum.org/showthread.php?t=265100

    and created /etc/xrdp/km-0415.ini file and moved other km*.ini files to subdirectory

    next created /usr/share/X11/xorg.conf.d/90-custom-kbd.conf with

     

    Section “InputClass”
        Identifier “keyboard defaults”
        MatchIsKeyboard “on”
        Option “XkbModel” “pc105”
        Option “XkbLayout” “pl”
        Option “XKbOptions” “”
    EndSection
    Output of locale shows “pl_PL.UTF-8” at every variable.
    The workaround I found is to issue ‘setxkbmap pl’ twice. First one gives the following output:
    Couldn’t interpret _XKB_RULES_NAMES property
    Use defaults: rules – ‘base’ model – ‘pc105’ layout – ‘us’
    The second one sets the correcr layout.
    I would be gratefull if you could clarify where the default settings are stored.
    Best regards
    Darek
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • After fixing 3 hiccups, it all mostly worked.
    When I log in, I receive a terminal window on the “X11” background.
    If I type: “bash /etc/xrdp/startwm.sh”   only then will the desktop startup.

    Why is the startwm.sh not starting automatically ?

    Here is the sesman.ini   startwm.sh seems to be in all the right places……
    [Globals]
    ListenAddress=127.0.0.1
    ListenPort=3350
    EnableUserWindowManager=1
    UserWindowManager=startwm.sh
    DefaultWindowManager=startwm.sh

    [Security]
    AllowRootLogin=1
    MaxLoginRetry=4
    TerminalServerUsers=tsusers
    TerminalServerAdmins=tsadmins

    [Sessions]
    X11DisplayOffset=10
    MaxSessions=10
    KillDisconnected=0
    IdleTimeLimit=0
    DisconnectedTimeLimit=0

    [Logging]
    LogFile=/var/log/xrdp-sesman.log
    LogLevel=DEBUG
    EnableSyslog=0
    SyslogLevel=DEBUG

    [X11rdp]
    param1=-bs
    param2=-ac
    param3=-nolisten
    param4=tcp

    [Xvnc]
    param1=-bs
    param2=-ac
    param3=-nolisten
    param4=tcp
    param5=-localhost
    param6=-dpi
    param7=96
    ~

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Clicking “Edit” gave me a too skinny ‘window’ to fix edit that I am doing a new reply instead of edit.  I noticed that the ini above had log file ref. In there I found reference to some related errors.

      [20120222-00:18:42] [INFO ] starting xrdp-sessvc – xpid=14881 – wmpid=14880
      [20120222-00:18:42] [CORE ] error starting default wm for user rich – pid 14880
      [20120222-00:18:42] [DEBUG] errno: 13, description: Permission denied
      [20120222-00:18:42] [DEBUG] execlp3 parameter list:
      [20120222-00:18:42] [DEBUG]         argv[0] = /etc/xrdp/startwm.sh
      [20120222-00:18:42] [DEBUG]         argv[1] = startwm.sh
      OK, I ended up changing the /etc/X11/Xsession to 777.

      Is there a better answer than that ?

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Trying again, didn’t seem to take the reply the first time.

    Clicking “Edit” gave me a too skinny ‘window’ to fix edit that I am doing a new reply instead of edit.  I noticed that the ini above had log file ref. In there I found reference to some related errors.

    [20120222-00:18:42] [INFO ] starting xrdp-sessvc – xpid=14881 – wmpid=14880
    [20120222-00:18:42] [CORE ] error starting default wm for user rich – pid 14880
    [20120222-00:18:42] [DEBUG] errno: 13, description: Permission denied
    [20120222-00:18:42] [DEBUG] execlp3 parameter list:
    [20120222-00:18:42] [DEBUG]         argv[0] = /etc/xrdp/startwm.sh
    [20120222-00:18:42] [DEBUG]         argv[1] = startwm.sh
    OK, I ended up changing the /etc/X11/Xsession to 777.

    Is there a better answer than that ?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Kevin Cave

      InHisName, hi…

      /etc/X11/Xsession is 755 on the system(s) I have performed this procedure on, and it works fine, so, I’m not understanding why this is happening to you.

      I’m busy tweaking PHP on the VPS (just moved this blog over to a new VPS) so that’s probably why you’re getting odd-sized edit windows – trying to fix that now.

      Presumably you followed the tutorial to the letter and didn’t modify the procedure in some way?

      Best regards!

      VN:F [1.9.22_1171]
      Rating: +1 (from 1 vote)
      • Kevin Cave

        Hrm it seems the comment plugin I was using doesn’t like its new home… I’ve disabled it for now and will look for a better plugin.

        Rats!

        VN:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
      • I found it original with 644, will try 755 to see if that is good enough. I had tried 666 but that was not good enough, and went straight to 777 just to check. It worked with that, now to back it down a bit.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • 755 works fine for me also. I’ll leave it that way. I’m not sure why it started out as 644.
          Even more puzzling, I could still manually type bash /etc/X11/startwm.sh and it would start fine. Even when Xsession was at 644.

          VA:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
  • JAV

    Hello, Kevin Can I get some help please? I have been going through the steps on two separate computers running ubuntu 10.04 (Lucid). I have come to note that this :

    cd /etc/xrdp
    mv startwm.sh startwm.sh.BACKUP
    ln -s /etc/X11/Xsession /etc/xrdp/startwm.sh
    PIDDIR=/var/run
    SESMAN_START=yes

    gets me into a shell prompt matter what I pick on the log in window. And this :

    sudo su –
    mkdir /usr/share/doc/xrdp
    mv /etc/xrdp/rsakeys.ini /usr/share/doc/xrdp/
    chmod 600 /usr/share/doc/xrdp/rsakeys.ini
    chown xrdp:xrdp /usr/share/doc/xrdp/rsakeys.ini

    simply just dosent even allow for the log in window to show up. (have to over all previous stems and avoid doing this to get to the log in). Can you shade some advice Kevin. Also, I cant start the xrpd with the usual sudo /etc/init.d/xrdp restart/start. It just jumps to next prompt.

    root@orion:/etc/xrdp# /etc/init.d/xrdp start
    root@orion:/etc/xrdp#

    I have to manually start the processes. Please help…

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Hi Jav…

      I have been going through the steps on two separate computers running ubuntu 10.04 (Lucid).

      Yes, I can see where this won’t work. I did in fact state at the beginning of the article;
      I’m assuming you’re running Ubuntu 11.10

      :)

      BUT.. I have in fact managed to get this working on 10.04 LTS recently. I can’t remember offhand what I did, and it’s 1945hrs here in Japan as I write this and I’m tired tonight and it’s also time to give my son a bath, so, give me a day or two and let me see IF I can come up with something for you. I’ve been rather busy of late with pesky Normal Life Stuff, moving to a VPS, and juggling numerous other balls all at once.

      Please bear with me :)

      Best regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • JAV

        Hello Kevin,
        Thanks for your prompt response. I understand, I wish you the best. I am not lunix “savvy”, but I am determined. I will flirt with it. Any future advise will be highly appreciated.

        Very kind regards…

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  • hurky

    Hi and thanks for this guide… I’m setting up and RDP in a Ubuntu Server 10.10 i686, have followed every step in your guide but at the time of logging in with user and password in my X11rdp session, I get in the screen “connected ok” and then the session closes and I get back to the remote desktop window (mstsc.exe)

    Here are my logs:

    /var/log/xrdp-sesman.log
    [20120301-12:00:28] [INFO ] scp thread on sck 7 started successfully
    [20120301-12:00:28] [INFO ] ++ created session (access granted): username hurky, ip 1.1.1.1:51950 – socket: 7
    [20120301-12:00:28] [INFO ] starting X11rdp session…
    [20120301-12:00:28] [INFO ] starting xrdp-sessvc – xpid=18018 – wmpid=18017
    [20120301-12:00:29] [INFO ] ++ terminated session: username hurky, display :13.0, session_pid 18016, ip 1.1.1.1:51950 – socket: 7

    /var/log/auth.log:
    Mar 1 12:00:28 xrdp-sesman: pam_unix(xrdp-sesman:session): session opened for user hurky by (uid=0)
    Mar 1 12:00:28 xrdp-sesman: pam_ck_connector(xrdp-sesman:session): nox11 mode, ignoring PAM_TTY :13
    Mar 1 12:00:38 sudo: hurky : TTY=pts/0 ; PWD=/home/hurky/.vnc ; USER=root ; COMMAND=/bin/su
    Mar 1 12:00:38 su[18077]: Successful su for root by root
    Mar 1 12:00:38 su[18077]: + /dev/pts/0 root:root
    Mar 1 12:00:38 su[18077]: pam_unix(su:session): session opened for user root by hurky(uid=0)

    I suppose I need some additional vnc package or configuration, as beforce changing ownership of /home/hurky/.vnc I got these error logs:

    can’t read vnc password file – /home/hurky/.vnc/sesman_vozdata_passwd

    Thanks !

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Haris

    Hi Kevin;

    Thank you for this manual.
    What I can tell you, it is working also on 12.04TLS Beta1.
    Also, I found on http://forums.fedoraforum.org/showthread.php?t=251769 solution for my little problem: starting RDP session, will start Gnome session in English, not in any other language.
    So, I put next few lines from the link above into startwm.sh:

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

    Regards, Haris

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  • Penn

    It worked great the first time around on 11.10 but now with the BETA 12.04 Ubuntu I am getting x11rdp Error 1
    error make x11rdp
    It cant find a whole bunch of directories probably because I am missing all that stuff :-/

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Penn, hi…

      I did actually get it running on 12.04 beta… but I’m waiting for it to be officially released before making an update – things may change between the beta and final release. :)

      Regards

      Kevin.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Ngaiso

    Hi Guys

    Thanks for the comprehensive tutorial. Mine is working like a charm from a Mac Book, the only problem that i have is that when I try to connect to the X11rdp using the RDP Client for MAC, it crashes. I think its because that client does not support High color 16bit. As alternative I can connect to the server via CoRD or from the Windows Client in VMware

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • LeifK

    when trying to connect using mint11 as the server I get this message.
    [20120315-19:12:57] [ERROR] X server — no display in range is available
    This is in the /var/log/xrdp-sesman.log

    Any ideas

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Protvis

    Hi Kevin, thanks very much for the tutorial, it helped me a lot all ready.
    I still have one issue that I can’t figure out yet. First let me tell you what I’m trying to do:
    I configured an ubuntu 11.10 virtual machine on kvm on a server, to login into the ubuntu, you can use the local user account or you can use users which authenticate to an active directory running on a windows 2008 server (please don’t ask me why I want to do this ;) ).
    Now this is working fine, the next step is using a remote desktop from a windows computer to login to the ubuntu vm.

    Your tutorial works fine for the local user, but can’t login with the active directory users. I’m fairly new to computers, and only just started working in linux, so I was hoping it was kind of a stupid thing I forgot (or don’t know about), any idea’s or hints on this one? (I know it’s not that much related with your manual, but no hurt in asking, right ? :) ).

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Kyle

    Hi – where is the donate button? and can I ‘copy’ the x11rdp binary’ to another PC or should I pick up the entire /opt/X11rdp directory and move that as well and then do the linking?

    Otherwise very useful –

    and I like Unity – sorry for that…

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Hi Kyle

      The Donate button is located at the top right of the page.

      As for the x11rdp binary, yes, it is possible to copy it over to the same location as the original – as long as the target system is the same architecture as the system it was compiled on (e.g. Intel/AMD cpu).

      You might have to do a few test runs after that to see where things are breaking – as the x11rdp binary – which is really an X server itself – will be expecting fonts to be in the same place as the system it was compiled on, for example, so you’ll have to experiment with symbolic links to the existing fonts directory on your target system.

      No harm in experimenting and learning from the experience – oh and do let me know how you get on :)

      Fair enough that you like Unity – no need to apologise ;)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Kyle

        Hi Kevin – thanks for the response. I just moved the whole /opt/X11rdp folder – its was interesting as the target was a 10.04.4 Server and I had to recompile both the xrdp and X11rdp from source as per your notes. The 11.10 and 12.04 desktops we fine with the version of xrdp from the repos.

        It is very fast – however I have come across a quirk that may be of interest. On the 10.04 Servers I have KVM hosting a Windows 2008 server and another Ubuntu 10.04 Server instance. The interesting thing is that the xrdp display has what I can only describe as “desktop bleed” from the Windows Server desktop – even though its not logged in and not even visible on the desktop. (I have installed Gnome Desktop on my two Ubuntu Servers).

        The resulting display is quite messy with bits and pieces from the various OS’s hosted on the actual server.

        I can email you some images if you wish, let mw know…

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Kyle, hi

          Hrm interesting… can you email me at “kevin@”+the domain name of this site?

          I’ll see if I can replicate that.

          Regards!

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
          • Kyle

            Hi Kevin – any luck with testing Windows KVM clients ?

            VA:F [1.9.22_1171]
            Rating: 0 (from 0 votes)
            • Hi Kyle – not at the moment. I’ve been extremely busy and haven’t been able to even so much as make a new blog entry in the last few weeks due to other priorities.

              It’s not easy being a husband and father AND a nerd at the same time ;) I’m in the middle of doing a project for my wife as well.

              I’ll try to get on that this evening though.

              Did you email me with examples of what you’re seeing, btw?

              Regards

              VN:F [1.9.22_1171]
              Rating: 0 (from 0 votes)
              • Kyle

                Hi Kevin – no worries – yes I did send some screen shots – I can resend if you need me to…

                Just to summaries:

                Host was Ubuntu Server 10.04.4 with KVM – running a Windows 2008 Enterprise Server.

                VA:F [1.9.22_1171]
                Rating: 0 (from 0 votes)
  • Herman

    Hi,

    I followed your tutorial but it isn’t working.

    When I try to connect I get a messagebox,

    connecting to sesman ip 127.0.0.1 port 3350
    sesman connect ok
    sending login info to session manager, please wait…
    xrdp_mm_process_login_response: login successful for displa
    started connecting
    connecting…
    connect error
    connecting…
    connect error
    connecting…
    connect error
    connecting…
    connect error
    connection problem, giving up
    some problem

    with an OK button that restarts this dialog.

    Any suggestions?

    Tx,

    Herman

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Herman, hi

      Seems there was a commit to the xrdp git repository which introduces this behaviour.

      Thanks to reader Daniel for the solution – I updated the article at the xrdp compile step with his information.

      Please let me know how that works.. currently verifying your problem and the solution so I’ll update when complete.

      Regards

      Kevin.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Herman, hi!

      Yes I could replicate this error.

      Reader Daniel spotted that one too and I have incorporated his findings into the article – caused by a recent change to xrdp in the git source repository.

      It’s just an extra step after git clone.

      You can probably get away with doing the following in the xrdp.git directory to sort this out;

      1) sudo make uninstall
      2) make distclean
      3) git checkout 4cd0c118c273730043cc77b749537dedc7051571

      Then proceed with the rest of the xrdp compilation/installation as before. Today I altered the article to add that extra checkout step, so have a look at that part to see how it fits in with the tutorial.

      Hope this works out for you! Please let me know how you got on.

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Daniel

    I’ve tried the xrdp version from git (16 Mar 2012 commit b1246126750f0a8e8c502611f82d503555d0bf94)
    git clone https://github.com/FreeRDP/xrdp.git xrdp.git
    but it doesn’t work well with x11rdp (but it does complie)

    I figured out that the commit from 18 Nov 2011 works well with x11rdp (so you can apply this article howto to it). Just clone the repo as above and then:
    cd xrdp.git
    git checkout 4cd0c118c273730043cc77b749537dedc7051571
    (compile as discribed in the article)

    Cheers

    VA:F [1.9.22_1171]
    Rating: +2 (from 2 votes)
    • Daniel you’re a star!

      Will update the article ASAP. Can’t have the thing not working for folks (as you can see, a couple have already gotten bitten by this!)

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Jim Hutson

    thanks for your excellent guide, but I still can’t connect via rdp. When I connect from the client, i get “login successful for display…” followed by “started connecting”, “connecting…\n connect error\n” four times before it says “giving up”. In my xrdp-sesman.log i have:

    [20120321-15:21:29] [INFO ] scp thread on sck 7 started successfully
    [20120321-15:21:30] [INFO ] ++ created session (access granted): username jhutson, ip 172.18.11.5:51193 – socket: 7
    [20120321-15:21:30] [INFO ] starting X11rdp session…
    [20120321-15:21:39] [ERROR] X server for display 10 startup timeout
    [20120321-15:21:39] [INFO ] starting xrdp-sessvc – xpid=2869 – wmpid=2868
    [20120321-15:21:40] [ERROR] X server for display 10 startup timeout
    [20120321-15:21:40] [ERROR] another Xserver is already active on display 10
    [20120321-15:21:40] [DEBUG] aborting connection…
    [20120321-15:21:40] [INFO ] ++ terminated session: username jhutson, display :10.0, session_pid 2866, ip 172.18.11.5:51193 – socket: 7

    I can also run sudo X11rdp :10 from the server (but do see error opening SecurityPolicy and a few font path errors). Any help would be greatly appreciated.

    thanks,
    ji

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Jim, hi…

      The error is caused by a recent change to the xrdp source code in the git repository.

      If you read this comment, following the instructions should sort it out for you.

      Regards!

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Matthias J.

    I have another problem while connecting .. connection window suddenly shuts down.

    wheater i use rdesktop in ubuntu or win 7 rdp, log just says
    connection succesful and afterwards it’s terminated

    maybe i did something wrong at one step? .. i will try it again later

    ps: i’m new to ubuntu :)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Yeah, sometimes I get that behaviour too – during the initial connection phase after logging in, the window suddenly closes.

      Usually though if you immediately reconnect with the same login/resolution details, you get reconnected to the session again which was started when you initially logged in.

      I don’t know why this happens – perhaps there’s some kind of race condition between the RDP clients and the session manager.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Matthias J.

        Hey Kevin,
        There is still the same problem.
        BUT… if i connect with original admin account (first account i created in ubuntu) then everything works fine. If i connect with my account which i added later and gave admininstrator rights it doesn't work. Maybe there are some problems concerning the rights of the manually added user?
        So the problem is still:  Connecting ,,,, Connection ok -> Window shuts down.
        I also tried setting some rights in file system you mentioned in another comment:
        http://scarygliders.net/2011/11/17/x11rdp-ubuntu-11-10-gnome-3-xrdp-customization-new-hotness/comment-page-1/#comment-1086
        If i do so the windows doesn't shut down, but it stays grey.. i don't see anything.
         
        Do you have any ideas?

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Matthias, hi again…
          I'm in the middle of writing a new article – which is turning into a bit of an epic. After I've finished and published it (well, Part 1 of a series on the subject), I'll try and replicate the behaviour you're experiencing.
          It sounds like I'd need to create a new user on a system with xrdp on it and try to login as that user.
          I'll let you know how I got on, so please bear with me for now.
          Regards!

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
          • Matthias J.

            Thank for your help! You do a great job :) I'll wait for it.
            Regards
             
            PS: what i exactly did is:
            1. new ubuntu system
            2. First login with new admin account
            3. created new user and gave him admininstrator permissions
            4. and finally i did all the steps you mentioned in your article ..
            -> and now i'm in this situation which i explained above

            VA:F [1.9.22_1171]
            Rating: 0 (from 0 votes)
            • Matthias

              Which version of Ubuntu?

              VN:F [1.9.22_1171]
              Rating: 0 (from 0 votes)
              • Matthias J.

                it's 11.10

                VA:F [1.9.22_1171]
                Rating: 0 (from 0 votes)
                • Okay, setting up 11.10 Desktop in a VM to see if I can replicate.

                  VN:F [1.9.22_1171]
                  Rating: 0 (from 0 votes)
                  • Matthias J.

                    maybe some more information.. after logging in the first time i made a full update of the system .. then new account .. and proceeded the steps above from the new account with administrator rights ..  i try to describe as exactly as i can.
                    regards

                    VA:F [1.9.22_1171]
                    Rating: 0 (from 0 votes)
                    • Let's see if I've gotten this right then;

                      You have:

                      • Fresh ubuntu 11.10 installation.
                      • Installed updates
                      • Added a new user

                      Then I'm not so clear… did you

                      A) Add a new user who has Administrator rights, then followed the X11rdp article

                      OR

                      B) Add a new user, then followed the X11rdp article as superuser?

                       

                      Regards

                      VN:F [1.9.22_1171]
                      Rating: 0 (from 0 votes)
                  • Matthias J.

                    a) first a new User, gave administrator rights and then followed this article with the new user

                    VA:F [1.9.22_1171]
                    Rating: 0 (from 0 votes)
                    • Okay I'll do it that way.

                      I've already set up a fresh install of Ubuntu 11.10 (with all current updates, and installed gnome-shell).

                      I shall add a new user with admin rights and go through the steps in the article. Though to be honest, I don't see how that can make any difference to the end result :)

                      I'll post a reply again when complete.

                      Regards

                      EDIT: Okay, I set up a new user "joeblow" as an administrator, via the gnome Users application, then performed each step in the article. xrdp/x11rdp works flawlessly, so, to be honest I think you've made some kind of error when following the article. I suggest starting from a clean slate and trying the procedure again – it's working for lots of readers and hasn't failed on me yet.

                      Regards, Kevin.

                      VN:F [1.9.22_1171]
                      Rating: 0 (from 0 votes)
                    • Matthias J.

                      Hmm, strange :)
                       
                      So X11RDP works with both accounts, the first account (which is administrator by default?) and also X11RDP for the new account? ..
                      Hmm, okay, I'll try it again somewhen next days. I'll let you know the result.
                       
                      Thanks for your help sp far!
                      Regards

                      PS: Let me know some useful information (if exist) where i can find some more logs (and so on) for trouble shooting :)

                      VA:F [1.9.22_1171]
                      Rating: 0 (from 0 votes)

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

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