Initially, when I try to log in to my ubuntu machine (version 12.10) using RDP, I would get an ubuntu desktop background, with no text, menu bars, or anything to indicate it loaded the desktop.

I went through the following instructions that claimed to fix that issue:

Edit the .Xsession file to add the following line:

gnome-session –session=ubuntu-2d

but it caused the following error:

Failed to load session "ubuntu-2d

and it only allows me to log out.

So now, my question is:

How to I log in to my Ubuntu Desktop using XRDP in a foolproof fashion. I can successfully SSH in to the command line, so do I need to install another window manager? Do I need to reset some settings?


1 Answer 1


As of Ubuntu 12.10, the Unity 2D desktop interface ("Ubuntu 2D") no longer exists. Ordinarily, computers without adequate 3D acceleration use the llvmpipe software renderer.

Since Unity 2D used to be the easy way to xRDP into an Ubuntu system, its removal requires the use of a different technique. Fortunately, there is a solution:

Install xRDP

That page provides a circuitous way to install xRDP, but really it's as simple as before. Install xrdp Install xrdp in the Software Center. Or install from the Terminal by running:

sudo apt-get update && sudo apt-get upgrade

If it is not found, make sure the Universe repository component is enabled in your Software Sources. (If this is a headless system, use this command-line way instead.)

Install a Desktop Interface Not Requiring (Real or Simulated) 3D Acceleration

Grifon's instructions recommend GNOME Fallback (providing the "GNOME Classic" session type). The gnome-session-fallback Install gnome-session-fallback package provides it.

sudo apt-get install gnome-session-fallback

(It's best to run sudo apt-get update first if you haven't done so recently.)

Other alternatives include:

Create a ~/.xsession File Specifying the Desired Interface for xRDP

In the home directory of the user or users who you wish to log in via xRDP, create a file called .xsession. You can do this with any text editor, such as Gedit. Once created, this file won't be visible in file managers except when View > Show Hidden Files (or similar) is enabled. In Nautilus and most other file managers, Ctrl+H does this.

The quickest and easiest way to make this file is probably the Terminal--a single command will create it.

To use GNOME Fallback ("GNOME Classic (no effects)"):

echo gnome-session --session=gnome-fallback > ~/.xsession

Or, to use Xfce ("Xubuntu Session"):

echo xfce4-session > ~/.xsession

Or, to use LXDE ("Lubuntu Desktop"):

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

Configure the Keyboard Layout

If you want an English keyboard layout, you don't need to do anything for this step.

Otherwise, to configure xRDP to use a different keyboard layout, see the "Solving the keyboard Layouts problem in the xRDP session" section of this post (the rest of that post applies just to earlier versions of Ubuntu; the post was linked to from those instructions for 12.10).

Now it should work!

Griffon has pointed out that, unfortunately, in GNOME Fallback, the usual way of logging out does not work (when connected via xRDP). Instead, log out by running the command:

gnome-session-quit --logout

You can open a Terminal window (Ctrl+Alt+T) for this, but you might as well just use the Run dialog (Alt+F2).

In other desktop environments, logging out might still work, but if it does not, you can use their approximate equivalents of the gnome-sesison-quit command:

Xfce: xfce4-session-logout --logout

LXDE: lxsession-logout


Much of the information here is from that blog post (though no text is copied).

  • I think installing a whole new desktop environment with all the software packages is overkill. I followed the steps, but just installed openbox. Then I put '/usr/bin/openbox-session' in my .xsession and my uncle was Robert. Aug 18, 2013 at 22:20
  • I used the echo lxsession -s Lubuntu -e LXDE > ~/.xsession method via SSH and I'm still just getting a black screen when I login with Remote Desktop for Mac. Any tips on what could be causing the black screen? Mar 7, 2014 at 14:15
  • FYI I'm getting a blank screen as well with gnome-fallback :( Apr 24, 2015 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .