neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.81k stars 1.73k forks source link

gnome-terminal won't open on xrdp remote desktop #2091

Closed reos-rcrozier closed 2 years ago

reos-rcrozier commented 2 years ago

I have been trying out accessing a Mint Linux machine using xrdp. Mint linux is an ubuntu derivative and this version is based on Ubuntu 20.04.3 LTS (Focal Fossa). I can connect fine, and so far all the programs work. However gnome-terminal cannot be launched.

When I try to launch gnome-terminal by clicking in the GUI I get the spinning disk for a while, but nothing happens.

I was able to install xterm and start it, and when I try to launch gnome-teminal from there I get

$ gnome-terminal -v
# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached

It works fine when not remote. I have only tested this behaviour when connecting from another Linux machine using the Remmina client.

reos-rcrozier commented 2 years ago

I just tried again with this, and bizarrely it is now working fine.

matt335672 commented 2 years ago

If you can reproduce this, let us know. Otherwise I'll close this in a week or so.

Hope this helps.

imneedham commented 2 years ago

I can reproduce this on a VM I set up for one of my users. I'm working on standing up a new VM with minimal modifications so his work isn't interrupted by testing, but here's the basic run down.

  1. Install Ubuntu 20.04 server
  2. Install xrdp and xfce4 (sudo apt install xdrp xfce4)
  3. Edit /etc/xrdp/startwm.sh so that it ends with
    
    #test -x /etc/X11/Xsession && exec /etc/X11/Xsession
    #exec /bin/sh /etc/X11/Xsession

startxfce4 exit(0)

4. login via xdrp. When I click the button to launch the terminal, nothing happens. 

Checking syslog, I find lines like this

Feb 23 17:51:54 ubu20-dpss-core8 dbus-daemon[4827]: [session uid=1000 pid=4827] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.79' (uid=1000 pid=5212 comm="/usr/bin/gnome-terminal.real " label="unconfined") Feb 23 17:51:54 ubu20-dpss-core8 systemd[4801]: Starting GNOME Terminal Server... Feb 23 17:51:54 ubu20-dpss-core8 systemd[4801]: gnome-terminal-server.service: Main process exited, code=exited, status=10/n/a Feb 23 17:51:54 ubu20-dpss-core8 gnome-terminal-server[5215]: Unable to init server: Could not connect: Connection refused Feb 23 17:51:54 ubu20-dpss-core8 gnome-terminal-server[5215]: Failed to parse arguments: Cannot open display: Feb 23 17:51:54 ubu20-dpss-core8 systemd[4801]: gnome-terminal-server.service: Failed with result 'exit-code'. Feb 23 17:51:54 ubu20-dpss-core8 systemd[4801]: Failed to start GNOME Terminal Server.



If I open xfce-terminal (it works) and execute gnome-terminal, I get the message provided by the OP. I can work around it by executing `dbus-launch gnome-terminal`.

I have no trouble using gnome-terminal when I log in at the console.

As I'm typing this up it occurs to me that Step 3 may be problematic. Without it I was disconnected immediately after connecting via xdrp, and this was a solution I found.
imneedham commented 2 years ago

After the test VM came up I experimented to see if I could come up with a better solution than my Step 3 above. I've replaced it with sudo update-alternatives --config x-session-manager and selecting xfce4-session, and I can now successfully connect with xrdp. More importantly, I was unable to reproduce the problem on the new VM. I went back to the systems where this was originaly reported to me, removed the Step 3 modifications and updated session alternatives, and I can no longer reproduce the problem on that system as well.

Just to be sure, I put the changes to startwm.sh in place, reboot, and the gnome-terminal problem was there. After removing the changes to startwm.sh and rebooting, gnome-terminal worked fine.

Self-imposed problem solved, apparently.

bmullan commented 2 years ago

@imneedham
To install XFCE desktop on Ubuntu & let the installation take care of most of the config run either of:

$ sudo apt install xubuntu-desktop -y
or...
$ sudo tasksel install $xubuntu-desktop

imneedham commented 2 years ago

Unfortunately, xubuntu-desktop includes 576 additional packages, including the whole "workstation" environment. If someone is looking for a workstation, xubuntu is great, but for a "server" install that also needs a gui, xubuntu seems to add a lot of overhead. Simply adding xrdp and xfce4 they way I did probably isn't ideal, but it's the best way I've found so far.

I want to be sensitive to adding noise to this issue. I'm happy to drop it, continue discussing in another medium, or keep going. :)

bmullan commented 2 years ago

Unfortunately, xubuntu-desktop includes 576 additional packages, including the whole "workstation" environment.

Oh, okay... then you want to install the xubuntu "minimal" desktop:

Install Minimal Xfce Desktop

To install minimal Xfce GUI on Ubuntu server:

$ sudo apt-get install --no-install-recommends xubuntu-desktop

Brian

imneedham commented 2 years ago

That's a lot better - only 56 additional packages. I've not looked at them and will assume that the everyday overhead is minimal, but it's still 50-something packages that don't appear to be needed? When every installed package is a security liability, that seems like a lot of risk just to avoid running update-alternatives. Or is there more post-install configuration I'm missing, resulting in a seemingly unrelated problem getting reported down the road? :)

bmullan commented 2 years ago

@imneedham my email is in my github profile... if you want to continue this thread re minimal desktop

fatemeh-mohseni-AI commented 7 months ago

Unfortunately, xubuntu-desktop includes 576 additional packages, including the whole "workstation" environment.

Oh, okay... then you want to install the xubuntu "minimal" desktop:

Install Minimal Xfce Desktop To install minimal Xfce GUI on Ubuntu server: $ sudo apt-get install --no-install-recommends xubuntu-desktop

Brian

this helped me . thanks