89luca89/distrobox

[Error] Distrobox is not location independent.

Open

#315 opened on Jun 7, 2022

 (18 comments) (2 reactions) (0 assignees)Go (536 forks)batch import
bughelp wantedhost-distrowait-on-user

Repository metrics

Stars
 (12,865 stars)
PR merge metrics
 (Avg merge 2d 4h) (17 merged PRs in 30d)

Description

Describe the bug distrobox-enter fails if location of distrobox-scripts changed on disk.

To Reproduce This happened to me with Nix on Ubuntu when updating and the old distrobox version got GC'd from the nix store:

  1. Assume a nix-enabled system
  2. Get older distrobox: nix-store -r /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  3. Create a box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-create --name testbox --image ubuntu:20.04
  4. Enter box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-enter testbox and leave again - works.
  5. Stop box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-stop testbox
  6. Remove old distrobox: nix-store --delete /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  7. Get newer distrobox: nix-store -r /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0
  8. Try to enter box /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0/bin/distrobox-enter testbox and observe reference to old version in failure message.
  9. Get older distrobox again: nix-store -r /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  10. Try to enter box /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0/bin/distrobox-enter testbox and observe things work.

Expected behavior Distrobox should map its own location to a static path inside the container. (Distrobox already has great Nix support!)

Logs Podman logs do not provide any useful data.

Desktop (please complete the following information):

  • Are you using podman or docker? Podman
  • Which version or podman or docker? Podman 4.1.0 (/nix/store/76hhw9w196lpwmkyzh4c526ax6sb19gs-podman-wrapper-4.1.0/bin/podman)
  • Which version of distrobox? 1.2.15 and 1.3.0, see above

Contributor guide