89luca89 / 89luca89/distrobox

[Error] rootless distrobox cannot receive udev events from the host with podman

Aberta
#1,961 2 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

See containers/toolbox#1203, also [this comment](https://github.com/containers/toolbox/issues/1203#issuecomment-3740950038).

The root cause is containers/podman#27898. I do not know the scope of this bug when the runtime is docker/lilipod/nerdctl.

TLDR: Due to a podman behavior that maps `kernel.overflowuid` into the rootless userns, libudev's userns detection logic fails to trigger, causing all hotplug detection mechanisms from within the distrobox to ignore host new device events. (for example, a wayland compositor launched from within distrobox will fail to detect any new input devices, existing devices at startup will be fine as long as they are not disconnected)

The biggest uncertainty here is that I do not know if this behavior is intended from the podman side or a bug, so we need to see how the podman maintainers respond.

For the scope of distrobox, the obvious workaround for this is to use the `--userns=keep-id:size=` flag to avoid mapping onto the overflowuid. For default setups where `kernel.overflowuid` is set to `65534`, adding this to distrobox creation would make everything work: `-a "--userns=keep-id:size=65534"` since this will override the default flag distrobox gives to podman. (Theoretically this might make images that fill the UID space unusable but I can't really say that is a practical concern)

I am not sure if we would want to make this workaround flag the default in distrobox, this still depends on whether podman want to change it or not. But if the distrobox maintainers do not think this is a bug that should be addressed in distrobox, feel free to convert this issue into a discussion to keep the workaround flag documented before any upstream fixes are landed.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

The issue is about rootless distrobox containers not receiving udev events due to a podman behavior. Start by examining the podman command-line flags distrobox uses, particularly around userns mapping. Look at the distrobox source for where container runtime arguments are constructed. The workaround involves adding `--userns=keep-id:size=65534`. Testing requires creating a distrobox container and checking if host device events are detected inside. Done looks like verifying the workaround resolves the issue and deciding if it should be default.

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

Avaliação

Stack de tecnologia
bash, docker, go, linux
Domínio
cli, tooling
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

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