Open thijsputman opened 1 year ago
I'm seeing this issue as well:
C:\Users\Justin>wsl --version
WSL version: 1.2.0.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
My current workaround is to install pinentry-qt
and set it as the pinentry-program
in gpg-agent.conf
I'm also having this issue at work since a few days. My WSL VM is running Debian Bookworm with systemd enabled, which worked fine so far.
This seems to be an issue with DBUS - running dbus-update-activation-environment --systemd --all
fixes the issue for me.
It appears that the DBUS socket takes a few seconds after boot before it becomes available. So my complete block for gpg-agent in ~/.config/fish/config.fish
now looks like this:
if status is-interactive
set -e SSH_AGENT_PID
set -g -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
set -g -x GPG_TTY (tty)
while ! test -S "$XDG_RUNTIME_DIR"bus; sleep 1; end
systemctl --user start gpg-agent.service
dbus-update-activation-environment --systemd --all
end
That way, the first WSL terminal tab will take a few seconds to become usable, but once the DBUS socket is ready, new terminal tabs open immediately.
Very in-depth information about DBUS and pinentry can be found in the comments of this ticket: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911768
This seems to be an issue with DBUS - running
dbus-update-activation-environment --systemd --all
fixes the issue for me.
Thanks; that does the trick here too!
It appears sufficient to use dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY
(as per the examples in the manual).
It does result in an odd issue with the pinentry window's border/chrome not getting styled properly:
Previously the popup was properly styled — all other WSLg windows still are...
quoting @smcv from the Debian issue I linked above:
pinentry-gnome3 is presumably a D-Bus client that wants to communicate with the D-Bus service in gcr (which pops up a GNOME Shell system-modal dialog if you're running a full GNOME environment, or an ordinary X11 window with appropriate grabs and other magic otherwise), falling back to curses if it can't.
That might explain why it's not properly themed. Maybe there are other environment variables missing?
This could also be a X11 vs. Wayland issue.
Here, all applications running on X11 have window decorations like the one on your screenshot, all native Wayland apps have the Gnome window decorations. Have you tried GDK_BACKEND=wayland
?
Setting GDK_BACKEND
to anything other than x11
causes both pinentry and WSLg as a whole to fail (cannot open display: :0
).
Anyway, it's not that much of an issue. Just a curious by-product of (what I assume is) the underlying issue...
Windows Version
Microsoft Windows [Version 10.0.22621.1485]
WSL Version
1.2.0.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.90.1
Distro Version
Ubuntu 22.04.2
Other Software
Running WLS2 with
systemd
enabled.Repro Steps
Expected Behavior
A WSLg pin-entry prompt window opens on my desktop.
As part of SSH/GPG-operations, until a couple days ago (probably WSL2 version 1.1.6) a WSLg pin-entry prompt window would open on my desktop. Recently I started getting a ncurses pin-entry prompt in the terminal instead.
WSLg itself is working fine (e.g.,
gnome-system-monitor
opens System Monitor as expected).Actual Behavior
Diagnostic Logs
No response