You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When exporting applications installed in a distrobox container to the host, the environment variables within the container are not correctly set up when executing commands via distrobox-enter -- command. This results in the PATH environment variable from the host being used instead of the one from the container, causing the application to fail to find its executable.
To Reproduce
Export an application from a distrobox container to the host, that is not installed in a path that is also a part of the host $PATH creating a .desktop file.
Attempt to run the exported application from the host.
Check the PATH environment variable by running echo $PATH through distrobox-enter.
Expected behavior
The PATH environment variable should reflect the container's environment, ensuring that the application can locate its executable.
Actual behavior
The PATH environment variable reflects the host's environment, causing the application to fail due to missing paths.
Desktop (please complete the following information):
Are you using podman, docker or lilipod?
Podman
Which version or podman, docker or lilipod?
5.1.1
Which version of distrobox?
1.7.2.1
Which host distribution?
Aurora (Fedora Silverblue)
How did you install distrobox?
Preinstalled but changed to latest from git instead of the provided one
Additional context
Im using openSUSE with the nix package-manager inside the container so i need ~/.nix-profile/bin on the path to able to find the applications.
If you would like to reproduce it with a nix package there is also a bug with the distrobox-export command. because the path .nix-profile/share/applications is a symlinc to /nix/store/...
I solved that problem by adding a trailing / to line 435 so the find command only checks for files and links inside applications
I am having the same issue. I have installed and exported Android Studio in an Ubuntu container as well as the Flutter/Dart SDKs which are all in the container path. Exporting Android Studio works but the path is still the hosts' which breaks everything.
The problem relies in the command you're using to test this, just doing enter -- echo $PATH will just print the host PATH because $PATH is evaluated by the shell BEFORE entering into distrobox
try
luca-linux@framework13:~$ distrobox enter default_distrobox -- sh -c "echo \$PATH"
/var/lib/flatpak/exports/bin:/home/luca-linux/bin:/home/luca-linux/.local/share/flatpak/exports/bin:/home/luca-linux/.local/bin:/home/luca-linux/.config/emacs/bin/:/var/lib/flatpak/exports/bin:/home/luca-linux/bin:/home/luca-linux/.local/share/flatpak/exports/bin:/home/luca-linux/.local/bin:/home/luca-linux/.config/emacs/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/luca-linux/.local/flutter/flutter/bin:/home/luca-linux/.local/flutter/flutter/bin/cache/dart-sdk/bin/snapshots:/usr/sbin:/usr/local/sbin:/home/luca-linux/.local/flutter/flutter/bin:/home/luca-linux/.local/flutter/flutter/bin/cache/dart-sdk/bin/snapshots:/usr/sbin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
luca-linux@framework13:~$ echo $PATH
/var/lib/flatpak/exports/bin:/home/luca-linux/bin:/home/luca-linux/.local/share/flatpak/exports/bin:/home/luca-linux/.local/bin:/home/luca-linux/.config/emacs/bin/:/var/lib/flatpak/exports/bin:/home/luca-linux/bin:/home/luca-linux/.local/share/flatpak/exports/bin:/home/luca-linux/.local/bin:/home/luca-linux/.config/emacs/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/luca-linux/.local/flutter/flutter/bin:/home/luca-linux/.local/flutter/flutter/bin/cache/dart-sdk/bin/snapshots:/usr/sbin:/usr/local/sbin:/home/luca-linux/.local/flutter/flutter/bin:/home/luca-linux/.local/flutter/flutter/bin/cache/dart-sdk/bin/snapshots:/usr/sbin:/usr/local/sbin
luca-linux@framework13:~$
Describe the bug
When exporting applications installed in a distrobox container to the host, the environment variables within the container are not correctly set up when executing commands via distrobox-enter -- command. This results in the PATH environment variable from the host being used instead of the one from the container, causing the application to fail to find its executable.
To Reproduce
Expected behavior
The PATH environment variable should reflect the container's environment, ensuring that the application can locate its executable.
Actual behavior
The PATH environment variable reflects the host's environment, causing the application to fail due to missing paths.
Example
On the host:
Using distrobox-enter -- command:
Entering the container interactively:
Desktop (please complete the following information):
Additional context
Im using openSUSE with the nix package-manager inside the container so i need ~/.nix-profile/bin on the path to able to find the applications.
If you would like to reproduce it with a nix package there is also a bug with the distrobox-export command. because the path
.nix-profile/share/applications
is a symlinc to /nix/store/...I solved that problem by adding a trailing / to line 435 so the find command only checks for files and links inside applications
[ -d "${xdg_data_dir}/applications" ] && canon_dirs="${canon_dirs} ${xdg_data_dir}/applications/"
The text was updated successfully, but these errors were encountered: