89luca89 / 89luca89/distrobox

[Error] distrobox-init errors out then using a ostree based distribution inside and outside the distrobox

Aberta Para iniciantes
#1,934 0 comentários 1 reação 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Go
Estrelas
13k
Forks
541
Merge médio
20h 47min
PRs com merge (30d)
4

Descrição

**Describe the bug**

I have a ostree-based distribution on my host and use the same distribution in distrobox.

The distrobox contains a symlink from /home to var/home (as does the system outside!). Distrobox mounts my home dir into /var/home/distrobox as expected. When just using the generated container without triggering `distrobox-init` the container works well. `distrobix-init` is not happy though: It tries to bind mount `/run/host/var/home/USER` to `/home/USER` and gets a bit confused :-)

**To Reproduce**

Use e.g. bluefin on your host and use a bluefin-image as image for a distrobox.

**Expected behavior**

This works:-)

**Logs**

Not necessary...

**Desktop (please complete the following information):**

- I am using podman 5.7.0
- distrobox is at 1.8.2.2
- The distribution is bluefin, based on fedora 43 and a home-made build of the same distribution inside distrobox
- It is in the default install.

**Additional context**

This fixes the issue for me:

```diff
--- /usr/bin/distrobox-init 1970-01-01 01:00:00.000000000 +0100
+++ bin/distrobox-init 2025-12-13 15:29:44.644475671 +0100
@@ -1900,8 +1900,8 @@

# On some ostree systems, home is in /var/home, but most of the software expects
# it to be in /home. In the hosts systems this is fixed by using a symlink.
-# Do something similar here with a bind mount.
-if [ -e "/var/home/${container_user_name}" ]; then
+# Do something similar here with a bind mount, if /home is not a symlink already
+if [ -e "/var/home/${container_user_name}" && ! -L /home ]; then
if ! mount_bind "/run/host/var/home/${container_user_name}" "/home/${container_user_name}"; then
printf "Warning: Cannot bind mount %s to /run/host%s\n" "/var/home" "/home"
fi
```

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

A correção é fornecida no corpo da issue como um diff para /usr/bin/distrobox-init. Comece localizando o script distrobox-init no repositório, provavelmente no diretório raiz ou em um diretório bin. Entenda a lógica de montagem em torno da linha 1900, concentrando-se na condição para sistemas ostree. Teste a alteração em um ambiente de contêiner para garantir que ela funcione quando /home for um link simbólico. Verifique executando comandos distrobox com uma distribuição baseada em ostree como Bluefin.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
bash, docker, shell
Domínio
cli
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
65/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.