XRDP – Small bug in Ubuntu 16.04.3 breaks custom XRDP install – Missing fontutil.h file

Hello World,  

Recently, a lot of our readers have encountered issues when performing the custom installation of xRDP on Ubuntu 16.04.3 version as described here.  In this post, a script to automate the custom installation process (version 1.9) was provided and used to work on Ubuntu 16.04.2 release….until now.  After some digging and after receiving some feedback from some of our followers (thank you Brian ! ), it appears that something has changed in the Ubuntu 16.04.3 that has broken the xrdp custom installation process.  There is a small bug that prevent the script to complete the installation.  In this short post, we will quickly explain the problem and try to provide some solutions and workarounds. 

As we have been travelling abroad and as we have been working on a lot of different projects, we didn’t got time to have a close look into this issue.  We have been really surprised and pleased to see that some readers have reacted and provided positive feedback and useful info about this issue.  We would like to thanks the people that have reported either issues, people that have been testing the install process that helped identify the issue and people who have filed a bug to Ubuntu so a fix could have been provided… Thank to all of you 🙂

Problem Description 

In our previous posts, we have described the process to perform a custom installation of xRDP based on the information made available by the team behind xRDP software.  In order to automate the installation, we have been providing for some time now, a nice little script that perform the installation for you.  The latest version of the script is set to 1.9 (install-xrdp-1.9.sh). However, people trying to run the script on Ubuntu 16.04.3 release will find out that the installation did not proceed as expected and that the xRDP solution does not work for them.   

Indeed,  if you leave your system unattended during the installation, your system will reboot and you would assume that the installation has been completed and successfully performed. When you connect through your remote desktop client to your Ubuntu 16.04.3 machine, you will see the xRDP login prompt. After putting your credentials and pressing the OK button, you will be only presented a green desktop and you will never see your Unity Desktop interface. 

error_fontutli_custom_1

Click on Picture for Better Resolution 

You will be either disconnected after some time or you might see the following error dialog box…. 

error_fontutli_custom_1b

Click on Picture for Better Resolution 

When you run the install script we have provided, if you monitor the installation, when the xorgxrdp package is in the process of being compiled, a fatal error occur which terminate the compilation process and the xorgxrdp component is basically not installed.  The error is the following 

fatal error : X11/fonts/fontutil.h No such file or directory
compilation terminated 

error_fontutil_custom_install

Click on Picture for Better Resolution 

 

Because the installation process cannot find this file, the installation has not proceeded successfully and  this is why you see this green desktop in front of you and you cannot access the remote session using the xorg option with xRDP software…  

 

Solution & Workarounds 

Obviously, this small bug has detected by multiple person and we have been notified that a fix was available.  Actually, you can fix the “compilation” problem in two different ways.  

Make fontutil.h file available 

Because the compilation process is complaining about a missing file, to overcome the situation, you could simply manually create the file or obtain a copy of the file and place it in the correct directory on your system. 

If you want to manually create the file, perform the following actions. 

From a terminal, issue the following command

sudo nano /usr/include/X11/fonts/fontutil.h 

error_fontutil_custom_install_2

Click on Picture for Better Resolution 

Then, open the file (using sudo) and copy the following text inside the file and save it 

#ifndef _FONTUTIL_H_
#define _FONTUTIL_H_

#include <X11/fonts/FSproto.h>

extern int FontCouldBeTerminal(FontInfoPtr);
extern int CheckFSFormat(fsBitmapFormat, fsBitmapFormatMask, int *, int *,
			 int *, int *, int *);
extern void FontComputeInfoAccelerators(FontInfoPtr);

extern void GetGlyphs ( FontPtr font, unsigned long count,
			unsigned char *chars, FontEncoding fontEncoding,
			unsigned long *glyphcount, CharInfoPtr *glyphs );
extern void QueryGlyphExtents ( FontPtr pFont, CharInfoPtr *charinfo,
				unsigned long count, ExtentInfoRec *info );
extern Bool QueryTextExtents ( FontPtr pFont, unsigned long count,
			       unsigned char *chars, ExtentInfoRec *info );
extern Bool ParseGlyphCachingMode ( char *str );
extern void InitGlyphCaching ( void );
extern void SetGlyphCachingMode ( int newmode );
extern int add_range ( fsRange *newrange, int *nranges, fsRange **range,
		       Bool charset_subset );

#endif /* _FONTUTIL_H_ */

error_fontutil_custom_install_3

Click on Picture for Better Resolution 

When the file is place in the /usr/include/X11/fonts directory and properly populated, you can run the custom installation script and you should see that the compilation process simply go through (see screenshot no more fatal error message) 

error_fontutil_custom_install_4

Click on Picture for Better Resolution

Enabling Ubuntu proposed repository 

The other option would consist of enabling on your Ubuntu system, the proposed repository option. Since some users have reported the issue to xRDP and Ubuntu team, see the following links 

a quick fix package has been made available but it’s not available by default.    To be able to compile xrdp, you will need to enable Developer Options Ubuntu package download.   

You can enable this option via the GUI or via the command line.  So, let’s first see how to perform this action through the GUI 

Enable Pre-Release Updates via GUI

To do this, perform the following actions 

  • click on the Dash and search for software Updates. In the result page, click on the icon Software   & Updates icon 

    U16.04.3_0

    Click on Picture for Better Resolution

  • The Software and Updates dialog box is displayed 

U16.04.3_1

Click on Picture for Better Resolution

  • Click on the Developer Option tab and tick the checkbox next to the Enable Pre-release Updates. You might be prompted for a password in order to enable this feature

U16.04.3_2

Click on Picture for Better Resolution

U16.04.3_3

Click on Picture for Better Resolution

  • Press close button and you will be informed that info about software is out-to-date.  Press the reload button and wait for the process to complete. 

U16.04.3_4

Click on Picture for Better Resolution

U16.04.3_5

Click on Picture for Better Resolution

 

Enable Pre-Release Updates via command line 

If you prefer to perform the same actions via a command line, you simply need to issue the following commands in a terminal console 

sudo add-apt-repository “deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe”

sudo apt-get update

U16.04.3_6

Click on Picture for Better Resolution

You should be then ready to proceed with your custom installation either using the custom installation script or perform your manual compilation process 

Final Notes

This is for this post !  As you can see, changes in Ubuntu can break your xRDP installation.  The small bug detected recently has shown that a simple missing file can break the compilation process. The custom installation script remains valid as long as you perform the correct actions to either create your fontutil.h file or if you enable the proposed repository.  We wanted to describe both options as in some environment, deploying developer options packages might not be a good idea.  

Now, while investigating and documenting this issue, we have discovered some additional issues with Ubuntu 16.04.3 and xRDP. We will address these other issues in separate posts and we will probably updated the custom install script as well to ensure that you can perform the installation in an automated way 

Stay Tuned 

Till next time 

See ya

 

 

 

10 thoughts on “XRDP – Small bug in Ubuntu 16.04.3 breaks custom XRDP install – Missing fontutil.h file

  1. @Brendan,

    Thank you for sharing the info with us and for your visit.. We will try to take this into account in our next posts about xrdp
    Till next time
    see ya

  2. Thanks for the instructions. Tried it out today. The workaround seems not to be needed any more.
    fontutils.h is there. Still I get a black screen and an error message after a while

  3. @Griffon,
    many thanks for providing this support to get xrdp running on Ubuntu!

    I went through the articles (fontutil.h was already fixed, allowed_users changed to anybody).
    But I still got a “black” screen (not a green one, but a real black one).
    The only thing I configured on my Ubuntu machine “abnormaly” was to use the proprietary nvidia graphics driver. After changing back to the open source drivers I was able to connect via xrdp ….
    But actually the open source drivers are not an valid option for me to run my physical machine.
    Any idea how to get xrdp running with the proprietary nvidia graphics driver?

  4. @Markus,

    we are aware of the fact that NVIDIA drivers have issues with XRDP.. Some people found some workaround in the past…At this stage, as we are not working with NVIDIA Graphic cards, we never had the issue and we never really further investigate….. IF time permit, we might want to have a look into this additional xrdp challenge…but might take some times….

    Till next time
    See ya

  5. Hello Griffon,

    First of all I would really like to thank you. I learned a lot from all your blogs. with that information I know were to look now.
    second, if I comment on the wrong post I’m sorry, I’ve read them all from you on this topic maybe you could move it then.
    Currently the desktop I am using was on Unbuntu 16.04.04 And I couldn’t get it working in the beginning. But now it seems I found a solution. This is what I did.

    installed another repo;
    sudo add-apt-repository ppa:hermlnx/xrdp
    sudo apt-get update
    sudo apt-get install xrdp

    source (installs the 9.3 version I think now):
    https://netdevops.me/2017/installing-xrdp-0.9.1-on-ubuntu-16.04-xenial/
    https://launchpad.net/~hermlnx/+archive/ubuntu/xrdp

    After that I was able to log in but you can only open a terminal. So after that I installed the MATE desktop as you described from your blog:

    sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon

    And then added with sed the two lines as described in you blog:

    sudo sed -i.bak ‘/fi/a #xrdp multiple users configuration \n mate-session \n’ /etc/xrdp/startwm.sh

    And then rebooted.

    And what do you know. It works…. at least for me.
    I hope I can help somebody else with this info

  6. @Wouter

    Thank you for sharing the information…There are multiple way to compile or generate deb files and we think that they are all valid. We have preferred a scripted approach because of the flexibility of the solution which can be adapted easily. By the way, we have also written a post on how to generate a deb file from the compilation (check http://c-nergy.be/blog/?p=11480)

    Thank you for the visit and posivite feedback
    Till next time
    see ya

  7. Hello, thank you for all your work and information.
    Had a problem to get rdp working on a rented VPS with the Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-124-generic x86_64), LXDE, and thought to share what helped me. Connecting failed with this info in /var/log/xrdp-sesman.log:

    [20180510-15:59:06] [INFO ] starting Xvnc session…
    [20180510-15:59:06] [CORE ] error starting X server – user XXXXXXX – pid 1591
    [20180510-15:59:06] [DEBUG] errno: 2, description: No such file or directory
    [20180510-15:59:06] [DEBUG] execve parameter list: 16
    [20180510-15:59:06] [DEBUG] argv[0] = Xvnc

    [20180510-15:59:06] [DEBUG] argv[15] = (null)
    [20180510-15:59:16] [ERROR] X server for display 10 startup timeout
    [20180510-15:59:16] [INFO ] starting xrdp-sessvc – xpid=1591 – wmpid=1590
    [20180510-15:59:16] [ERROR] X server for display 10 startup timeout
    [20180510-15:59:16] [ERROR] another Xserver is already active on display 10
    [20180510-15:59:16] [DEBUG] aborting connection…

    Found this post with a description (no fonts available in /usr/share/fonts/X11) and solution (install the fonts):
    http://jim-st.blogspot.nl/2017/08/xrdp-failure-log-message-connecting-to.html

    After doing ‘sudo apt-get install xfonts-base’ it worked.

  8. @Peter,
    Thank you for sharing this great info. indeed, some people encountered the situation and we never looked/found a solution for them… Great Tip
    Thank for the feedback and for visiting our blog….
    Till next time
    See ya

Leave a Reply