Giter VIP home page Giter VIP logo

Comments (8)

fama avatar fama commented on August 22, 2024 1

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

from gufw.

costales avatar costales commented on August 22, 2024

from gufw.

archerallstars avatar archerallstars commented on August 22, 2024

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.

from gufw.

dominikborkowski avatar dominikborkowski commented on August 22, 2024

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.

from gufw.

dominikborkowski avatar dominikborkowski commented on August 22, 2024

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.

from gufw.

costales avatar costales commented on August 22, 2024

from gufw.

dominikborkowski avatar dominikborkowski commented on August 22, 2024

from gufw.

dominikborkowski avatar dominikborkowski commented on August 22, 2024

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

from gufw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.