12.10 - I get "Failed to load session "ubuntu-2d" when using XRDP

23
2014-04
  • George Stocker

    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?

  • Answers
  • Eliah Kagan

    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

    Acknowledgements

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


  • Related Question

    compiz - Failed to load session "ubuntu"
  • harsh

    I installed CCSM to enable window previews in Unity. But when I went into extras, there was no 'window preview' option.

    So I tried experimenting with other options in Compiz and now there are no borders in the dialogue boxes (close, minimize, restore buttons are not there, I had enabled some 'flat....' option in Compiz.

    Later, I uninstalled Compiz and then reinstalled it. Now it says

    "Failed to load session Ubuntu"

    I can't even access through the guest account, I am new to Ubuntu.(please explain in detail).

    All I have access to is the login screen (it still shows my custom wallpaper). Please help, I don't want to lose my stuff.


  • Related Answers
  • s.m

    Open virtual console : Ctrl+Alt+F1

    sudo apt-get update

    sudo apt-get install ubuntu-desktop

    sudo apt-get install -f install

    sudo dpkg-reconfigure ubuntu-desktop

    sudo reboot

    Then try to login, This will bring back your desktop

  • Linh Lino

    I got the same problem ""Failed to load session Ubuntu"" when I was trying to login afer uninstall Compiz.

    I tried to boot from USB with Live Ubuntu inside and others ways but it doensnt work.

    At the end, it comes up with a simple solution.

    1. Boot your Ubuntu as normal
    2. When you see the log-in screen, try to Ctrl - Alt - F1
    3. In my case (ubuntu 12.10), a blank screen appears. dont be panic, try Ctrl - Alt - F2
    4. A login console shows up and ask you to login using your id and password.
    5. After login. Run these commands. (tested)

    sudo apt-get update
    sudo apt-get install unity-2d
    sudo apt-get install ubuntu-desktop
    sudo apt-get install compizconfig-settings-manager
    sudo apt-get install compiz-plugins-extra
    sudo apt-get update

    I got this above list of commands from How can I remove and re-install Unity? but some doesnt work so I mentioned only good-running command in my case. I highly recommend to restart your system before try to login again.

    sudo shutdown -r now

    Hope it helps you to solve your problem.

    Linh

  • TomKat

    Try booting into the LiveDVD and install Compiz. It's possible that you disable Unity. Update Unity.

    Add the following PPA to your Software Sources per these instructions: ppa:unity-team/staging sudo add-apt-repository ppa:unity-team/staging

    After adding, open the 'Software Updater', click ‘Check for Updates’, and proceed to install those you’re prompted to do.

    This can also be achieved via the Terminal by running:

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

    Restart your computer.

  • Dennis

    For me it seems to have been related to having a Cinnamon desktop installed that I was playing around with. Once I removed it using Failed to load session "ubuntu" - Ubuntu 13.10 on MacBook Pro everything was fine. ( I don't have a macbook pro, it was the same on my Dell desktop).