Cannot open display while running X Apps as anothe

2019-09-02 17:47发布

问题:

I am currently using X11RDP to connect to a RHEL 6.5 endpoint, as root user. All X apps work fine, and directed properly to the right display (say 11.0).

Now if I switch to another user (su - user1), then I try to open any X app (say xterm) it will be unable to open the display (even though it is also 11.0).

I do not believe the problem to be with xauth (magic cookies, etc), or the DISPLAY environment variable not being set correctly, or allowing connection with xhost +; but rather something with XRDP.

Any help would be appreciated.

回答1:

The solution to my problem was actually in how x11rdp was starting.

It starts the x server with -nolisten tcp.

If that part is commented out in /etc/xrdp/sesman.ini for x11rdp then the problems described above will be gone.

Hope this helps other people experiencing the same problems.