You are not logged in.
Hi everyone,
I followed the instructions about setting up rootless Xorg for security reasons. I use Ly as my display manager and to start my i3 desktop.
After I installed gufw, the GUI front-end to the ufw firewall, I tried to start it. It opens a polkit request since it needs root privileges. Unfortunately gufw fails with the following error messages:
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gdk-CRITICAL **: 13:39:04.901: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.901: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.902: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.902: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:5735): Gtk-CRITICAL **: 13:39:04.902: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
/sbin/gufw-pkexec: line 2: 5735 Segmentation fault (core dumped) python3 /usr/lib/python3.9/site-packages/gufw/gufw.py "$@"
Please correct me if I am wrong, but my guess would be that this has somehow to do with Xorg running in rootless mode. I was unable to find anything regarding this in the Wiki pages I visited so far and the forum search did not turn uo anything as well. If you need more information please tell me what kind of it is required here. I am appreciating any tips how to resolve this.
Last edited by Sapiens (2021-07-15 11:43:42)
Offline
Are you running something like lxpolkit?
Offline
Are you running something like lxpolkit?
Yes I installed polkit and run the mate-polkit frontend. When I try to start gufw it asks for my password!
Offline
Did that resolve the issue?
Otherwise please post your xinitrc.
Offline
Did that resolve the issue?
Otherwise please post your xinitrc.
No it did not resolve the issue. I already had polkit and a frontend installed.
.xinitrc
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
exec i3
Offline
The xinitrc is fine, next:
hostnamectl # post the output
xhost +
gufw # does this now work?
xhost - # don't keep the server open
Offline
Have you tried this without the Ly DM?
"the wind-blown way, wanna win? don't play"
Offline
hostnamectl:
[sapiens]$ hostnamectl
Static hostname: piends
Icon name: computer-laptop
Chassis: laptop
Machine ID: e44e93f0d942420d91cb13aa962ea0d0
Boot ID: f678df1243ea41baae3d1e31d219ccde
Operating System: Arch Linux
Kernel: Linux 5.12.14-arch1-1
Architecture: x86-64
Hardware Vendor: Dell Inc.
Hardware Model: XPS 15 9550
xhost +
gufw:
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.592: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.592: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.592: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.592: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.592: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gdk-CRITICAL **: 21:20:20.593: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.593: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.594: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.594: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:8937): Gtk-CRITICAL **: 21:20:20.594: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
/sbin/gufw-pkexec: line 2: 8937 Segmentation fault (core dumped) python3 /usr/lib/python3.9/site-packages/gufw/gufw.py "$@"
Also I was unsure if this has anything to do with the .xserverrc file I created for the rootless Xorg. So I reverted the change, commented out the exec line in the file and restarted i3. But this also did not help. I am also not really sure if rootless Xorg is the reason why it fails.
# for rootless xorg
exec /usr/bin/Xorg -nolisten tcp -nolisten local -keeptty "$@" vt$XDG_VTNR
Last edited by Sapiens (2023-01-07 17:02:21)
Offline
I am also not really sure if rootless Xorg is the reason why it fails.
Rather not.
You're not denied the X11 access and it's also not the usual broken xinitrc.
echo $DISPLAY
?
Offline
echo $DISPLAY
returns
:0
I made some progress because I found this site: https://unix.stackexchange.com/question … in-line-13
sudo gufw-pkexec
When I run this command gufw actually starts! This is from the 4th answer below the question. I am hesitant to do the suggested changes, tough. I do not understand the suggested changes and I do not want to compromise security.
Offline
Edit /usr/bin/gufw and make it
…
pkexec /usr/bin/gufw-pkexec …
ie. w/ the full path.
Does that work?
Edit: please also edit your original post and edit the subject. This is a *very* gufw specific situation.
Last edited by seth (2021-07-06 20:01:51)
Offline
Edit /usr/bin/gufw and make it
… pkexec /usr/bin/gufw-pkexec …
ie. w/ the full path.
Does that work?
That does indeed work, thank you. Also I do not understand really why this works, if you can explain it to me I would be grateful. I thought gufw-pkexec should be found via the PATH variable since it is in `/usr/bin`, or not? Or why not giving the full path leads to these error messages?
Last edited by Sapiens (2021-07-06 21:05:11)
Offline
type gufw-pkexec
However the polkit rule shipped w/ gufw assigns exec.allow_gui to that very absolute path and the linked thread had somebody changing the rule to /sbin which is typically a symlink these days so I speculated that polkit might resolve this differently and run eg. /bin/gufw-pkexec which (though the same file) doesn't meet the path requirement.
Offline
Thank you! The first occurrence of gufw-pkexec should be in /usr/bin if you search the folders from $PATH in the given order and not follow any links. When following links the first occurrence is /sbin/gufw-pkexec, which is a link to /usr/bin/gufw-pkexec. It is therefore not clear to me why the script needed the full path, since always the correct file should be called. Nevermind, this topic is solved and I will mind it no more. Thank you again for your help!
Offline
should be in
https://www.youtube.com/watch?v=5RyYrs5tu60
which gufw-pkexec
sudo which gufw-pkexec
Edit:
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Last edited by seth (2021-07-13 14:04:55)
Offline
[sapiens]$ which gufw-pkexec
/sbin/gufw-pkexec
[sapiens]$ sudo which gufw-pkexec
[sudo] password for sapiens:
/sbin/gufw-pkexec
[sapiens]$ readlink -f /sbin/gufw-pkexec
/usr/bin/gufw-pkexec
Last edited by Sapiens (2023-01-07 17:03:09)
Offline
As you can see, /sbin is preferred.
"echo $PATH" and "sudo env | grep PATH" shall tell you why.
Offline
I think I get part of it now! The file in /sbin/gufw-pkexec is not a link, but a copy of the file in /usr/bin/gufw-pkexec. I was so confused because I used the readlink command wrongly and its output was the path I wanted to see. If you might know this I would be interested why two instances of this file exist when we can use only one correctly?
Offline
stat /sbin/gufw-pkexec /bin/gufw-pkexec /usr/bin/gufw-pkexec /sbin /bin /usr/bin
Offline
I see. Thanks for the hint.
To put it in a nutshell /sbin and /bin are links to /usr/bin and with that the file in /sbin /bin /usr/bin are one and the same file. The only complete path without any links in it for the file is /usr/bin/gufw-pkexec, the path we specified.
Thank you a lot for the in depth guidance!
Offline