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

The app won't open in RDP session. #34

Open
archerallstars opened this issue May 31, 2021 · 8 comments
Open

The app won't open in RDP session. #34

archerallstars opened this issue May 31, 2021 · 8 comments

Comments

@archerallstars
Copy link

archerallstars commented May 31, 2021

The app works fine in a normal session. But when I remoted my desktop through RDP connection (xrdp) and tried to open the app, nothing happened even after entering my user password.

OS: Ubuntu 21.04 - 64 bit.
I install the app in Ubuntu store.

@costales
Copy link
Owner

costales commented May 31, 2021 via email

@archerallstars
Copy link
Author

Hi, I would say it is because of Wayland. I can't do anything about it. Could you try x.org? Thanks. -- Costales.

I am using x.org since xrdp supports only x.org, no Wayland. Also, Wayland doesn't support RDP through PipeWire yet.

@fama
Copy link

fama commented Nov 16, 2021

Same problem here. Running Linux Mint Cinnamon 20.2 version. When I connect over XRDP to the machine, I get the errors:

Running gufw in XRDP session gets the following error:

$ sudo gufw
/usr/bin/gufw: line 2: [: =: unary operator expected
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Could not connect: Connection refused

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gdk-CRITICAL **: 09:11:30.990: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.990: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.991: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.991: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(gufw.py:74571): Gtk-CRITICAL **: 09:11:30.991: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
/usr/bin/gufw-pkexec: line 10: 74571 Segmentation fault      (core dumped) python3 ${LOCATIONS[${i}]} $1

The session is X11:

echo $XDG_SESSION_TYPE
x11

The first error is unrelated. When running the first line in /bin/gufw makes the test in the if brackets fail:

echo $(loginctl show-session $(loginctl|grep $(whoami) |awk '{print $1}') -p Type)
Type=x11 Type=x11 Type=x11

I was able to start the gufw preserving the environment (the unary operator error is still there, but the app launched):

sudo -E gufw
/usr/bin/gufw: line 2: [: =: unary operator expected

@dominikborkowski
Copy link
Contributor

dominikborkowski commented Sep 19, 2022

There's a bug filed with Ubuntu itself, we'll see which one gets more traction. There are two issues here:

  1. startup script parses output of loginctl and it breaks if there are more than one lines (which is expected on xrdp connection). To solve that the second line of /bin/gufw needs a small head -1 change:

from:

if [ $(loginctl show-session $(loginctl|grep $(whoami) |awk '{print $1}') -p Type) = "Type=wayland" ]; then

to

if [ $(loginctl show-session $(loginctl|grep $(whoami) |awk '{print $1}') -p Type | head -1 ) = "Type=wayland" ]; then
  1. Step 1 will not solve segfault, that's caused by polkit policy not having the correct path. Adjust /usr/share/polkit-1/actions/com.ubuntu.pkexec.gufw.policy and change:
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/gufw-pkexec</annotate>

To:

    <annotate key="org.freedesktop.policykit.exec.path">/bin/gufw-pkexec</annotate>

Hope that helps folks looking for a solution, and it makes it into Ubuntu's repos. As it stands, both 20 and 22 are affected.

@dominikborkowski
Copy link
Contributor

I can't believe I missed it earlier, the issue is caused by Ubuntu's decision to symlink /bin to /usr/bin. With /bin/ being earlier in $PATH, this means /bin/gufw-pkexec is executed and fails.

@costales
Copy link
Owner

costales commented Sep 19, 2022 via email

@dominikborkowski
Copy link
Contributor

dominikborkowski commented Sep 19, 2022 via email

@dominikborkowski
Copy link
Contributor

A small update. The issue ultimately lies with xrdp not reading /etc/environment and having wrong order of elements in $PATH. It was identified by upstream, and fixed in newer versions of Debian and Ubuntu (22 only).

To fix this on earlier versions of Ubuntu, /etc/pam.d/xrdp-sesman will need to include two additional directives (line 2 & 3), the full file should look like this:

#%PAM-1.0
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale
@include common-auth
@include common-account
@include common-session
@include common-password

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

4 participants