Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connected to GNOME desktop environment instead of ubuntu-gnome custom version #1723

Closed
giuliotripi opened this issue Nov 13, 2020 · 3 comments

Comments

@giuliotripi
Copy link

I installed xrdp on a fresh Ubuntu 20.04.1 install.
When I connect from xrdp I expect to land in the Ubuntu version of Gnome, like I do when I login form the physical PC.
I tried to add a .xsession file in the home of the user I was logging in to, with content

gnome-session --session=ubuntu

but it didn't change anything.

That's what the desktop looks like when I log in from a remote PC
image
That's what the desktop looks like when I log in from the local PC
image

@drewer
Copy link

drewer commented Dec 2, 2020

apply to ~/.xsessionrc

export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg

@matt335672
Copy link
Member

Thanks to @drewer for an excellent answer. I was looking for a bit more explanation as to what is happening here, and the above post put me very much on the right track.

I can't add much to @drewer's answer, except for the following two things.

  1. The standard login scripts /etc/profile.d/xdg_dirs_desktop_session.sh and /etc/X11/Xsession.d/60x11-common_xdg_path use the DESKTOP_SESSION variable (if defined) to set both XDG_CONFIG_DIRS and XDG_DATA_DIRS. So rather than the set above, you should probably use:-

    export DESKTOP_SESSION=ubuntu
    export GNOME_SHELL_SESSION_MODE=ubuntu
    export XDG_CURRENT_DESKTOP=ubuntu:GNOME
    
  2. if you want to do this on a global level, add the three lines above to the pre_start() function in /etc/xrdp/startwm.sh.

The reason that the xrdp default screen is different is simply that the GDM display manager works somewhat differently from the /etc/X11/Xsession script used by xrdp startwm.sh.

GDM sets some environment variables, parses a session file in /usr/share/xsessions, and then calls a totally different script /etc/gdm3/Xsession, passing the Exec= line from the session file as a parameter. This script is only available on systems which have gdm3 installed.

@giuliotripi, @drewer - are you both happy with what I've added here? Can I close this?

@giuliotripi
Copy link
Author

Perfect, thank you both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants