distrobox icon indicating copy to clipboard operation
distrobox copied to clipboard

[Bug] XDG_ env variables still not being set when created with --home

Open bvngee opened this issue 1 year ago • 4 comments

The problem I'm having is the exact same as in #420: With a --home set during distrobox-create, XDG_CONFIG_HOME and related env variables are still relative to the host's home dir. I see a fix was implemented here in this commit, and I've manually double checked that that code snippet is present in my version of distrobox, but for whatever reason the issue persists. I have no idea why.

  1. first I ran distrobox create -i docker.io/library/debian:stable-backports -n Debian --hostname debian --home ~/distrobox/debian-home --nvidia
  2. distrobox enter Debian
debian% echo $HOME
/home/<user>/distrobox/debian-home
debian% echo $XDG_CONFIG_HOME
/home/<user>/.config

Expected behavior

debian% echo $HOME
/home/<user>/distrobox/debian-home
debian% echo $XDG_CONFIG_HOME
/home/<user>/distrobox/debian-home/.config

Logs podman logs --latest: podman_latest.txt

Desktop:

  • Are you using podman, docker or lilipod? podman
  • Which version or podman, docker or lilipod? podman version 5.0.3
  • Which version of distrobox? distrobox: 1.7.2.1
  • Which host distribution? NixOS
  • How did you install distrobox? via the nixpkgs package

bvngee avatar Jun 03 '24 05:06 bvngee

This works for me:

image

Can you try with latest git version?

89luca89 avatar Jun 19 '24 14:06 89luca89

This works for me: ... Can you try with latest git version?

Yup, I just cloned the distrobox repo from git and ran the exact same command that you did:

image

bvngee avatar Jun 26 '24 07:06 bvngee

@BvngeeCord thanks for trying!

Strange, it seems probably there is something in either your profile or dotfiles setting them?

Can you try with distrobox enter --dry-run and see if the env is set correctly?

image

89luca89 avatar Jun 27 '24 08:06 89luca89

@BvngeeCord thanks for trying!

Strange, it seems probably there is something in either your profile or dotfiles setting them?

Can you try with distrobox enter --dry-run and see if the env is set correctly?

Yup! This is interesting.. image

bvngee avatar Jul 01 '24 06:07 bvngee

@Bvngee I think if that's the case then it's not a distrobox problem, but you have something (like dotfiles or configs) setting those variables for you AFTER the login

89luca89 avatar Oct 12 '24 10:10 89luca89