Closed tymonx closed 6 months ago
It seems that distrobox enter
adds --env XAUTHORITY=${XAUTHORITY}
anyway in that generic for-loop: https://github.com/89luca89/distrobox/blob/1.7.2.1/distrobox-enter#L443
But still it is not present when doing:
env | grep XAUTHORITY
But if I run created container by distrobox create
using podman exec
:
podman exec --interactive --tty --detach-keys="" --user=root --workdir="${HOME}" --env XAUTHORITY <container> su "${USER}" --pty
Then the XAUTHORITY
environment variable is not empty. I'm trying to narrow the issue here. Above command is also ran by distrobox enter
. After podman exec
and before <container>
the distrobox enter
adds bunch of additionals --env
. Something is causing that the XAUTHORITY
environment variable is unset after switching from root
to user.
Short story. When --env DISPLAY=:0
is present, it will clear XAUTHORITY
. I have been using custom AlmaLinux OS 9.3 with added user etc.. Somehow when calling su "${USER}" --pty
when switching from root
to user by distrobox enter
, it clears XAUTHORITY
environment variable. With vanilla AlmaLinux OS 9.3 it doesn't happen.
Not working host-spawn
in distrobox-init
is OK/not relavant for me because it should be fixed by distrobox-enter
and --env XAUTHORITY
from this loop https://github.com/89luca89/distrobox/blob/1.7.2.1/distrobox-enter#L443
I will try to narrow problem in my custom container image based on AlmaLinux OS 9.3 and share minimum Dockerfile
to reproduce that.
This kinda a bug and change request /suggestion in the same time.
Describe the bug The
XAUTHORITY
environment variable is not set because thehost-spawn
is not working.This is Linux distro and OS environment specific. Cannot reproduce easy without Virtual Machine.
distrobox
:distrobox
:XAUTHORITY
:It will return nothing.
host-spawn
:It will return nothing.
To Reproduce
Not that easy to reproduce that. Unknown reason why the
host-spawn
is not working. Linux distro specific, Kinoite version39
.Expected behavior
XAUTHORITY
environment variable set using value from host sideLogs
Desktop (please complete the following information):
Additional context
I want to propose a change request. I can prepare a Pull Request. If we move setting the
XAUTHORITY
environment variable andXAUTH
from thedistrobox-init
to thedistrobox-enter
and simple use--env
container option, then we could remove need ofhost-spawn
call from container side and simplify logic in the same time.